aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2021-06-29 16:55:08 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-07-02 10:09:45 -0400
commit69d12fa79f72a497c18ed115171aef99734a7a79 (patch)
treebabe4dad8b1c1e209d9d64c740dbed97c036ba3a /include
parente455276c36818c74e23fa19a570946139e4df0c9 (diff)
downloadlibtracefs-69d12fa79f72a497c18ed115171aef99734a7a79.tar.gz
libtracefs: Implement tracefs_error_last/all()
Add a helper function that will read an instance error_log file, and either return the entire content of the error log (tracefs_error_all()) or just the last error (tracefs_error_last()). Also add tracefs_error_clear() to clear the error log. Link: https://lore.kernel.org/linux-trace-devel/20210629165508.166371da@oasis.local.home Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r--include/tracefs.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/tracefs.h b/include/tracefs.h
index 0484742..da8ad41 100644
--- a/include/tracefs.h
+++ b/include/tracefs.h
@@ -58,6 +58,10 @@ int tracefs_trace_off_fd(int fd);
int tracefs_event_enable(struct tracefs_instance *instance, const char *system, const char *event);
int tracefs_event_disable(struct tracefs_instance *instance, const char *system, const char *event);
+char *tracefs_error_last(struct tracefs_instance *instance);
+char *tracefs_error_all(struct tracefs_instance *instance);
+int tracefs_error_clear(struct tracefs_instance *instance);
+
/**
* tracefs_trace_on_get_fd - Get a file descriptor of "tracing_on" in given instance
* @instance: ftrace instance, can be NULL for the top instance