mirror_ubuntu-kernels/tools/perf/util
Janne Huttunen db0ba84c04 perf script python: Fix dict reference counting
The dictionaries are attached to the parameter tuple that steals the
references and takes care of releasing them when appropriate.  The code
should not decrement the reference counts explicitly.  E.g. if libpython
has been built with reference debugging enabled, the superfluous DECREFs
will trigger this error when running perf script:

  Fatal Python error: Objects/tupleobject.c:238 object at
  0x7f10f2041b40 has negative ref count -1
  Aborted (core dumped)

If the reference debugging is not enabled, the superfluous DECREFs might
cause the dict objects to be silently released while they are still in
use. This may trigger various other assertions or just cause perf
crashes and/or weird and unexpected data changes in the stored Python
objects.

Signed-off-by: Janne Huttunen <janne.huttunen@nokia.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jaroslav Skarvada <jskarvad@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1531133990-17485-1-git-send-email-janne.huttunen@nokia.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2018-07-11 09:45:24 -04:00
..
c++ perf tools: Fix a clang 7.0 compilation error 2018-06-25 11:59:37 -03:00
cs-etm-decoder perf cs-etm: Fix indexing for decoder packet queue 2018-05-30 15:38:40 -03:00
include
intel-pt-decoder perf intel-pt: Fix packet decoding of CYC packets 2018-06-25 11:59:36 -03:00
libunwind
scripting-engines perf script python: Fix dict reference counting 2018-07-11 09:45:24 -04:00
annotate.c perf annnotate: Make __symbol__inc_addr_samples handle src->histograms == NULL 2018-06-06 12:52:08 -03:00
annotate.h perf annotate: Move objdump_path to struct annotation_options 2018-06-04 10:28:53 -03:00
arm-spe-pkt-decoder.c
arm-spe-pkt-decoder.h
arm-spe.c
arm-spe.h
auxtrace.c perf tools: Use kallsyms__is_function() 2018-04-26 13:47:14 -03:00
auxtrace.h
block-range.c
block-range.h
bpf-loader.c perf bpf: Fix NULL return handling in bpf__prepare_load() 2018-05-30 15:35:31 -03:00
bpf-loader.h
bpf-prologue.c docs: Fix some broken references 2018-06-15 18:10:01 -03:00
bpf-prologue.h
branch.c
branch.h
Build perf tools: Remove dead quote.[ch] code 2018-06-04 10:28:50 -03:00
build-id.c perf thread: Make thread__find_map() return the map 2018-04-26 13:47:08 -03:00
build-id.h
cache.h
call-path.c
call-path.h
callchain.c
callchain.h
cgroup.c perf cgroup: Make evlist__find_cgroup() more compact 2018-06-04 10:28:50 -03:00
cgroup.h
cloexec.c
cloexec.h
color.c
color.h
comm.c
comm.h
compress.h
config.c perf config: Call perf_config__init() lazily 2018-05-16 16:11:09 -03:00
config.h perf config: Call perf_config__init() lazily 2018-05-16 16:11:09 -03:00
counts.c
counts.h
cpumap.c
cpumap.h
cs-etm.c Merge remote-tracking branch 'tip/perf/urgent' into perf/core 2018-05-15 10:30:17 -03:00
cs-etm.h
ctype.c
data-convert-bt.c
data-convert-bt.h
data-convert.h
data.c
data.h
db-export.c perf symbols: Unify symbol maps 2018-04-27 10:47:06 -03:00
db-export.h
debug.c
debug.h
demangle-java.c
demangle-java.h
demangle-rust.c
demangle-rust.h
drv_configs.c
drv_configs.h
dso.c perf tools: Fix symbol and object code resolution for vdso32 and vdsox32 2018-06-06 12:52:04 -03:00
dso.h perf symbols: Unify symbol maps 2018-04-27 10:47:06 -03:00
dump-insn.c
dump-insn.h
dwarf-aux.c
dwarf-aux.h
dwarf-regs.c
env.c perf machine: Add nr_cpus_avail() 2018-05-22 10:52:49 -03:00
env.h perf machine: Add nr_cpus_avail() 2018-05-22 10:52:49 -03:00
event.c perf machine: Synthesize and process mmap events for x86 PTI entry trampolines 2018-05-23 10:26:39 -03:00
event.h perf machine: Synthesize and process mmap events for x86 PTI entry trampolines 2018-05-23 10:26:39 -03:00
evlist.c perf evlist: Introduce force_leader() method 2018-05-21 14:40:54 -03:00
evlist.h perf evlist: Introduce force_leader() method 2018-05-21 14:40:54 -03:00
evsel_fprintf.c
evsel.c perf evsel: Add has_callchain() helper to make code more compact/clear 2018-06-05 10:09:54 -03:00
evsel.h perf evsel: Add has_callchain() helper to make code more compact/clear 2018-06-05 10:09:54 -03:00
expr.h
expr.y
find-vdso-map.c
genelf_debug.c
genelf.c perf tools: Fix spelling mistake: "builid" -> "buildid" 2018-04-30 12:02:03 -03:00
genelf.h
generate-cmdlist.sh
group.h
header.c perf tools: Fix crash caused by accessing feat_ops[HEADER_LAST_FEATURE] 2018-06-25 11:59:37 -03:00
header.h
help-unknown-cmd.c
help-unknown-cmd.h
hist.c perf hists: Reimplement hists__has_callchains() 2018-06-07 14:42:27 -03:00
hist.h perf hists: Reimplement hists__has_callchains() 2018-06-07 14:42:27 -03:00
intel-bts.c perf thread: Make thread__find_map() return the map 2018-04-26 13:47:08 -03:00
intel-bts.h
intel-pt.c perf intel-pt: Fix "Unexpected indirect branch" error 2018-06-06 12:52:08 -03:00
intel-pt.h
intlist.c
intlist.h
jit.h
jitdump.c
jitdump.h
kvm-stat.h
levenshtein.c
levenshtein.h
llvm-utils.c perf llvm-utils: Remove bashism from kernel include fetch script 2018-07-11 10:01:51 -03:00
llvm-utils.h
lzma.c
machine.c perf machine: Synthesize and process mmap events for x86 PTI entry trampolines 2018-05-23 10:26:39 -03:00
machine.h perf machine: Create maps for x86 PTI entry trampolines 2018-05-23 10:24:08 -03:00
map.c perf map: Consider PTI entry trampolines in rip_2objdump() 2018-06-06 12:52:06 -03:00
map.h perf srcline: Introduce map__srcline() to make code more compact 2018-06-04 10:28:52 -03:00
mem2node.c
mem2node.h
mem-events.c
mem-events.h
memswap.c
memswap.h
metricgroup.c
metricgroup.h
mmap.c
mmap.h
namespaces.c
namespaces.h
ordered-events.c
ordered-events.h
parse-branch-options.c
parse-branch-options.h
parse-events.c perf parse-events: Handle uncore event aliases in small groups properly 2018-05-30 10:40:44 -03:00
parse-events.h perf parse-events: Handle uncore event aliases in small groups properly 2018-05-30 10:40:44 -03:00
parse-events.l perf record: Enable arbitrary event names thru name= modifier 2018-06-06 12:52:04 -03:00
parse-events.y perf tools: Fix error index for pmu event parser 2018-06-07 15:50:14 -03:00
parse-regs-options.c
parse-regs-options.h
path.c
path.h
perf_regs.c
perf_regs.h
perf-hooks-list.h
perf-hooks.c
perf-hooks.h
PERF-VERSION-GEN
pmu.c perf stat: Remove duplicate event counting 2018-06-25 11:59:37 -03:00
pmu.h
pmu.l
pmu.y
print_binary.c
print_binary.h
probe-event.c perf probe: Use return of map__get() to make code more compact 2018-06-04 10:28:50 -03:00
probe-event.h
probe-file.c tools lib api: Unexport 'tracing_path' variable 2018-05-16 16:27:14 -03:00
probe-file.h
probe-finder.c
probe-finder.h
pstack.c
pstack.h
python-ext-sources
python.c
rb_resort.h
rblist.c
rblist.h
record.c
rwsem.c
rwsem.h
sane_ctype.h
session.c perf evsel: Add has_callchain() helper to make code more compact/clear 2018-06-05 10:09:54 -03:00
session.h
setns.c
setup.py
smt.c
smt.h
sort.c perf srcline: Make hist_entry srcline helper consistent with map's 2018-06-04 10:28:53 -03:00
sort.h perf hists: Make hist_entry__has_callchains() work with 'perf c2c' 2018-06-07 14:27:19 -03:00
srcline.c perf symbols: Store the ELF symbol type in the symbol struct 2018-04-26 13:47:18 -03:00
srcline.h
stat-shadow.c
stat.c
stat.h perf stat: Add --table option to display time of each run 2018-04-26 09:30:27 -03:00
strbuf.c
strbuf.h
strfilter.c
strfilter.h
string2.h
string.c
strlist.c
strlist.h
svghelper.c
svghelper.h
symbol_fprintf.c perf symbols: Unify symbol maps 2018-04-27 10:47:06 -03:00
symbol-elf.c perf kcore_copy: Amend the offset of sections that remap kernel text 2018-05-23 10:26:44 -03:00
symbol-minimal.c perf symbols: Unify symbol maps 2018-04-27 10:47:06 -03:00
symbol.c perf symbols: Add BSS symbols when reading from /proc/kallsyms 2018-06-06 12:52:09 -03:00
symbol.h perf annotate: Adopt anotation options from symbol_conf 2018-06-04 10:28:53 -03:00
syscalltbl.c
syscalltbl.h
target.c
target.h
term.c
term.h
thread_map.c
thread_map.h
thread-stack.c
thread-stack.h
thread.c perf symbols: Unify symbol maps 2018-04-27 10:47:06 -03:00
thread.h perf thread: Make thread__find_map() search all maps 2018-04-26 13:47:17 -03:00
time-utils.c
time-utils.h
tool.h
top.c
top.h perf annotate stdio: Use annotation_options consistently 2018-06-04 10:28:52 -03:00
trace-event-info.c tools lib api fs tracing_path: Introduce get/put_events_file() helpers 2018-05-17 12:01:50 -03:00
trace-event-parse.c
trace-event-read.c
trace-event-scripting.c
trace-event.c perf parse-events: Use get/put_events_file() 2018-05-17 14:49:36 -03:00
trace-event.h
trigger.h
tsc.c
tsc.h
units.c
units.h
unwind-libdw.c perf thread: Make thread__find_map() search all maps 2018-04-26 13:47:17 -03:00
unwind-libdw.h
unwind-libunwind-local.c perf thread: Make thread__find_map() search all maps 2018-04-26 13:47:17 -03:00
unwind-libunwind.c
unwind.h
usage.c
util-cxx.h
util.c perf tools: No need to unconditionally read the max_stack sysctls 2018-05-17 16:31:32 -03:00
util.h perf tools: No need to unconditionally read the max_stack sysctls 2018-05-17 16:31:32 -03:00
values.c
values.h
vdso.c perf map: Remove enum_type arg to map_groups__first() 2018-04-26 13:47:15 -03:00
vdso.h
xyarray.c
xyarray.h
zlib.c