Skip to contentSkip to conversation

libtracefs: Change tracefs_tracers()to accept NULL pointer

PATCH New Tzvetomir Stoyanov (VMware) 1 participant 1 message Dec 17, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libtracefs: Change tracefs_tracers()to accept NULL pointer

From: Tzvetomir (VMware) Stoyanov <[email protected]>

In order to be consistent with the other libtracefs APIs, the
char **tracefs_tracers(const char *tracing_dir);
function is changed to accept NULL pointer as valid input argument. If NULL is passed, the tracers of the top instance are returned.

---
 src/tracefs-events.c | 3 +++
 1 file changed, 3 insertions(+)
src/tracefs-events.c +3 -0
index 8cdec8e..58fa153 100644
@@ -406,6 +406,9 @@ char **tracefs_tracers(const char *tracing_dir)
 	int len;
 	int ret;
 
+	if (!tracing_dir)
+		tracing_dir = tracefs_get_tracing_dir();
+
 	if (!tracing_dir)
 		return NULL;
 
Signature · 1 line
2.28.0