aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-03-18 11:14:51 +0000
committerMark Brown <broonie@kernel.org>2019-03-18 11:14:51 +0000
commit22d91ed32b653481f47e81719858678e8c92089e (patch)
treea10d240e35ba7fa5d6bb1c9aad1a5db622e5dddd /tools/perf/scripts/python/stackcollapse.py
parent2b13bee3884926cba22061efa75bd315e871de24 (diff)
parent9e98c678c2d6ae3a17cb2de55d17f69dddaa231b (diff)
Merge tag 'v5.1-rc1' into asoc-5.1
Linux 5.1-rc1
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
-rwxr-xr-xtools/perf/scripts/python/stackcollapse.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/scripts/python/stackcollapse.py b/tools/perf/scripts/python/stackcollapse.py
index 1697b5e18c96..b1c4def1410a 100755
--- a/tools/perf/scripts/python/stackcollapse.py
+++ b/tools/perf/scripts/python/stackcollapse.py
@@ -19,13 +19,15 @@
# Written by Paolo Bonzini <pbonzini@redhat.com>
# Based on Brendan Gregg's stackcollapse-perf.pl script.
+from __future__ import print_function
+
import os
import sys
from collections import defaultdict
from optparse import OptionParser, make_option
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
- '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
+ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
@@ -120,7 +122,6 @@ def process_event(param_dict):
lines[stack_string] = lines[stack_string] + 1
def trace_end():
- list = lines.keys()
- list.sort()
+ list = sorted(lines)
for stack in list:
- print "%s %d" % (stack, lines[stack])
+ print("%s %d" % (stack, lines[stack]))