Reference
show profiling
Dump profiling details.
Description Jump to heading
Up to version 2.3r1
, the operation dumps profiling settings, one per line, as well as the command needed to change them.
For versions 2.4r1
to 2.6r1
:
Specify the category of data desired: status
, tasks
, memory
, or all
.
To sort by address instead of usage, specify the byaddr
argument.
By default, all profiling information is dumped. To limit the number of lines of output for each category, append a maximum line limit.
As of version 2.7r1
:
Specify the category of data desired: status
, tasks
, memory
, or all
.
By default, output is sorted by usage. As an alternative, you can specify the byaddr
or bytime
argument to sort by address or by total execution time, respectively.
Specify the aggr
argument to aggregate task activity by called function instead of displaying all details.
By default, all profiling information is dumped. To limit the number of lines of output for each category, append a maximum line limit. Profiling is essentially intended for product developers as it exposes CPU and memory consumption in the code.
Examples Jump to heading
For versions 2.3r1
and earlier:
nix
echo "show profiling" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show profiling" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtext
Per-task CPU profiling : on # set profiling tasks {on|auto|off}Memory usage profiling : off # set profiling memory {on|off}
outputtext
Per-task CPU profiling : on # set profiling tasks {on|auto|off}Memory usage profiling : off # set profiling memory {on|off}
For versions 2.4r1
and later:
Show profiling settings, one per line, as well as the command needed to change them.
nix
echo "show profiling status" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show profiling status" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtext
Per-task CPU profiling : on # set profiling tasks {on|auto|off}Memory usage profiling : off # set profiling memory {on|off}
outputtext
Per-task CPU profiling : on # set profiling tasks {on|auto|off}Memory usage profiling : off # set profiling memory {on|off}
Report details for the top three tasks, sorted by time:
nix
echo "show profiling tasks bytime 3" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
nix
echo "show profiling tasks bytime 3" | \sudo socat stdio tcp4-connect:127.0.0.1:9999
outputtext
Tasks activity:function calls cpu_tot cpu_avg lat_tot lat_avgprocess_chk 358 17.97ms 50.20us 15.71ms 43.89us <- wake_expired_tasks@src/task.c:350 task_wakeupprocess_chk 360 3.684ms 10.23us 3.584ms 9.955us <- wake_srv_chk@src/check.c:1048 task_wakeuptask_run_applet 5 1.421ms 284.2us 14.85us 2.970us <- sc_applet_create@src/stconn.c:491 appctx_wakeup
outputtext
Tasks activity:function calls cpu_tot cpu_avg lat_tot lat_avgprocess_chk 358 17.97ms 50.20us 15.71ms 43.89us <- wake_expired_tasks@src/task.c:350 task_wakeupprocess_chk 360 3.684ms 10.23us 3.584ms 9.955us <- wake_srv_chk@src/check.c:1048 task_wakeuptask_run_applet 5 1.421ms 284.2us 14.85us 2.970us <- sc_applet_create@src/stconn.c:491 appctx_wakeup
See also Jump to heading
Do you have any suggestions on how we can improve the content of this page?