| .. | .. |
|---|
| 19 | 19 | # Written by Paolo Bonzini <pbonzini@redhat.com> |
|---|
| 20 | 20 | # Based on Brendan Gregg's stackcollapse-perf.pl script. |
|---|
| 21 | 21 | |
|---|
| 22 | +from __future__ import print_function |
|---|
| 23 | + |
|---|
| 22 | 24 | import os |
|---|
| 23 | 25 | import sys |
|---|
| 24 | 26 | from collections import defaultdict |
|---|
| 25 | 27 | from optparse import OptionParser, make_option |
|---|
| 26 | 28 | |
|---|
| 27 | 29 | 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') |
|---|
| 29 | 31 | |
|---|
| 30 | 32 | from perf_trace_context import * |
|---|
| 31 | 33 | from Core import * |
|---|
| .. | .. |
|---|
| 120 | 122 | lines[stack_string] = lines[stack_string] + 1 |
|---|
| 121 | 123 | |
|---|
| 122 | 124 | def trace_end(): |
|---|
| 123 | | - list = lines.keys() |
|---|
| 124 | | - list.sort() |
|---|
| 125 | + list = sorted(lines) |
|---|
| 125 | 126 | for stack in list: |
|---|
| 126 | | - print "%s %d" % (stack, lines[stack]) |
|---|
| 127 | + print("%s %d" % (stack, lines[stack])) |
|---|