I only have made the addr2line usage faster.
After mailing with Milian, for him the script was just POC, he's developed
app called Hotspot aimed specifically at perf and he's not
interested in submitting it upstream. But I find the script useful
(and I really like KCachegrind's call graph), and it does the job for me,
so with his consent I'm submitting it.
I'm not a KDE developer so feel free to ignore my comments, but there are two issues for python 3:
- There is invalid whitespace in this file (python3 throws TabError for line 76ff).
- dict.iteritems() does not work in python 3, see https://python-future.org/compatible_idioms.html#iterating-through-dict-keys-values-items. I replaced iteritems() by items().
I'm on Arch Linux and '/usr/bin/python' is version 3.7.3. I don't know how the python version is determined in scripts run through 'perf script', unfortunately. Could be that they invoke /usr/bin/python (through #!/usr/bin/python?).
Anyway, after fixing the two issues mentioned above your script runs fine with python 3 here...
It doesn't change anything if I change here /usr/bin/python to point to python3, so I guess I can't change that. Can you simply post a fixed version in some form (I don't know if Phabricator lets you edit my patch)?
A couple of notes:
- can you please remove the .py extension? the other scripts do not have it
- what about installing it, just like the other scripts?
- since it is a new Python script, what about formatting it according to PEP5? (so 4 spaces indentation, 80 chars limit per line, etc)