summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorStefan Schmidt <stefan@datenfreihafen.org>2019-03-19 16:25:37 +0100
committerStefan Schmidt <stefan@datenfreihafen.org>2019-03-19 16:25:37 +0100
commit86008304dc2ad41a274cdacb585c641ec6bbb558 (patch)
tree7d8fdd6d9cbba05cebb7d36c4309ea2bb48e0af0 /tools/perf/scripts/python/stackcollapse.py
parent19b39a25388e71390e059906c979f87be4ef0c71 (diff)
parentffa91253739ca89fc997195d8bbd1f7ba3e29fbe (diff)
Merge remote-tracking branch 'net/master'
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]))