aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorMark Brown <[email protected]>2019-03-18 11:15:09 +0000
committerMark Brown <[email protected]>2019-03-18 11:15:09 +0000
commit127470597b6b9466872d9794a80804ec95fff8ea (patch)
treeb0087938a7f980c5b3d3879e0c2d18bab45d78e8 /tools/perf/scripts/python/stackcollapse.py
parent3789debfc379ac84b90e2db32d7a6b66d28a2c7c (diff)
parent9e98c678c2d6ae3a17cb2de55d17f69dddaa231b (diff)
Merge tag 'v5.1-rc1' into asoc-5.2
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 <[email protected]>
# 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]))