|
|
@ -212,14 +212,14 @@ end. |
|
|
|
当出于分析目的而跟踪文件时,您很可能不关心某些事件,例如链接的进程。要禁用任何不必要的事件分析,请传递mode选项: |
|
|
|
|
|
|
|
``` |
|
|
|
1> lg:trace('_', lg_file_tracer, "traces.lz4", #{mode => profile}). |
|
|
|
1> lg:trace('_', lg_file_tracer, "traces.lz4", #{mode => utils}). |
|
|
|
``` |
|
|
|
|
|
|
|
[[tracing_running]] |
|
|
|
您还可以通过启用选项来获得仅对配置文件有用的额外事件。 该running选项将启用事件,这些事件指示何时安排进出流程。 启用它通常会很有用,因为它可以启用其他统计信息,但会占用大量资源,因此默认情况下未启用: |
|
|
|
|
|
|
|
``` |
|
|
|
1> lg:trace('_', lg_file_tracer, "traces.lz4", #{mode => profile, running => true}). |
|
|
|
1> lg:trace('_', lg_file_tracer, "traces.lz4", #{mode => utils, running => true}). |
|
|
|
``` |
|
|
|
|
|
|
|
[[tracing_send]] |
|
|
@ -241,7 +241,7 @@ events_per_frame。这两个选项使您可以控制文件写入或旋转的频 |
|
|
|
以下示例将文件大小限制为100MB: |
|
|
|
|
|
|
|
``` |
|
|
|
1> eTpf:trace('_', lg_file_tracer, #{filename_prefix => "traces.lz4", max_size => 100000000}, #{mode => profile, running =>true}). |
|
|
|
1> eTpf:trace('_', lg_file_tracer, #{filename_prefix => "traces.lz4", max_size => 100000000}, #{mode => utils, running =>true}). |
|
|
|
``` |
|
|
|
|
|
|
|
在测试此功能期间,目前实施的轮换似乎很昂贵,因此您应注意不要设置太低的值。 |
|
|
@ -267,16 +267,16 @@ $ qcachegrind callgrind.out |
|
|
|
|
|
|
|
它将自动检测并打开所有与该callgrind.out.*模式匹配的文件。 |
|
|
|
|
|
|
|
Profiling one file 您可以通过调用函数来分析一个文件 `tpCallgrind:profile/2,3`。它包含跟踪文件名,输出文件名和一个可选的选项映射: |
|
|
|
Profiling one file 您可以通过调用函数来分析一个文件 `tpCallgrind:utils/2,3`。它包含跟踪文件名,输出文件名和一个可选的选项映射: |
|
|
|
|
|
|
|
``` |
|
|
|
1> tpCallgrind:profile("traces.lz4.1", "callgrind.out.1"). |
|
|
|
1> tpCallgrind:utils("traces.lz4.1", "callgrind.out.1"). |
|
|
|
``` |
|
|
|
|
|
|
|
它还接受以下选项: |
|
|
|
|
|
|
|
``` |
|
|
|
1> tpCallgrind:profile("traces.lz4.1", "callgrind.out.1", #{running => true}). |
|
|
|
1> tpCallgrind:utils("traces.lz4.1", "callgrind.out.1", #{running => true}). |
|
|
|
``` |
|
|
|
|
|
|
|
Profiling many files 便利功能可用于一次分析许多文件:`tpCallgrind:profile_many/2,3`, 它以通配符模式作为第一个参数,并以文件名前缀作为第二个参数: |
|
|
@ -351,7 +351,7 @@ eTpf只负责提供输出,然后可以使用常规工具(不附带)将其 |
|
|
|
要分析一个文件: |
|
|
|
|
|
|
|
``` |
|
|
|
1> lg_flame:profile("traces.lz4.1", "output"). |
|
|
|
1> lg_flame:utils("traces.lz4.1", "output"). |
|
|
|
``` |
|
|
|
|
|
|
|
这将创建一个名为'output'的中间文件。 |
|
|
@ -377,9 +377,9 @@ eTpf也可以根据它们发送的消息来分析Erlang进程。它可以帮助 |
|
|
|
|
|
|
|
然后,一个跟踪会话的输出可用于callgrind和消息概要分析。 |
|
|
|
|
|
|
|
分析一个文件 您可以通过调用函数来分析一个文件 lg_messages:profile/1。它使用跟踪文件名并打印出分析结果。 |
|
|
|
分析一个文件 您可以通过调用函数来分析一个文件 lg_messages:utils/1。它使用跟踪文件名并打印出分析结果。 |
|
|
|
|
|
|
|
1> lg_messages:profile("traces.lz4.1"). |
|
|
|
1> lg_messages:utils("traces.lz4.1"). |
|
|
|
|
|
|
|
它还将创建一个GraphViz文件,当前将其硬编码为“ digraph.gv”,并打印使用说明。 |
|
|
|
|
|
|
@ -468,7 +468,7 @@ edge [arrowhead=none, labelfontsize=12.0, minlen=3]; |
|
|
|
要查看一个文件: |
|
|
|
|
|
|
|
``` |
|
|
|
1> lg_messages_seqdiag:profile("traces.lz4.1", |
|
|
|
1> lg_messages_seqdiag:utils("traces.lz4.1", |
|
|
|
["<7788.381.0>", "<7788.382.0>", "<7774.383.0>", |
|
|
|
"<7774.384.0>", "<7774.386.0>"]). |
|
|
|
``` |
|
|
@ -509,9 +509,9 @@ Glass将不可避免地将此消息记录在跟踪文件中,识别出目标为 |
|
|
|
|
|
|
|
当然,该过程仅在Looking Glass运行时可用,这意味着我们不能直接发送消息。以下作品: |
|
|
|
|
|
|
|
is_pid(whereis(lg)) andalso (lg ! Info). 当然,这可以做成一个宏: |
|
|
|
is_pid(whereis('$eTpfHole')) andalso ('$eTpfHole' ! Info). 当然,这可以做成一个宏: |
|
|
|
|
|
|
|
%%启用消息跟踪时,将元数据存储在跟踪文件中。 -define(LG_INFO(Info), is_pid(whereis(lg)) andalso (lg ! Info)). 然后可以这样使用: |
|
|
|
%%启用消息跟踪时,将元数据存储在跟踪文件中。 -define(LG_INFO(Info), is_pid(whereis('$eTpfHole')) andalso ('$eTpfHole' ! Info)). 然后可以这样使用: |
|
|
|
|
|
|
|
?LG_INFO(#{process_type => reader}). 该消息必须始终是地图。否则,将无法读取跟踪文件。process_type在对消息交换进行概要分析时,Looking Glass仅识别该字段, |
|
|
|
并将其用作标签来标识进程。您可以自由定义地图中需要的任何其他值。 |
|
|
|