hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/tools/perf/scripts/python/stackcollapse.py
....@@ -19,13 +19,15 @@
1919 # Written by Paolo Bonzini <pbonzini@redhat.com>
2020 # Based on Brendan Gregg's stackcollapse-perf.pl script.
2121
22
+from __future__ import print_function
23
+
2224 import os
2325 import sys
2426 from collections import defaultdict
2527 from optparse import OptionParser, make_option
2628
2729 sys.path.append(os.environ['PERF_EXEC_PATH'] + \
28
- '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
30
+ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
2931
3032 from perf_trace_context import *
3133 from Core import *
....@@ -120,7 +122,6 @@
120122 lines[stack_string] = lines[stack_string] + 1
121123
122124 def trace_end():
123
- list = lines.keys()
124
- list.sort()
125
+ list = sorted(lines)
125126 for stack in list:
126
- print "%s %d" % (stack, lines[stack])
127
+ print("%s %d" % (stack, lines[stack]))