Skip to contentSkip to conversation

libtracefs: Implement tracefs_kretprobe_raw()

PATCH New Steven Rostedt 1 participant 1 message Jun 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Implement tracefs_kretprobe_raw()

From: "Steven Rostedt (VMware)" <[email protected]>

Add an interface that is similar to tracefs_kprobe_raw() but creates a "kretprobe". The difference between a kprobe and a kretprobe is that a kretprobe comes at the end of a function.

See Documentation/trace/kprobetrace.rst in the Linux kernel source code for more information. Note, kprobes are started with "p" and kretprobe lines start with an "r".

---
 include/tracefs.h     |  2 ++
 src/tracefs-kprobes.c | 79 ++++++++++++++++++++++++++++++-------------
 2 files changed, 58 insertions(+), 23 deletions(-)
include/tracefs.h +2 -0
index d7980c7..f9ce077 100644
@@ -217,6 +217,8 @@ void tracefs_trace_pipe_stop(struct tracefs_instance *instance);
 
 int tracefs_kprobe_raw(const char *system, const char *event,
 		       const char *addr, const char *format);
+int tracefs_kretprobe_raw(const char *system, const char *event,
+			  const char *addr, const char *format);
 int tracefs_kprobe_clear(bool force);
 int tracefs_kprobe_clear_probe(const char *system, const char *event, bool force);
 #endif /* _TRACE_FS_H */
src/tracefs-kprobes.c +56 -23

92 lines not on this page · raw message

Signature · 1 line
2.31.1