diff mbox series

[07/11] libtracefs/Documentation: Fix example in libtracefs-error.txt

Message ID 20211122234956.788401-8-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit f73c40d83df5800e374356885ed80072649b81d7
Headers show
Series libtracefs: Have all man page examples be executable | expand

Commit Message

Steven Rostedt Nov. 22, 2021, 11:49 p.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The example code in libtracefs-error.txt man page referenced the old
tracefs_kprobe_clear_probe() API that no longer exists. Update it to use
the new tracefs_dynevent_get() and the tracefs_dynevent_destroy() API to
do the same thing.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Documentation/libtracefs-error.txt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/Documentation/libtracefs-error.txt b/Documentation/libtracefs-error.txt
index 33af074..8dd5b42 100644
--- a/Documentation/libtracefs-error.txt
+++ b/Documentation/libtracefs-error.txt
@@ -52,6 +52,7 @@  EXAMPLE
 
 int main (int argc, char **argv, char **env)
 {
+	struct tracefs_dynevent *kevent;
 	char *system = NULL;
 	char *kprobe;
 	char *format;
@@ -72,7 +73,11 @@  int main (int argc, char **argv, char **env)
 	format = argv[arg++];
 
 	tracefs_error_clear(NULL);
-	tracefs_kprobe_clear_probe(system, kprobe, true);
+	kevent = tracefs_dynevent_get(TRACEFS_DYNEVENT_KPROBE, system, kprobe);
+	if (kevent) {
+		tracefs_dynevent_destroy(kevent, true);
+		tracefs_dynevent_free(kevent);
+	}
 
 	ret = tracefs_kprobe_raw(system, kprobe, addr, format);
 	if (ret < 0) {