linux/tools/perf/util
Arnaldo Carvalho de Melo 3995614d9b perf annotate: Fix fallback to unparsed disassembler line
When annotating source/disasm lines the perf tools parse the output of
objdump, trying to provide augmented output that allows navigating
jumps, calls, etc.

But when a line output by objdump can't be parsed the annotation code
falls back to just presenting the unparsed line.

When fixing a leak in the 0fb9f2aab7 commit ("perf annotate: Fix
memory leaks in LOCK handling") we failed to take that into account and
instead tried to free one of the data structures that should be freed
only when successfully allocated, oops, segfault.

There was a change in the way the objdump output for lock prefixed
instructions is formatted that lead the relevant parser to fail to grok
it.

At least RHEL7 works ok, but Fedora 20 segfaults.

Fix it by making the ins__delete() destructor work like the most basic
destructor: free().

Namely make it accept a NULL pointer and when handling it just do
nothing.

Further investigation is needed to figure out the nature of the objdump
output change so as to make the parser grok it.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Rabin Vincent <rabin@rab.in>
Link: http://lkml.kernel.org/n/tip-7wsy0zo292pif0yjoqpfryrz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-03-05 15:27:28 -03:00
..
include tools: Remove bitops/hweight usage of bits in tools/perf 2015-01-16 17:49:29 -03:00
scripting-engines perf tools: Remove EOL whitespaces 2015-01-21 13:24:31 -03:00
abspath.c
alias.c
annotate.c perf annotate: Fix fallback to unparsed disassembler line 2015-03-05 15:27:28 -03:00
annotate.h perf tools: Fix segfault for symbol annotation on TUI 2015-01-16 17:49:29 -03:00
bitmap.c
build-id.c perf buildid-cache: Remove extra debugdir variables 2014-12-09 09:14:34 -03:00
build-id.h perf build-id: Move disable_buildid_cache() to util/build-id.c 2014-11-19 12:33:46 -03:00
cache.h perf tools: Elide strlcpy warning with uclibc 2015-01-16 17:49:29 -03:00
callchain.c perf callchain: Free callchains when hist entries are deleted 2015-01-08 11:56:35 -03:00
callchain.h perf callchain: Free callchains when hist entries are deleted 2015-01-08 11:56:35 -03:00
cgroup.c
cgroup.h
cloexec.c perf tools: Fix probing for PERF_FLAG_FD_CLOEXEC flag 2015-02-25 16:40:13 -03:00
cloexec.h
color.c perf tools: Remove some unused functions from color.c 2015-01-21 13:24:32 -03:00
color.h perf tools: Remove some unused functions from color.c 2015-01-21 13:24:32 -03:00
comm.c
comm.h perf tools: Add facility to export data in database-friendly way 2014-10-29 10:32:49 -02:00
config.c perf tools: Add --buildid-dir option to set cache directory 2014-12-09 09:14:35 -03:00
cpumap.c
cpumap.h
ctype.c
data.c
data.h
db-export.c perf tools: Defer export of comms that were not 'set' 2014-11-03 18:11:59 -03:00
db-export.h perf tools: Defer export of comms that were not 'set' 2014-11-03 18:11:59 -03:00
debug.c perf tools: Allow to force redirect pr_debug to stderr. 2014-11-24 18:03:48 -03:00
debug.h
dso.c perf symbols: Convert lseek + read to pread 2015-01-29 17:02:01 -03:00
dso.h perf callchain: Cache eh/debug frame offset for dwarf unwind 2015-01-29 16:20:42 -03:00
dwarf-aux.c
dwarf-aux.h
environment.c
event.c perf tools: Add id index 2014-10-29 11:24:47 -02:00
event.h Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-12-09 21:18:06 -08:00
evlist.c tools lib fs: Adopt debugfs open strerrno method 2015-01-22 10:34:22 -03:00
evlist.h perf top: Fix SIGBUS on sparc64 2015-02-25 17:37:44 -03:00
evsel.c perf evsel: Set attr.task bit for a tracking event 2015-01-29 16:54:59 -03:00
evsel.h perf stat: Add support for per-pkg counters 2014-12-01 20:00:30 -03:00
exec_cmd.c
exec_cmd.h
find-vdso-map.c perf tools: Build programs to copy 32-bit compatibility 2014-10-29 10:32:48 -02:00
generate-cmdlist.sh
header.c perf header: Set header version correctly 2015-01-29 16:53:11 -03:00
header.h perf build-id: Move build-id related functions to util/build-id.c 2014-11-05 10:14:07 -03:00
help.c
help.h
hist.c perf tools: Pass struct perf_hpp_fmt to its callbacks 2015-01-21 13:24:34 -03:00
hist.h perf tools: Pass struct perf_hpp_fmt to its callbacks 2015-01-21 13:24:34 -03:00
intlist.c
intlist.h
kvm-stat.h
levenshtein.c
levenshtein.h
machine.c perf machine: Fix __machine__findnew_thread() error path 2015-01-16 17:49:28 -03:00
machine.h perf tools: Add facility to export data in database-friendly way 2014-10-29 10:32:49 -02:00
map.c perf callchain: Make get_srcline fall back to sym+offset 2014-11-24 18:03:47 -03:00
map.h perf symbols: Introduce 'for' method to iterate over the symbols with a given name 2015-01-21 10:06:15 -03:00
ordered-events.c perf session: Add option to copy events when queueing 2014-10-15 17:39:03 -03:00
ordered-events.h perf session: Add option to copy events when queueing 2014-10-15 17:39:03 -03:00
pager.c
parse-events.c Merge branch 'perf/hw_breakpoints' into perf/core 2015-01-28 15:48:59 +01:00
parse-events.h Merge branch 'perf/hw_breakpoints' into perf/core 2015-01-28 15:48:59 +01:00
parse-events.l perf tools: allow user to specify hardware breakpoint bp_len 2014-12-03 15:14:29 +01:00
parse-events.y perf tools: allow user to specify hardware breakpoint bp_len 2014-12-03 15:14:29 +01:00
parse-options.c perf tools: Allow use of an exclusive option more than once 2015-01-21 13:24:33 -03:00
parse-options.h perf tools: Add support for exclusive option 2014-10-29 10:32:47 -02:00
path.c
perf_regs.c
perf_regs.h
PERF-VERSION-GEN
pmu.c perf tools: Extend format_alias() to include event parameters 2015-01-21 13:24:33 -03:00
pmu.h perf tools: Add snapshot format file parsing 2014-11-24 18:03:51 -03:00
pmu.l
pmu.y
probe-event.c perf probe: Fix probing kretprobes 2015-01-21 10:06:24 -03:00
probe-event.h
probe-finder.c perf probe: Fix crash in dwarf_getcfi_elf 2015-01-02 12:44:01 -03:00
probe-finder.h
pstack.c
pstack.h
python-ext-sources tools: Remove bitops/hweight usage of bits in tools/perf 2015-01-16 17:49:29 -03:00
python.c perf tools: Remove EOL whitespaces 2015-01-21 13:24:31 -03:00
quote.c
quote.h
rblist.c
rblist.h
record.c perf tools: Use sysctl__read_int instead of ad-hoc copies 2014-12-11 17:53:04 -03:00
run-command.c
run-command.h
session.c perf tools: Do not use __perf_session__process_events() directly 2015-01-29 16:36:32 -03:00
session.h perf tools: Do not use __perf_session__process_events() directly 2015-01-29 16:36:32 -03:00
setup.py
sigchain.c
sigchain.h
sort.c perf tools: Pass struct perf_hpp_fmt to its callbacks 2015-01-21 13:24:34 -03:00
sort.h
srcline.c perf: Fix building warning on ARM 32 2014-12-19 13:09:43 +01:00
stat.c
stat.h
strbuf.c
strbuf.h
strfilter.c
strfilter.h
string.c Revert "perf tools: Default to cpu// for events v5" 2014-10-15 16:04:33 -03:00
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol-elf.c perf symbols: Define EM_AARCH64 for older OSes 2015-02-25 17:39:17 -03:00
symbol-minimal.c perf symbols: Fix use after free in filename__read_build_id 2014-12-17 11:58:17 -03:00
symbol.c perf tools: Remove EOL whitespaces 2015-01-21 13:24:31 -03:00
symbol.h perf symbols: Introduce method to iterate symbols ordered by name 2015-01-21 10:05:54 -03:00
target.c
target.h
thread_map.c
thread_map.h
thread-stack.c perf tools: Enhance the thread stack to output call/return data 2014-11-03 17:43:56 -03:00
thread-stack.h perf tools: Enhance the thread stack to output call/return data 2014-11-03 17:43:56 -03:00
thread.c perf tools: Only override the default :tid comm entry 2014-11-19 12:37:26 -03:00
thread.h perf tools: Add a thread stack for synthesizing call chains 2014-11-03 17:10:59 -03:00
tool.h perf tools: Add id index 2014-10-29 11:24:47 -02:00
top.c
top.h
trace-event-info.c
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c
trace-event.c
trace-event.h
tsc.c
tsc.h
unwind-libdw.c perf callchains: Use thread->mg->machine 2014-10-29 10:32:46 -02:00
unwind-libdw.h
unwind-libunwind.c perf callchain: Cache eh/debug frame offset for dwarf unwind 2015-01-29 16:20:42 -03:00
unwind.h perf callchains: Use thread->mg->machine 2014-10-29 10:32:46 -02:00
usage.c
util.c perf tools: Use sysctl__read_int instead of ad-hoc copies 2014-12-11 17:53:04 -03:00
util.h perf: Fix building warning on ARM 32 2014-12-19 13:09:43 +01:00
values.c
values.h
vdso.c perf tools: Do not attempt to run perf-read-vdso32 if it wasn't built 2014-10-29 10:32:48 -02:00
vdso.h perf tools: Add support for 32-bit compatibility VDSOs 2014-10-29 10:32:48 -02:00
wrapper.c
xyarray.c
xyarray.h
zlib.c perf tools: Add gzip decompression support for kernel module 2014-11-05 10:11:26 -03:00