hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/tools/perf/scripts/python/net_dropmonitor.py
....@@ -1,11 +1,13 @@
11 # Monitor the system for dropped packets and proudce a report of drop locations and counts
22 # SPDX-License-Identifier: GPL-2.0
33
4
+from __future__ import print_function
5
+
46 import os
57 import sys
68
79 sys.path.append(os.environ['PERF_EXEC_PATH'] + \
8
- '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
10
+ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
911
1012 from perf_trace_context import *
1113 from Core import *
....@@ -50,19 +52,19 @@
5052 return (None, 0)
5153
5254 def print_drop_table():
53
- print "%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT")
55
+ print("%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT"))
5456 for i in drop_log.keys():
5557 (sym, off) = get_sym(i)
5658 if sym == None:
5759 sym = i
58
- print "%25s %25s %25s" % (sym, off, drop_log[i])
60
+ print("%25s %25s %25s" % (sym, off, drop_log[i]))
5961
6062
6163 def trace_begin():
62
- print "Starting trace (Ctrl-C to dump results)"
64
+ print("Starting trace (Ctrl-C to dump results)")
6365
6466 def trace_end():
65
- print "Gathering kallsyms data"
67
+ print("Gathering kallsyms data")
6668 get_kallsyms_table()
6769 print_drop_table()
6870