linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libtracefs: Fix event_enable_disable() return value
@ 2021-05-28 11:37 Yordan Karadzhov (VMware)
  0 siblings, 0 replies; only message in thread
From: Yordan Karadzhov (VMware) @ 2021-05-28 11:37 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

event_enable_disable() is a static method used internally by the
tracefs_event_enable/disable() API. The returned value do not obey
the description given in the documentation for some specific use-cases.

Fixes: fc94d1a (libtracefs: Add tracefs_event_enable/disable() API)
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 src/tracefs-events.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/tracefs-events.c b/src/tracefs-events.c
index 55316c6..9adfd25 100644
--- a/src/tracefs-events.c
+++ b/src/tracefs-events.c
@@ -833,12 +833,12 @@ static int event_enable_disable(struct tracefs_instance *instance,
 	regex_t system_re, event_re;
 	char **systems;
 	char **events = NULL;
-	int ret = -1;
+	int ret;
 	int s, e;
 
 	/* Handle all events first */
 	if (!system && !event)
-		return enable_disable_all(instance, enable);
+		return enable_disable_all(instance, enable) < 0 ? -1 : 0;
 
 	systems = tracefs_event_systems(NULL);
 	if (!systems)
@@ -858,6 +858,7 @@ static int event_enable_disable(struct tracefs_instance *instance,
 		}
 	}
 
+	ret = -1;
 	for (s = 0; systems[s]; s++) {
 		if (system && !match(systems[s], &system_re))
 			continue;
-- 
2.27.0


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

only message in thread, other threads:[~2021-05-28 11:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 11:37 [PATCH] libtracefs: Fix event_enable_disable() return value Yordan Karadzhov (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).