# Based on Brendan Gregg's stackcollapse-perf.pl script.
# Based on Brendan Gregg's stackcollapse-perf.pl script.
+from __future__ import print_function
+
import os
import sys
from collections import defaultdict
import os
import sys
from collections import defaultdict
lines[stack_string] = lines[stack_string] + 1
def trace_end():
lines[stack_string] = lines[stack_string] + 1
def trace_end():
- list = lines.keys()
- list.sort()
- print "%s %d" % (stack, lines[stack])
+ print("%s %d" % (stack, lines[stack]))