diff options
author | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2021-07-06 23:11:08 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2021-07-13 17:32:07 -0400 |
commit | 629de03082c0e817a13f76ca7e4b64d4600a6fe0 (patch) | |
tree | b1dd36f6a43d79197c3484ab59e03c4fa36d0fdb /include | |
parent | e072ef9a2b053016d0487c71d8016b4b817b004b (diff) | |
download | libtracefs-629de03082c0e817a13f76ca7e4b64d4600a6fe0.tar.gz |
libtracefs: Implement functions to work on event directory files
Add the following functions:
tracefs_event_get_file() to easily put together a path to a file in the
event directory.
tracefs_event_file_read() to easily read the content from a file in the
event directory.
tracefs_event_file_write() to easily write content to a file in the
event directory.
tracefs_event_file_append() to easily append content to a file in the
event directory.
tracefs_event_file_clear() to easily clear the content of a file in the
event directory.
tracefs_event_file_exists() to easily know if a file exists in the
event directory.
Link: https://lore.kernel.org/linux-trace-devel/20210707031110.249759-3-rostedt@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/tracefs.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/tracefs.h b/include/tracefs.h index 6b9a76c..afbfd4e 100644 --- a/include/tracefs.h +++ b/include/tracefs.h @@ -102,6 +102,25 @@ int tracefs_iterate_raw_events(struct tep_handle *tep, void *callback_context); void tracefs_iterate_stop(struct tracefs_instance *instance); +char *tracefs_event_get_file(struct tracefs_instance *instance, + const char *system, const char *event, + const char *file); +char *tracefs_event_file_read(struct tracefs_instance *instance, + const char *system, const char *event, + const char *file, int *psize); +int tracefs_event_file_write(struct tracefs_instance *instance, + const char *system, const char *event, + const char *file, const char *str); +int tracefs_event_file_append(struct tracefs_instance *instance, + const char *system, const char *event, + const char *file, const char *str); +int tracefs_event_file_clear(struct tracefs_instance *instance, + const char *system, const char *event, + const char *file); +bool tracefs_event_file_exists(struct tracefs_instance *instance, + const char *system, const char *event, + const char *file); + char **tracefs_tracers(const char *tracing_dir); struct tep_handle *tracefs_local_events(const char *tracing_dir); |