summaryrefslogtreecommitdiff
path: root/tools/perf/examples/bpf/5sec.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/examples/bpf/5sec.c')
-rw-r--r--tools/perf/examples/bpf/5sec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/examples/bpf/5sec.c b/tools/perf/examples/bpf/5sec.c
index 6fc3697ac749..b9c203219691 100644
--- a/tools/perf/examples/bpf/5sec.c
+++ b/tools/perf/examples/bpf/5sec.c
@@ -15,6 +15,13 @@
. While this is running, run something like "sleep 5s".
+ . If we decide to add tv_nsec as well, then it becomes:
+
+ int probe(hrtimer_nanosleep, rqtp->tv_sec rqtp->tv_nsec)(void *ctx, int err, long sec, long nsec)
+
+ I.e. add where it comes from (rqtp->tv_nsec) and where it will be
+ accessible in the function body (nsec)
+
# perf trace --no-syscalls -e tools/perf/examples/bpf/5sec.c/call-graph=dwarf/
0.000 perf_bpf_probe:func:(ffffffff9811b5f0) tv_sec=5
hrtimer_nanosleep ([kernel.kallsyms])
@@ -34,8 +41,7 @@
#include <bpf.h>
-SEC("func=hrtimer_nanosleep rqtp->tv_sec")
-int func(void *ctx, int err, long sec)
+int probe(hrtimer_nanosleep, rqtp->tv_sec)(void *ctx, int err, long sec)
{
return sec == 5;
}