aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorSteven Rostedt <[email protected]>2015-03-24 18:58:13 +0000
committerArnaldo Carvalho de Melo <[email protected]>2015-03-26 13:52:29 +0000
commit7c27f78a297b54c3c2f5075cb15d33431b7f6333 (patch)
tree20f626ea02fb0590a0946243008f069993bc72d2 /tools/perf/util/annotate.c
parentperf trace: Fix syscall enter formatting bug (diff)
downloadkernel-7c27f78a297b54c3c2f5075cb15d33431b7f6333.tar.gz
kernel-7c27f78a297b54c3c2f5075cb15d33431b7f6333.zip
tools lib traceevent: Zero should not be considered "not found" in eval_flag()
Guilherme Cox found that: There is, however, a potential bug if there is an item with code zero that is not the first one in the symbol list, since eval_flag(..) returns 0 when it doesn't find anything. That is, if you have the following enums: enum { FOO_START = 0, FOO_GO = 1, FOO_END = 2 } and then have: __print_symbolic(foo, FOO_GO, "go", FOO_START, "start", FOO_END, "end") If none of the enums are known to pevent, then eval_flag() will return zero, and it will match it to the first item in the list, which would be FOO_GO, which is not zero. Luckily, in most cases, the first element would be zero, and the parsing would match out of sheer luck. Reported-by: Guilherme Cox <[email protected]> Signed-off-by: Steven Rostedt <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate.c')
0 files changed, 0 insertions, 0 deletions