Commit 6b75c735 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

perf: net_dropmonitor: Remove progress indicator

We can read /proc/kallsyms in a fraction of a second, so why waste
a further fraction of a second showing progress?
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0ce58bae
...@@ -15,28 +15,17 @@ kallsyms = [] ...@@ -15,28 +15,17 @@ kallsyms = []
def get_kallsyms_table(): def get_kallsyms_table():
global kallsyms global kallsyms
try: try:
f = open("/proc/kallsyms", "r") f = open("/proc/kallsyms", "r")
linecount = 0
for line in f:
linecount = linecount+1
f.seek(0)
except: except:
return return
j = 0
for line in f: for line in f:
loc = int(line.split()[0], 16) loc = int(line.split()[0], 16)
name = line.split()[2] name = line.split()[2]
j = j +1
if ((j % 100) == 0):
print "\r" + str(j) + "/" + str(linecount),
kallsyms.append((loc, name)) kallsyms.append((loc, name))
print "\r" + str(j) + "/" + str(linecount)
kallsyms.sort() kallsyms.sort()
return
def get_sym(sloc): def get_sym(sloc):
loc = int(sloc) loc = int(sloc)
......
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