kernel_optimize_test/tools/perf/util
Arnaldo Carvalho de Melo fbee632d0c perf probe: Fix error propagation leading to segfault
There are two hunks in this patch that stops probe processing as soon as one
error is found, breaking out of loops, the other fix an error propagation that
should return a negative error number but instead was returning the result of
"ret < 0", which is 1 and thus made several error checks fail because they test
agains < 0.

The problem could be triggered by asking for a variable that was optimized out,
fact that should stop the whole probe processing but instead was segfaulting
while installing broken probes:

[root@emilia ~]# probe perf_mmap:55 user_lock_limit
Failed to find the location of user_lock_limit at this address.
 Perhaps, it has been optimized out.
Failed to find 'user_lock_limit' in this function.
Add new events:
  probe:perf_mmap      (on perf_mmap:55 with user_lock_limit)
  probe:perf_mmap_1    (on perf_mmap:55 with user_lock_limit)
Segmentation fault (core dumped)
[root@emilia ~]# perf probe -l
  probe:perf_mmap      (on perf_mmap:55@git/linux/kernel/perf_event.c with user_lock_limit)
  probe:perf_mmap_1    (on perf_mmap:55@git/linux/kernel/perf_event.c with user_lock_limit)
[root@emilia ~]#

After the fix:

[root@emilia ~]# probe perf_mmap:55 user_lock_limit
Failed to find the location of user_lock_limit at this address.
 Perhaps, it has been optimized out.
Failed to find 'user_lock_limit' in this function.
  Error: Failed to add events. (-2)
