QuickWords 35: Perf probe usage

查看用户空间binary/.so文件可用函数

perf probe -F -x /usr/lib64/libopenvswitch-2.so.7.0.0

查看可以被probe的源码行

perf probe -x /usr/lib64/libopenvswitch-2.so.7.0.0 -L conntrack_execute

查看源码行处可被probe的本地变量

perf probe -x /usr/lib64/libopenvswitch-2.so.7.0.0 -V conntrack_execute:xx

添加probe event:

1
2
3
4
5
6
perf probe -x /usr/lib64/libopenvswitch-2.so.7.0.0 conntrack_execute

Added new event:
probe_libopenvswitch:conntrack_execute (on conntrack_execute in /usr/lib64/libopenvswitch-2.so.7.0.0)
You can now use it in all perf tools, such as:
perf record -e probe_libopenvswitch:conntrack_execute -aR sleep 1

若添加本地变量trace:

perf probe -x /usr/lib64/libopenvswitch-2.so.7.0.0 'conntrack_execute dl_type'

查看现有probe event:

1
2
3
perf probe --list

probe_libopenvswitch:conntrack_execute (on conntrack_execute@lib/conntrack.c in /usr/lib64/libopenvswitch-2.so.7.0.0)

1
2
perf list | grep probe
probe_libopenvswitch:conntrack_execute [Tracepoint event]

记录perf record

perf record -e probe_libopenvswitch:conntrack_execute -aR -g sleep 10

查看记录

perf script

记录函数第一个参数

perf probe -x /usr/lib64/libopenvswitch-2.so.7.0.0 -a 'another=conntrack_execute %ax'

© 2020 DecodeZ All Rights Reserved. 本站访客数人次 本站总访问量
Theme by hiero