Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf script python: Add Python3 support to net_dropmonitor.py

Support both Python2 and Python3 in the net_dropmonitor.py script

There may be differences in the ordering of output lines due to
differences in dictionary ordering etc. However the format within lines
should be unchanged.

The use of 'from __future__' implies the minimum supported Python2 version
is now v2.6

Signed-off-by: Tony Jones <tonyj@suse.de>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Link: http://lkml.kernel.org/r/20190222230619.17887-9-tonyj@suse.de
Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Tony Jones and committed by
Arnaldo Carvalho de Melo
8c42b960 e4d053dd

+6 -4
+6 -4
tools/perf/scripts/python/net_dropmonitor.py
··· 1 1 # Monitor the system for dropped packets and proudce a report of drop locations and counts 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 4 + from __future__ import print_function 5 + 4 6 import os 5 7 import sys 6 8 ··· 52 50 return (None, 0) 53 51 54 52 def print_drop_table(): 55 - print "%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT") 53 + print("%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT")) 56 54 for i in drop_log.keys(): 57 55 (sym, off) = get_sym(i) 58 56 if sym == None: 59 57 sym = i 60 - print "%25s %25s %25s" % (sym, off, drop_log[i]) 58 + print("%25s %25s %25s" % (sym, off, drop_log[i])) 61 59 62 60 63 61 def trace_begin(): 64 - print "Starting trace (Ctrl-C to dump results)" 62 + print("Starting trace (Ctrl-C to dump results)") 65 63 66 64 def trace_end(): 67 - print "Gathering kallsyms data" 65 + print("Gathering kallsyms data") 68 66 get_kallsyms_table() 69 67 print_drop_table() 70 68