History

perf scripts python intel-pt-events: Delete unused 'event_attr variable

The 'event_attr' is never used later, the var is ok be deleted. Additional code simplification is to substitute string slice comparison with "substring" function. This case no need to know the length specific words.

Alexander Pantyukhin committed 3 years ago

Commit 984abd31 parent eab50511 file · +3 −3Browse files

Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all

Unified · Split

tools/perf/scripts/python/intel-pt-events.py+3−3
@@ -340,7 +340,6 @@ def print_srccode(comm, param_dict, sample, symbol, dso, with_insn): · 339 unmodified lines
340340 print(start_str, src_str)
341341
342342 def do_process_event(param_dict):
343− event_attr = param_dict["attr"]
344343 sample = param_dict["sample"]
345344 raw_buf = param_dict["raw_buf"]
346345 comm = param_dict["comm"]
@@ -349,6 +348,7 @@ def do_process_event(param_dict): · 2 unmodified lines
349348 # callchain = param_dict["callchain"]
350349 # brstack = param_dict["brstack"]
351350 # brstacksym = param_dict["brstacksym"]
351+ # event_attr = param_dict["attr"]
352352
353353 # Symbol and dso info are not always resolved
354354 dso = get_optional(param_dict, "dso")
@@ -359,13 +359,13 @@ def do_process_event(param_dict): · 4 unmodified lines
359359 print(glb_switch_str[cpu])
360360 del glb_switch_str[cpu]
361361
362− if name[0:12] == "instructions":
362+ if name.startswith("instructions"):
363363 if glb_src:
364364 print_srccode(comm, param_dict, sample, symbol, dso, True)
365365 else:
366366 print_instructions_start(comm, sample)
367367 print_common_ip(param_dict, sample, symbol, dso)
368− elif name[0:8] == "branches":
368+ elif name.startswith("branches"):
369369 if glb_src:
370370 print_srccode(comm, param_dict, sample, symbol, dso, False)
371371 else: