erlang调试技术之etop

时间:2022-06-01 18:39:51

etop是erlang进程信息查看工具,类似于UNIX的top.

一、配置参数

node
The measured node.
Value: atom()

Mandatory
setcookie
Cookie to use for the etop node - must be the same
as the cookie on the measured node.

Value: atom()
lines
Number of lines (processes) to display.

Value: integer()

Default: 10
interval
The time interval (in seconds) between each update of
the display.

Value: integer()

Default: 5
accumulate
If true the execution time and reductions are
accumulated.

Value: boolean()

Default: false
sort
Identifies what information to sort by.

Value: runtime | reductions | memory | msg_q
Default: runtime (reductions if
tracing=off)
tracing
etop uses the erlang trace facility, and thus no
other tracing is possible on the measured node while
etop is running, unless this option is set to
off. Also helpful if the etop tracing causes too
high load on the measured node. With tracing off, runtime is
not measured.

Value: on | off
Default: on

二、EXPORTS

start() -> ok

This function starts etop. Note that etop is preferably started with the etop and getop scripts

start(Options) -> ok

Types:

Options = [Option]
Option = {Key, Value}
Key = atom()
Value = term()

This function starts etop. Use
help/0 to see a
description of the possible options.

help() -> ok

This function prints the help of etop and
its options.

config(Key,Value) -> Result

Types:

Result = ok | {error,Reason}
Key = lines | interval | accumulate | sort
Value = term()

This function is used to change the tool's configuration
parameters during runtime. The table above indicates the
allowed values for each parameter.

dump(File) -> Result

Types:

Result = ok | {error,Reason}
File = string()

This function dumps the current display to a text file.

stop() -> stop

This function terminates etop.

三、实例

1、启动etop监控远程节点

erl -sname aa -remsh remote@domain

etop:start([{output,text},{lines,10},{sort,reductions},{accumulations,true},{interval,10}]).

或者etop -sname local@domain -lines 10 -sort reductions -accumulations true -interval 10 -setcookie remotecookie -remsh remote@domain(系统shell下执行)

========================================================================================
tiger@durin 13:40:32
Load: cpu 0 Memory: total 1997 binary 33
procs 197 processes 0 code 173
runq 135 atom 1002 ets 95 Pid Name or Initial Func Time Reds Memory MsgQ Current Function
----------------------------------------------------------------------------------------
<127.23.0> code_server 0 59585 78064 0 gen_server:loop/6
<127.21.0> file_server_2 0 36380 44276 0 gen_server:loop/6
<127.2.0> erl_prim_loader 0 27962 3740 0 erl_prim_loader:loop
<127.9.0> kernel_sup 0 6998 4676 0 gen_server:loop/6
<127.17.0> net_kernel 62 6018 3136 0 gen_server:loop/6
<127.0.0> init 0 4156 4352 0 init:loop/1
<127.16.0> auth 0 1765 1264 0 gen_server:loop/6
<127.18.0> inet_tcp_dist:accept 0 660 1416 0 prim_inet:accept0/2
<127.5.0> application_controll 0 569 6756 0 gen_server:loop/6
<127.137.0> net_kernel:do_spawn_ 0 553 5840 0 dbg:do_relay_1/1
========================================================================================

2、修改配置参数

etop:config(lines, 5)
(etop@durin)2>
========================================================================================
tiger@durin 10:12:44
Load: cpu 0 Memory: total 1859 binary 33
procs 192 processes 0 code 173
runq 2 atom 1002 ets 95 Pid Name or Initial Func Time Reds Memory MsgQ Current Function
----------------------------------------------------------------------------------------
<127.17.0> net_kernel 183 70 4092 0 gen_server:loop/6
<127.335.0> inet_tcp_dist:do_acc 141 22 1856 0 dist_util:con_loop/9
<127.19.0> net_kernel:ticker/2 155 6 1244 0 net_kernel:ticker1/2
<127.341.0> net_kernel:do_spawn_ 0 0 5840 0 dbg:do_relay_1/1
<127.43.0> ddll_server 0 0 3744 0 gen_server:loop/6
========================================================================================

erlang调试技术之etop的更多相关文章

  1. linux内核调试技术之printk

    原创博客:欢迎转载,转载请注明出处https://i.cnblogs.com/EditPosts.aspx?postid=6218383 1.简介(基于s3c2440 linux) 在内核调试技术之中 ...

  2. 反调试技术常用API,用来对付检测od和自动退出程序

    在调试一些病毒程序的时候,可能会碰到一些反调试技术,也就是说,被调试的程序可以检测到自己是否被调试器附加了,如果探知自己正在被调试,肯定是有人试图反汇编啦之类的方法破解自己.为了了解如何破解反调试技术 ...

  3. 嵌入式Linux的调试技术

    本节我们研究嵌入式Linux的调试技术,对于复杂的Linux驱动及HAL等程序库,需要使用各种方法对其进行调试.刚开始讲了打印内核调试信息:printk,这个函数的用法与printf函数类似,只不过p ...

  4. 第十章 嵌入式Linux的调试技术

    对调试工具进行简介.Linux中提供了一类工具,通过这些工具可以逐行跟踪程序的代码,用于测试用户空间程序的gdb.gdbserver和调试内核空间程序的kgdb. 用gdb调试用户空间程序:gdb可跟 ...

  5. paip&period; 调试技术打印堆栈 uapi print stack java php python 总结&period;

    paip. 调试技术打印堆栈 uapi print stack java php python 总结. 作者Attilax  艾龙,  EMAIL:1466519819@qq.com 来源:attil ...

  6. 【转】Linux Shell脚本调试技术

    本文转载自:https://www.ibm.com/developerworks/cn/linux/l-cn-shell-debug/ Shell脚本调试技术 本文全面系统地介绍了shell脚本调试技 ...

  7. shell脚本调试技术&lowbar;转

    转自:http://itlab.idcquan.com/linux/SHELL/727128.html 参考:https://linux.cn/article-8045-1.html 本文全面系统地介 ...

  8. Linux驱动设计—— 驱动调试技术

    参考博客与书籍: <Linux设备驱动开发详解> <Linux设备驱动程序> http://blog.chinaunix.net/uid-24219701-id-2884942 ...

  9. QT核心编程之调试技术 (g)

    Qt应用程序的调试可以通过DDD进行跟踪调试和打印各种调试或警告信息.DDD(Data Display Debugger)是使用gdb调试工具的图形工具,它安装在Linux操作系统中,使用方法可参考D ...

随机推荐

  1. LeedCode-Two Sum

    1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a ...

  2. 黄聪:远程序桌面登录的&period;NET(C&num;)开发

    MSTSCLib.dll和MsTscAxWrapper.dll下载:LibDll.rar 远程序桌面登录的.NET开发,可以使用MSTSCLib.dll和MsTscAxWrapper.dll两个转换过 ...

  3. boolean 和 Boolean 类型数据的差别

    工作中遇到页面传递布尔类型的数据问题,需要在代码中判断不能为null,就此思考一下,boolean和Boolean之间的区别?boolean是基本数据类型Boolean是它的封装类,和其他类一样,有属 ...

  4. Java 类装载器

    类装载器 基本概念: 顾名思义,类加载器(class loader)用来把Java 类动态的加载到 Java 虚拟机中.也就是说当程序需要某个类时,类加载器就把这个类的二进行加入到虚拟机中. 类加载器 ...

  5. sql sever 2008修改数据类型

    如果是新表,直接在表中修改: 如果不是新表,则须sql语句修改 附sql语句 alter table 表名 alter column 列名 新的数据类型

  6. 分享一个js生成二维码的库

    二维码用js生成会比用服务器生成方便很多,只要把window.location.href的值传入,即可生成对应的二维码..最主要是,这个库可以兼容ie6~ie9哦... 具体使用,请看官网:http: ...

  7. MongoDB学习笔记&lpar;二&rpar; 通过samus驱动实现基本数据操作

    传统的关系数据库一般由数据库(database).表(table).记录(record)三个层次概念组成,MongoDB是由(database).集合(collection).文档对象(documen ...

  8. 第3阶段——内核启动分析之make menuconfig内核配置&lpar;2&rpar;

    目标: 分析make menuconfig内核配置过程 在上1小结中(内核编译试验)讲到了3种不同的配置: (1)通过make menuconfig 直接从头到尾配置.config文件 (2) 通过m ...

  9. Linux 高性能服务器编程——多线程编程

    问题聚焦:     在简单地介绍线程的基本知识之后,主要讨论三个方面的内容:    1 创建线程和结束线程:    2 读取和设置线程属性:    3 线程同步方式:POSIX信号量,互斥锁和条件变量 ...

  10. 树莓派3B&plus;&lpar;三&rpar;

    上一篇中,我们配置好了基本的raspbain系统,接下来我们可以用xrdp或者vnc在Windows上远程连接树莓派. 一.安装xrdp xrdp和vnc是两种常见的远程桌面协议,可以进行可视化界面远 ...