From ffffc75f409704595c9fd11615d2912a9952693c Mon Sep 17 00:00:00 2001 From: John Ogness Date: Thu, 21 Jun 2018 16:08:23 +0206 Subject: schulung_tools: ipc_shm: use perf for uprobes Rather than manually determining and setting the uprobes, use perf to do it. This allows for the README to become a generic script that can run out-of-the-box to create the trace. Signed-off-by: John Ogness --- schulung_tools/ipc_shm/README | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/schulung_tools/ipc_shm/README b/schulung_tools/ipc_shm/README index bea6c98..7187c94 100644 --- a/schulung_tools/ipc_shm/README +++ b/schulung_tools/ipc_shm/README @@ -3,13 +3,9 @@ # build programs send/recv make -# find uprobe offsets (search for "uprobe") -objdump -D -F -S send | less -objdump -D -F -S recv | less - -# create uprobe events (as root) -echo "p:sending `pwd`/send:0x1055" > /sys/kernel/debug/tracing/uprobe_events -echo "p:received `pwd`/recv:0xff1" >> /sys/kernel/debug/tracing/uprobe_events +# create uprobe events +sudo perf probe -x ./send sending=send.c:35 +sudo perf probe -x ./recv received=recv.c:43 # run receiver sudo taskset 1 chrt -f 80 ./recv & @@ -19,12 +15,12 @@ sudo trace-cmd record \ -e sched:sched_switch \ -e sched:sched_wakeup \ -e sched:sched_pi_setprio \ - -e uprobes:sending \ - -e uprobes:received \ + -e probe_send:sending \ + -e probe_recv:received \ -e raw_syscalls:sys_enter \ -e raw_syscalls:sys_exit \ taskset 1 chrt -f 70 ./send -(type message and hit return) +# type message and hit return # view results kernelshark -- cgit v1.2.3