All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] libtracefs: Fix tracefs_instance_reset() of triggers
Date: Thu, 11 Jan 2024 17:38:09 -0500	[thread overview]
Message-ID: <20240111173809.7d5462e8@gandalf.local.home> (raw)

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

The clearing of triggers may require a few loops as the order of the
clearing is important. Some triggers rely on other triggers to be cleared
before they can be cleared.

The tracefs_instance_reset() will loop over all the triggers, clearing them
one at a time, and restart from the top again if not all the triggers were
cleared. This guarantees that the triggers will have other triggers cleared
first if they depend on them to be cleared.

The "file" string used to clear the trigger wasn't updated to equal the next
file in the list, so it was stale.

Fixes: 93e20af8 ("libtracefs: Fix tracefs_instance_reset to clear synthetic events")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 src/tracefs-instance.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/tracefs-instance.c b/src/tracefs-instance.c
index 0ee0225..9a26708 100644
--- a/src/tracefs-instance.c
+++ b/src/tracefs-instance.c
@@ -1539,6 +1539,7 @@ void tracefs_instance_reset(struct tracefs_instance *instance)
 		list_size = tracefs_list_size(file_list);
 		file_list = NULL;
 		for (i = 0; list[i]; i++) {
+			file = list[i];
 			ret = clear_trigger(file);
 			if (ret) {
 				char **tlist;
-- 
2.42.0


                 reply	other threads:[~2024-01-11 22:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240111173809.7d5462e8@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.