diff options
author | Tony Jones <[email protected]> | 2019-01-23 16:52:25 -0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2019-01-25 15:12:10 +0100 |
commit | 72e0b15cb24a497d7d0d4707cf51ff40c185ae8c (patch) | |
tree | e979d346a52c45e68a3d640fadfa2a243d5c97ee /tools/perf/scripts/python/stat-cpi.py | |
parent | cc437642255224e4140fed1f3e3156fc8ad91903 (diff) |
perf script python: Use PyBytes for attr in trace-event-python
With Python3. PyUnicode_FromStringAndSize is unsafe to call on attr and will
return NULL. Use _PyBytes_FromStringAndSize (as with raw_buf).
Below is the observed behavior without the fix. Note it is first necessary
to apply the prior fix (Add trace_context extension module to sys,modules):
# ldd /usr/bin/perf | grep -i python
libpython3.6m.so.1.0 => /usr/lib64/libpython3.6m.so.1.0 (0x00007f8e1dfb2000)
# perf record -e raw_syscalls:sys_enter /bin/false
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.018 MB perf.data (21 samples) ]
# perf script -g python | cat
generated Python script: perf-script.py
# perf script -s ./perf-script.py
in trace_begin
Segmentation fault (core dumped)
Signed-off-by: Tony Jones <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Tested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jaroslav Škarvada <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: Seeteena Thoufeek <[email protected]>
Fixes: 66dfdff03d19 ("perf tools: Add Python 3 support")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stat-cpi.py')
0 files changed, 0 insertions, 0 deletions