简介
uprobe 事件tracer工具是在内核3.5开发期间何入内核主线版本的,虽然uprobe已经存在很久了。uprobe是和kprobe类似的调试方法。编译内核时通过打开CONFIG_UPROBE_EVENT=y来时能该特性。和kprobe类似,使用时不需要通过current_tracer来激活,而是检测点通过/sys/kernel/debug/tracing/uprobe_events设置,通过/sys/kernel/debug/tracing/events/uprobes/<EVENT>/enabled来使能。
然而,和kprobe不同的是,使用时需要用户自己计算探测点在用户态文件中的偏移,可以通过nm等工具,这还是有点麻烦的。
命令格式
p[:[GRP/]EVENT] PATH:SYMBOL[+offs] [FETCHARGS] : Set a probeGRP : Group name. If omitted, use "uprobes" for it.
EVENT : Event name. If omitted, the event name is generated
based on SYMBOL+offs.
PATH : path to an executable or a library.
SYMBOL[+offs] : Symbol+offset where the probe is inserted.
FETCHARGS : Arguments. Each probe can have up to 128 args.
%REG : Fetch register REG
查看事件监控文件
可以通过/s