diff mbox series

libtracefs: Change tracefs_tracers()to accept NULL pointer

Message ID 20201217094601.1401930-1-tz.stoyanov@gmail.com (mailing list archive)
State Accepted
Commit 81e5eac1df8f479377be9000f2949109410bfc61
Headers show
Series libtracefs: Change tracefs_tracers()to accept NULL pointer | expand

Commit Message

Tzvetomir Stoyanov (VMware) Dec. 17, 2020, 9:46 a.m. UTC
From: Tzvetomir (VMware)  Stoyanov <tz.stoyanov@gmail.com>

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.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
 src/tracefs-events.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/src/tracefs-events.c b/src/tracefs-events.c
index 8cdec8e..58fa153 100644
--- a/src/tracefs-events.c
+++ b/src/tracefs-events.c
@@ -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;