From: Rafael Fonseca Date: Mon, 13 Feb 2017 14:52:04 +0000 (+0100) Subject: ucalls: fix lambda syntax on python3 X-Git-Tag: v0.3.0~42^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d6690610af9b19adee975b14a8c977ec6b40bf3;p=platform%2Fupstream%2Fbcc.git ucalls: fix lambda syntax on python3 $ ucalls File "./ucalls", line 239 data = map(lambda (k, v): (k.clazz + "." + k.method, ^ SyntaxError: invalid syntax See: https://www.python.org/dev/peps/pep-3113/ --- diff --git a/tools/ucalls.py b/tools/ucalls.py index 83727b3..2342305 100755 --- a/tools/ucalls.py +++ b/tools/ucalls.py @@ -236,25 +236,26 @@ if args.syscalls: def get_data(): # Will be empty when no language was specified for tracing if args.latency: - data = list(map(lambda (k, v): (k.clazz + "." + k.method, - (v.num_calls, v.total_ns)), + data = list(map(lambda kv: (kv[0].clazz + "." + kv[0].method, + (kv[1].num_calls, kv[1].total_ns)), bpf["times"].items())) else: - data = list(map(lambda (k, v): (k.clazz + "." + k.method, (v.value, 0)), + data = list(map(lambda kv: (kv[0].clazz + "." + kv[0].method, + (kv[1].value, 0)), bpf["counts"].items())) if args.syscalls: if args.latency: - syscalls = map(lambda (k, v): (bpf.ksym(k.value), - (v.num_calls, v.total_ns)), + syscalls = map(lambda kv: (bpf.ksym(kv[0].value), + (kv[1].num_calls, kv[1].total_ns)), bpf["systimes"].items()) data.extend(syscalls) else: - syscalls = map(lambda (k, v): (bpf.ksym(k.value), (v.value, 0)), + syscalls = map(lambda kv: (bpf.ksym(kv[0].value), (kv[1].value, 0)), bpf["syscounts"].items()) data.extend(syscalls) - return sorted(data, key=lambda (k, v): v[1 if args.latency else 0]) + return sorted(data, key=lambda kv: kv[1][1 if args.latency else 0]) def clear_data(): if args.latency: