• Arnaldo Carvalho de Melo's avatar
    perf script: Fix --per-event-dump for auxtrace synth evsels · 501e5bbe
    Arnaldo Carvalho de Melo authored
    When processing PERF_RECORD_AUXTRACE_INFO several perf_evsel entries
    will be synthesized and inserted into session->evlist, eventually ending
    in perf_script.tool.sample(), which ends up calling builtin-script.c's
    process_event(), that expects evsel->priv to be a perf_evsel_script
    object with a valid FILE pointer in fp.
    
    So we need to intercept the processing of PERF_RECORD_AUXTRACE_INFO and
    then setup evsel->priv for these newly created perf_evsel instances, do
    it to fix the segfault in process_event() trying to use a NULL for that
    FILE pointer.
    Reported-by: default avatarAlexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
    Cc: Wang Nan <wangnan0@huawei.com>
    Cc: yuzhoujian <yuzhoujian@didichuxing.com>
    Fixes: a14390fd ("perf script: Allow creating per-event dump files")
    Link: http://lkml.kernel.org/n/tip-bthnur8r8de01gxvn2qayx6e@git.kernel.org
    [ Merge fix by Ravi Bangoria before pushing upstream to preserv bisectability ]
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    501e5bbe
Name
Last commit
Last update
..
accounting Loading commit data...
arch Loading commit data...
build Loading commit data...
cgroup Loading commit data...
firewire Loading commit data...
gpio Loading commit data...
hv Loading commit data...
iio Loading commit data...
include Loading commit data...
kvm/kvm_stat Loading commit data...
laptop Loading commit data...
leds Loading commit data...
lib Loading commit data...
net Loading commit data...
nfsd Loading commit data...
objtool Loading commit data...
pci Loading commit data...
pcmcia Loading commit data...
perf Loading commit data...
power Loading commit data...
scripts Loading commit data...
spi Loading commit data...
testing Loading commit data...
thermal/tmon Loading commit data...
time Loading commit data...
usb Loading commit data...
virtio Loading commit data...
vm Loading commit data...
Makefile Loading commit data...