2017-04-26 14:57:08

by Taeung Song

[permalink] [raw]
Subject: [PATCH] parse-events: Fix the FALSE case in pevent_filter_clear_trivial()

Currently the FILTER_TRIVIAL_FALSE hasn't break statement
so if the trivial type is FALSE, it'll be hit always.

So add break statement at the FALSE case
to correctly remove trivial filters.

Reported-by: Namhyung Kim <[email protected]>
Signed-off-by: Taeung Song <[email protected]>
---
parse-filter.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/parse-filter.c b/parse-filter.c
index 7c214ce..c2fd26f 100644
--- a/parse-filter.c
+++ b/parse-filter.c
@@ -1634,6 +1634,7 @@ int pevent_filter_clear_trivial(struct event_filter *filter,
case FILTER_TRIVIAL_FALSE:
if (filter_type->filter->boolean.value)
continue;
+ break;
case FILTER_TRIVIAL_TRUE:
if (!filter_type->filter->boolean.value)
continue;
--
2.7.4


Subject: [tip:perf/core] tools lib traceevent: Fix missing break in FALSE case of pevent_filter_clear_trivial()

Commit-ID: 806efaed3cacab1521895d20bb3b5ed610909299
Gitweb: https://git.kernel.org/tip/806efaed3cacab1521895d20bb3b5ed610909299
Author: Taeung Song <[email protected]>
AuthorDate: Thu, 11 Jan 2018 19:47:50 -0500
Committer: Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 17 Jan 2018 10:22:57 -0300

tools lib traceevent: Fix missing break in FALSE case of pevent_filter_clear_trivial()

Currently the FILTER_TRIVIAL_FALSE case has a missing break statement,
if the trivial type is FALSE, it will also run into the TRUE case, and
always be skipped as the TRUE statement will continue the loop on the
inverse condition of the FALSE statement.

Reported-by: Namhyung Kim <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Signed-off-by: Taeung Song <[email protected]>
Cc: Andrew Morton <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Steven Rostedt <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
---
tools/lib/traceevent/parse-filter.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index 2410afd..2b9048f 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -1631,6 +1631,7 @@ int pevent_filter_clear_trivial(struct event_filter *filter,
case FILTER_TRIVIAL_FALSE:
if (filter_type->filter->boolean.value)
continue;
+ break;
case FILTER_TRIVIAL_TRUE:
if (!filter_type->filter->boolean.value)
continue;