linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libtracefs: Change tracefs_tracers()to accept NULL pointer
@ 2020-12-17  9:46 Tzvetomir Stoyanov (VMware)
  0 siblings, 0 replies; only message in thread
From: Tzvetomir Stoyanov (VMware) @ 2020-12-17  9:46 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel

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 --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;
 
-- 
2.28.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-17  9:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17  9:46 [PATCH] libtracefs: Change tracefs_tracers()to accept NULL pointer Tzvetomir Stoyanov (VMware)

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).