Commit 058c46fa authored by Rafael Fonseca's avatar Rafael Fonseca

uobjnew: fix lambda syntax in python3

$ ./uobjnew
  File "./uobjnew", line 150
    data = sorted(data.items(), key=lambda (k, v): v.num_allocs)
                                           ^
SyntaxError: invalid syntax
parent 3d981513
...@@ -147,13 +147,13 @@ while True: ...@@ -147,13 +147,13 @@ while True:
print() print()
data = bpf["allocs"] data = bpf["allocs"]
if args.top_count: if args.top_count:
data = sorted(data.items(), key=lambda (k, v): v.num_allocs) data = sorted(data.items(), key=lambda k, v: v.num_allocs)
data = data[-args.top_count:] data = data[-args.top_count:]
elif args.top_size: elif args.top_size:
data = sorted(data.items(), key=lambda (k, v): v.total_size) data = sorted(data.items(), key=lambda k, v: v.total_size)
data = data[-args.top_size:] data = data[-args.top_size:]
else: else:
data = sorted(data.items(), key=lambda (k, v): v.total_size) data = sorted(data.items(), key=lambda k, v: v.total_size)
print("%-30s %8s %12s" % ("TYPE", "# ALLOCS", "# BYTES")) print("%-30s %8s %12s" % ("TYPE", "# ALLOCS", "# BYTES"))
for key, value in data: for key, value in data:
if args.language == "c": if args.language == "c":
......
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