* [PATCH] libtracefs: Have tracefs_instance_tracers() return instance tracers
@ 2024-08-20 21:36 Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2024-08-20 21:36 UTC (permalink / raw)
To: Linux Trace Devel
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
The tracefs_instance_tracers() was always returning the top level tracers
and not the tracers that were available for the given instance.
Fixes: 185019c0 ("libtracefs: Add tracefs_instance_tracers() API")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
src/tracefs-events.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/tracefs-events.c b/src/tracefs-events.c
index 83069aa..77d1ba8 100644
--- a/src/tracefs-events.c
+++ b/src/tracefs-events.c
@@ -1012,12 +1012,20 @@ char **tracefs_tracers(const char *tracing_dir)
*/
char **tracefs_instance_tracers(struct tracefs_instance *instance)
{
- const char *tracing_dir = NULL;
+ char *tracing_dir = NULL;
+ char **list;
+ int ret;
- if (instance)
- tracing_dir = instance->trace_dir;
+ if (instance) {
+ ret = asprintf(&tracing_dir, "%s/instances/%s", instance->trace_dir,
+ instance->name);
+ if (ret < 0)
+ return NULL;
+ }
- return list_tracers(tracing_dir);
+ list = list_tracers(tracing_dir);
+ free(tracing_dir);
+ return list;
}
static int load_events(struct tep_handle *tep,
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-08-20 21:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-20 21:36 [PATCH] libtracefs: Have tracefs_instance_tracers() return instance tracers Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).