diff mbox series

[05/10] tools lib traceevent: Remove call to exit() from tep_filter_add_filter_str()

Message ID 20190405140332.10949-6-tstoyanov@vmware.com (mailing list archive)
State Superseded
Headers show
Series Backport of traceevent APIs cleanup changes from kernel tree to trace-cmd | expand

Commit Message

Tzvetomir Stoyanov April 5, 2019, 2:03 p.m. UTC
This patch removes call to exit() from tep_filter_add_filter_str(). A
library function should not force the application to exit. In the
current implementation tep_filter_add_filter_str() calls exit() when a
special "test_filters" mode is set, used only for debugging purposes.
When this mode is set and a filter is added - its string is printed to
the console and exit() is called. This patch changes the logic - when in
"test_filters" mode, the filter string is still printed, but the exit()
is not called. It is up to the application to track when "test_filters"
mode is set and to call exit, if needed.

Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flkml.kernel.org%2Fr%2F20190326154328.28718-9-tstoyanov%40vmware.com&amp;data=02%7C01%7Ctstoyanov%40vmware.com%7Ca85c00102f8946a5a65008d6b78541b2%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636898180295236164&amp;sdata=2bP6ffKd0dTVskeHiJBvhMkgGNaqyskxRGuShZiD3ME%3D&amp;reserved=0
Link: https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flkml.kernel.org%2Fr%2F20190401164344.121717482%40goodmis.org&amp;data=02%7C01%7Ctstoyanov%40vmware.com%7Ca85c00102f8946a5a65008d6b78541b2%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C0%7C0%7C636898180295236164&amp;sdata=lq%2BDgVReaUgoo0NqCLPCxvNoBI6CVK1Gzb3gP7fGiBs%3D&amp;reserved=0
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 lib/traceevent/parse-filter.c | 3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/traceevent/parse-filter.c b/lib/traceevent/parse-filter.c
index 4ffd8b2..3320c0a 100644
--- a/lib/traceevent/parse-filter.c
+++ b/lib/traceevent/parse-filter.c
@@ -1346,9 +1346,6 @@  enum tep_errno tep_filter_add_filter_str(struct tep_event_filter *filter,
 
 	free_events(events);
 
-	if (rtn >= 0 && pevent->test_filters)
-		exit(0);
-
 	return rtn;
 }