[root@emilia ~]#

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2011-02-21 22:21:27 -03:00
..
include perf evsel: Introduce perf_evlist 2011-01-22 19:56:28 -02:00
scripting-engines perf tool: Fix gcc 4.6.0 issues 2011-02-07 12:41:41 -02:00
ui perf annotate browser: Use the percent color for the whole line 2011-02-16 14:47:55 -02:00
abspath.c
alias.c
annotate.c perf annotate: Check if offset is less than symbol size 2011-02-16 14:47:55 -02:00
annotate.h perf annotate: Fix annotate context lines regression 2011-02-08 15:29:25 -02:00
bitmap.c
build-id.c perf tools: Kill event_t typedef, use 'union perf_event' instead 2011-01-29 16:25:37 -02:00
build-id.h
cache.h perf tools: Don't fallback to setup_pager unconditionally 2011-01-31 18:08:39 -02:00
callchain.c perf tools: Kill event_t typedef, use 'union perf_event' instead 2011-01-29 16:25:37 -02:00
callchain.h perf tools: Kill event_t typedef, use 'union perf_event' instead 2011-01-29 16:25:37 -02:00
cgroup.c perf tool: Add cgroup support 2011-02-16 13:30:48 +01:00
cgroup.h perf tool: Add cgroup support 2011-02-16 13:30:48 +01:00
color.c
color.h
config.c
cpumap.c perf tools: Add missing cpu_map__delete() 2011-01-22 19:56:30 -02:00
cpumap.h perf tools: Add missing cpu_map__delete() 2011-01-22 19:56:30 -02:00
ctype.c
debug.c perf tools: Kill event_t typedef, use 'union perf_event' instead 2011-01-29 16:25:37 -02:00
debug.h perf tools: Kill event_t typedef, use 'union perf_event' instead 2011-01-29 16:25:37 -02:00
debugfs.c
debugfs.h
environment.c
event.c Merge remote branch 'acme/perf/urgent' into perf/core 2011-02-11 11:45:54 -02:00
event.h Merge remote branch 'acme/perf/urgent' into perf/core 2011-02-11 11:45:54 -02:00
evlist.c perf evlist: Store pointer to the cpu and thread maps 2011-01-31 12:40:52 -02:00
evlist.h perf evlist: Store pointer to the cpu and thread maps 2011-01-31 12:40:52 -02:00
evsel.c perf: make perf stat print user provided full event names 2011-02-17 10:29:19 -02:00
evsel.h perf: make perf stat print user provided full event names 2011-02-17 10:29:19 -02:00
exec_cmd.c perf tools: Makefile: Remove various and sundry cruft 2011-02-18 07:43:06 -02:00
exec_cmd.h
generate-cmdlist.sh
header.c perf tool: Fix gcc 4.6.0 issues 2011-02-07 12:41:41 -02:00
header.h perf tools: Kill event_t typedef, use 'union perf_event' instead 2011-01-29 16:25:37 -02:00
help.c
help.h
hist.c perf hists: Print number of samples, not the period sum 2011-02-17 13:56:20 -02:00
hist.h perf annotate: Move locking to struct annotation 2011-02-08 15:03:36 -02:00
hweight.c
levenshtein.c
levenshtein.h
map.c perf tools: Fix 64 bit integer format strings 2011-01-22 23:41:57 -02:00
map.h perf probe: Add basic module support 2010-10-21 16:11:44 -02:00
pager.c
parse-events.c perf list: Allow filtering list of events 2011-02-17 15:38:58 -02:00
parse-events.h perf list: Allow filtering list of events 2011-02-17 15:38:58 -02:00
parse-options.c
parse-options.h perf options: add OPT_CALLBACK_DEFAULT_NOOPT 2010-12-06 15:33:29 -02:00
path.c perf tools: add test for strlcpy() 2010-08-21 11:22:47 -03:00
PERF-VERSION-GEN
probe-event.c perf probe: Fix error propagation leading to segfault 2011-02-21 22:21:27 -03:00
probe-event.h perf probe: Add filters support for available functions 2011-01-28 09:20:25 -02:00
probe-finder.c perf probe: Fix error propagation leading to segfault 2011-02-21 22:21:27 -03:00
probe-finder.h perf tools: Remove hardcoded include paths for elfutils 2010-11-19 16:38:04 -02:00
pstack.c
pstack.h perf ui: Move hists browser to util/ui/browsers/ 2010-08-10 16:11:08 -03:00
python.c perf python: Fix build on 32-bit 2011-01-31 20:56:27 -02:00
quote.c
quote.h
run-command.c
run-command.h
session.c perf tools: Kill event_t typedef, use 'union perf_event' instead 2011-01-29 16:25:37 -02:00
session.h perf tools: Kill event_t typedef, use 'union perf_event' instead 2011-01-29 16:25:37 -02:00
setup.py perf python: Add cgroup.c to setup.py to get it building again 2011-02-17 10:07:42 -02:00
sigchain.c
sigchain.h
sort.c perf hist: Better displaying of unresolved DSOs and symbols 2010-12-06 15:12:34 -02:00
sort.h perf: Keep track of the max depth of a callchain 2010-08-22 20:43:17 +02:00
strbuf.c
strbuf.h
strfilter.c perf tools: Add strfilter for general purpose string filter 2011-01-28 09:19:38 -02:00
strfilter.h perf tools: Add strfilter for general purpose string filter 2011-01-28 09:19:38 -02:00
string.c perf tools: Fix lazy wildcard matching 2010-12-21 19:15:42 -02:00
strlist.c
strlist.h
svghelper.c perf tools: Fix time function double declaration with glibc 2011-01-22 19:53:00 -02:00
svghelper.h
symbol.c perf tool: Fix gcc 4.6.0 issues 2011-02-07 12:41:41 -02:00
symbol.h Merge commit 'v2.6.37-rc8' into perf/core 2011-01-04 08:08:54 +01:00
thread_map.c perf threads: Move thread_map to separate file 2011-01-24 10:59:00 -02:00
thread_map.h perf threads: Move thread_map to separate file 2011-01-24 10:59:00 -02:00
thread.c perf threads: Move thread_map to separate file 2011-01-24 10:59:00 -02:00
thread.h perf threads: Move thread_map to separate file 2011-01-24 10:59:00 -02:00
top.c perf top: Remove superfluous name_len field 2011-02-05 12:26:40 -02:00
top.h perf annotate: Move locking to struct annotation 2011-02-08 15:03:36 -02:00
trace-event-info.c perf tools: Introduce event selectors 2011-01-03 16:39:04 -02:00
trace-event-parse.c perf tool: Fix gcc 4.6.0 issues 2011-02-07 12:41:41 -02:00
trace-event-read.c
trace-event-scripting.c perf trace scripting: Fix extern struct definitions 2010-10-04 12:24:51 -03:00
trace-event.h perf tools: Introduce event selectors 2011-01-03 16:39:04 -02:00
types.h perf tools: Fix 64 bit integer format strings 2011-01-22 23:41:57 -02:00
usage.c
util.c perf util: Move do_read from session to util 2011-01-03 16:50:55 -02:00
util.h perf tools: Makefile: Remove platform-specific cruft 2011-02-18 07:42:07 -02:00
values.c perf tools: Fix 64 bit integer format strings 2011-01-22 23:41:57 -02:00
values.h
wrapper.c
xyarray.c perf tools: Introduce event selectors 2011-01-03 16:39:04 -02:00
xyarray.h perf tools: Introduce event selectors 2011-01-03 16:39:04 -02:00