From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: rostedt@goodmis.org
Cc: linux-trace-devel@vger.kernel.org,
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 2/4] libtracefs: Fix event_enable_disable() return value
Date: Tue, 8 Jun 2021 16:55:01 +0300 [thread overview]
Message-ID: <20210608135503.12135-2-y.karadz@gmail.com> (raw)
In-Reply-To: <20210608135503.12135-1-y.karadz@gmail.com>
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. Note that "ret" must
be set to -1 right before the beginning of the loop.
Fixes: fc94d1a (libtracefs: Add tracefs_event_enable/disable() API)
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
src/tracefs-events.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/tracefs-events.c b/src/tracefs-events.c
index 8b2d9ef..0fef64f 100644
--- a/src/tracefs-events.c
+++ b/src/tracefs-events.c
@@ -835,7 +835,7 @@ 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 */
@@ -860,6 +860,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
next prev parent reply other threads:[~2021-06-08 13:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-08 13:55 [PATCH 1/4] libtracefs: Fix enable_disable_all() return value Yordan Karadzhov (VMware)
2021-06-08 13:55 ` Yordan Karadzhov (VMware) [this message]
2021-06-08 13:55 ` [PATCH 3/4] libtracefs: Fix typo in function name Yordan Karadzhov (VMware)
2021-06-08 13:55 ` [PATCH 4/4] libtracefs: Propagate the return value of the callback function Yordan Karadzhov (VMware)
2021-06-09 17:00 ` Steven Rostedt
2021-06-11 11:03 ` Yordan Karadzhov (VMware)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210608135503.12135-2-y.karadz@gmail.com \
--to=y.karadz@gmail.com \
--cc=linux-trace-devel@vger.kernel.org \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).