Commit 770d2f86 authored by Jeremy Cline's avatar Jeremy Cline Committed by Arnaldo Carvalho de Melo

perf scripts python: Add Python 3 support to Core.py

Support both Python 2 and Python 3 in Core.py. This should have no
functional change.
Signed-off-by: default avatarJeremy Cline <jeremy@jcline.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Herton Krzesinski <herton@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/0100016341a72ebe-e572899e-f445-4765-98f0-c314935727f9-000000@email.amazonses.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 877cc639
...@@ -32,9 +32,7 @@ def flag_str(event_name, field_name, value): ...@@ -32,9 +32,7 @@ def flag_str(event_name, field_name, value):
if flag_fields[event_name][field_name]: if flag_fields[event_name][field_name]:
print_delim = 0 print_delim = 0
keys = flag_fields[event_name][field_name]['values'].keys() for idx in sorted(flag_fields[event_name][field_name]['values']):
keys.sort()
for idx in keys:
if not value and not idx: if not value and not idx:
string += flag_fields[event_name][field_name]['values'][idx] string += flag_fields[event_name][field_name]['values'][idx]
break break
...@@ -51,9 +49,7 @@ def symbol_str(event_name, field_name, value): ...@@ -51,9 +49,7 @@ def symbol_str(event_name, field_name, value):
string = "" string = ""
if symbolic_fields[event_name][field_name]: if symbolic_fields[event_name][field_name]:
keys = symbolic_fields[event_name][field_name]['values'].keys() for idx in sorted(symbolic_fields[event_name][field_name]['values']):
keys.sort()
for idx in keys:
if not value and not idx: if not value and not idx:
string = symbolic_fields[event_name][field_name]['values'][idx] string = symbolic_fields[event_name][field_name]['values'][idx]
break break
...@@ -74,9 +70,7 @@ def trace_flag_str(value): ...@@ -74,9 +70,7 @@ def trace_flag_str(value):
string = "" string = ""
print_delim = 0 print_delim = 0
keys = trace_flags.keys() for idx in trace_flags:
for idx in keys:
if not value and not idx: if not value and not idx:
string += "NONE" string += "NONE"
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment