aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2024-01-11 17:38:09 -0500
committerSteven Rostedt (Google) <rostedt@goodmis.org>2024-01-11 19:05:48 -0500
commit73ac9c192d058712993f9941927c924f2e206168 (patch)
tree12ef7aeffe9123048d49ea66db0778fb1c30f950
parent7d15d7744d957b1721d8e202bd5095b7c449570f (diff)
downloadlibtracefs-73ac9c192d058712993f9941927c924f2e206168.tar.gz
libtracefs: Fix tracefs_instance_reset() of triggers
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. Link: https://lore.kernel.org/linux-trace-devel/20240111173809.7d5462e8@gandalf.local.home Fixes: 93e20af8 ("libtracefs: Fix tracefs_instance_reset to clear synthetic events") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--src/tracefs-instance.c1
1 files changed, 1 insertions, 0 deletions
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;