diff options
Diffstat (limited to 'tools/perf/scripts/python')
| -rw-r--r-- | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 3 | ||||
| -rw-r--r-- | tools/perf/scripts/python/bin/failed-syscalls-by-pid-record | 3 | ||||
| -rw-r--r-- | tools/perf/scripts/python/bin/sctop-record | 3 | ||||
| -rw-r--r-- | tools/perf/scripts/python/bin/syscall-counts-by-pid-record | 3 | ||||
| -rw-r--r-- | tools/perf/scripts/python/bin/syscall-counts-record | 3 | ||||
| -rw-r--r-- | tools/perf/scripts/python/check-perf-trace.py | 4 | ||||
| -rw-r--r-- | tools/perf/scripts/python/failed-syscalls-by-pid.py | 7 | ||||
| -rw-r--r-- | tools/perf/scripts/python/futex-contention.py | 4 | ||||
| -rwxr-xr-x | tools/perf/scripts/python/net_dropmonitor.py | 2 | ||||
| -rw-r--r-- | tools/perf/scripts/python/netdev-times.py | 26 | ||||
| -rw-r--r-- | tools/perf/scripts/python/sched-migration.py | 41 | ||||
| -rw-r--r-- | tools/perf/scripts/python/sctop.py | 7 | ||||
| -rw-r--r-- | tools/perf/scripts/python/syscall-counts-by-pid.py | 7 | ||||
| -rw-r--r-- | tools/perf/scripts/python/syscall-counts.py | 7 | 
14 files changed, 72 insertions, 48 deletions
| diff --git a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py index de7211e4fa47..38dfb720fb6f 100644 --- a/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py +++ b/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py @@ -107,12 +107,13 @@ def taskState(state):  class EventHeaders:  	def __init__(self, common_cpu, common_secs, common_nsecs, -		     common_pid, common_comm): +		     common_pid, common_comm, common_callchain):  		self.cpu = common_cpu  		self.secs = common_secs  		self.nsecs = common_nsecs  		self.pid = common_pid  		self.comm = common_comm +		self.callchain = common_callchain  	def ts(self):  		return (self.secs * (10 ** 9)) + self.nsecs diff --git a/tools/perf/scripts/python/bin/failed-syscalls-by-pid-record b/tools/perf/scripts/python/bin/failed-syscalls-by-pid-record index 8104895a7b67..74685f318379 100644 --- a/tools/perf/scripts/python/bin/failed-syscalls-by-pid-record +++ b/tools/perf/scripts/python/bin/failed-syscalls-by-pid-record @@ -1,2 +1,3 @@  #!/bin/bash -perf record -e raw_syscalls:sys_exit $@ +(perf record -e raw_syscalls:sys_exit $@ || \ + perf record -e syscalls:sys_exit $@) 2> /dev/null diff --git a/tools/perf/scripts/python/bin/sctop-record b/tools/perf/scripts/python/bin/sctop-record index 4efbfaa7f6a5..d6940841e54f 100644 --- a/tools/perf/scripts/python/bin/sctop-record +++ b/tools/perf/scripts/python/bin/sctop-record @@ -1,2 +1,3 @@  #!/bin/bash -perf record -e raw_syscalls:sys_enter $@ +(perf record -e raw_syscalls:sys_enter $@ || \ + perf record -e syscalls:sys_enter $@) 2> /dev/null diff --git a/tools/perf/scripts/python/bin/syscall-counts-by-pid-record b/tools/perf/scripts/python/bin/syscall-counts-by-pid-record index 4efbfaa7f6a5..d6940841e54f 100644 --- a/tools/perf/scripts/python/bin/syscall-counts-by-pid-record +++ b/tools/perf/scripts/python/bin/syscall-counts-by-pid-record @@ -1,2 +1,3 @@  #!/bin/bash -perf record -e raw_syscalls:sys_enter $@ +(perf record -e raw_syscalls:sys_enter $@ || \ + perf record -e syscalls:sys_enter $@) 2> /dev/null diff --git a/tools/perf/scripts/python/bin/syscall-counts-record b/tools/perf/scripts/python/bin/syscall-counts-record index 4efbfaa7f6a5..d6940841e54f 100644 --- a/tools/perf/scripts/python/bin/syscall-counts-record +++ b/tools/perf/scripts/python/bin/syscall-counts-record @@ -1,2 +1,3 @@  #!/bin/bash -perf record -e raw_syscalls:sys_enter $@ +(perf record -e raw_syscalls:sys_enter $@ || \ + perf record -e syscalls:sys_enter $@) 2> /dev/null diff --git a/tools/perf/scripts/python/check-perf-trace.py b/tools/perf/scripts/python/check-perf-trace.py index 4647a7694cf6..334599c6032c 100644 --- a/tools/perf/scripts/python/check-perf-trace.py +++ b/tools/perf/scripts/python/check-perf-trace.py @@ -27,7 +27,7 @@ def trace_end():  def irq__softirq_entry(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	vec): +	common_callchain, vec):  		print_header(event_name, common_cpu, common_secs, common_nsecs,  			common_pid, common_comm) @@ -38,7 +38,7 @@ def irq__softirq_entry(event_name, context, common_cpu,  def kmem__kmalloc(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	call_site, ptr, bytes_req, bytes_alloc, +	common_callchain, call_site, ptr, bytes_req, bytes_alloc,  	gfp_flags):  		print_header(event_name, common_cpu, common_secs, common_nsecs,  			common_pid, common_comm) diff --git a/tools/perf/scripts/python/failed-syscalls-by-pid.py b/tools/perf/scripts/python/failed-syscalls-by-pid.py index 85805fac4116..cafeff3d74db 100644 --- a/tools/perf/scripts/python/failed-syscalls-by-pid.py +++ b/tools/perf/scripts/python/failed-syscalls-by-pid.py @@ -39,7 +39,7 @@ def trace_end():  def raw_syscalls__sys_exit(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	id, ret): +	common_callchain, id, ret):  	if (for_comm and common_comm != for_comm) or \  	   (for_pid  and common_pid  != for_pid ):  		return @@ -50,6 +50,11 @@ def raw_syscalls__sys_exit(event_name, context, common_cpu,  		except TypeError:  			syscalls[common_comm][common_pid][id][ret] = 1 +def syscalls__sys_exit(event_name, context, common_cpu, +	common_secs, common_nsecs, common_pid, common_comm, +	id, ret): +	raw_syscalls__sys_exit(**locals()) +  def print_error_totals():      if for_comm is not None:  	    print "\nsyscall errors for %s:\n\n" % (for_comm), diff --git a/tools/perf/scripts/python/futex-contention.py b/tools/perf/scripts/python/futex-contention.py index 11e70a388d41..0f5cf437b602 100644 --- a/tools/perf/scripts/python/futex-contention.py +++ b/tools/perf/scripts/python/futex-contention.py @@ -21,7 +21,7 @@ thread_blocktime = {}  lock_waits = {} # long-lived stats on (tid,lock) blockage elapsed time  process_names = {} # long-lived pid-to-execname mapping -def syscalls__sys_enter_futex(event, ctxt, cpu, s, ns, tid, comm, +def syscalls__sys_enter_futex(event, ctxt, cpu, s, ns, tid, comm, callchain,  			      nr, uaddr, op, val, utime, uaddr2, val3):  	cmd = op & FUTEX_CMD_MASK  	if cmd != FUTEX_WAIT: @@ -31,7 +31,7 @@ def syscalls__sys_enter_futex(event, ctxt, cpu, s, ns, tid, comm,  	thread_thislock[tid] = uaddr  	thread_blocktime[tid] = nsecs(s, ns) -def syscalls__sys_exit_futex(event, ctxt, cpu, s, ns, tid, comm, +def syscalls__sys_exit_futex(event, ctxt, cpu, s, ns, tid, comm, callchain,  			     nr, ret):  	if thread_blocktime.has_key(tid):  		elapsed = nsecs(s, ns) - thread_blocktime[tid] diff --git a/tools/perf/scripts/python/net_dropmonitor.py b/tools/perf/scripts/python/net_dropmonitor.py index b5740599aabd..0b6ce8c253e8 100755 --- a/tools/perf/scripts/python/net_dropmonitor.py +++ b/tools/perf/scripts/python/net_dropmonitor.py @@ -66,7 +66,7 @@ def trace_end():  	print_drop_table()  # called from perf, when it finds a correspoinding event -def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, +def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, callchain,  		   skbaddr, location, protocol):  	slocation = str(location)  	try: diff --git a/tools/perf/scripts/python/netdev-times.py b/tools/perf/scripts/python/netdev-times.py index 9aa0a32972e8..4d21ef2d601d 100644 --- a/tools/perf/scripts/python/netdev-times.py +++ b/tools/perf/scripts/python/netdev-times.py @@ -224,75 +224,75 @@ def trace_end():  			(len(rx_skb_list), of_count_rx_skb_list)  # called from perf, when it finds a correspoinding event -def irq__softirq_entry(name, context, cpu, sec, nsec, pid, comm, vec): +def irq__softirq_entry(name, context, cpu, sec, nsec, pid, comm, callchain, vec):  	if symbol_str("irq__softirq_entry", "vec", vec) != "NET_RX":  		return  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)  	all_event_list.append(event_info) -def irq__softirq_exit(name, context, cpu, sec, nsec, pid, comm, vec): +def irq__softirq_exit(name, context, cpu, sec, nsec, pid, comm, callchain, vec):  	if symbol_str("irq__softirq_entry", "vec", vec) != "NET_RX":  		return  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)  	all_event_list.append(event_info) -def irq__softirq_raise(name, context, cpu, sec, nsec, pid, comm, vec): +def irq__softirq_raise(name, context, cpu, sec, nsec, pid, comm, callchain, vec):  	if symbol_str("irq__softirq_entry", "vec", vec) != "NET_RX":  		return  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)  	all_event_list.append(event_info)  def irq__irq_handler_entry(name, context, cpu, sec, nsec, pid, comm, -			irq, irq_name): +			callchain, irq, irq_name):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			irq, irq_name)  	all_event_list.append(event_info) -def irq__irq_handler_exit(name, context, cpu, sec, nsec, pid, comm, irq, ret): +def irq__irq_handler_exit(name, context, cpu, sec, nsec, pid, comm, callchain, irq, ret):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, irq, ret)  	all_event_list.append(event_info) -def napi__napi_poll(name, context, cpu, sec, nsec, pid, comm, napi, dev_name): +def napi__napi_poll(name, context, cpu, sec, nsec, pid, comm, callchain, napi, dev_name):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			napi, dev_name)  	all_event_list.append(event_info) -def net__netif_receive_skb(name, context, cpu, sec, nsec, pid, comm, skbaddr, +def net__netif_receive_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr,  			skblen, dev_name):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			skbaddr, skblen, dev_name)  	all_event_list.append(event_info) -def net__netif_rx(name, context, cpu, sec, nsec, pid, comm, skbaddr, +def net__netif_rx(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr,  			skblen, dev_name):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			skbaddr, skblen, dev_name)  	all_event_list.append(event_info) -def net__net_dev_queue(name, context, cpu, sec, nsec, pid, comm, +def net__net_dev_queue(name, context, cpu, sec, nsec, pid, comm, callchain,  			skbaddr, skblen, dev_name):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			skbaddr, skblen, dev_name)  	all_event_list.append(event_info) -def net__net_dev_xmit(name, context, cpu, sec, nsec, pid, comm, +def net__net_dev_xmit(name, context, cpu, sec, nsec, pid, comm, callchain,  			skbaddr, skblen, rc, dev_name):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			skbaddr, skblen, rc ,dev_name)  	all_event_list.append(event_info) -def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, +def skb__kfree_skb(name, context, cpu, sec, nsec, pid, comm, callchain,  			skbaddr, protocol, location):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			skbaddr, protocol, location)  	all_event_list.append(event_info) -def skb__consume_skb(name, context, cpu, sec, nsec, pid, comm, skbaddr): +def skb__consume_skb(name, context, cpu, sec, nsec, pid, comm, callchain, skbaddr):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			skbaddr)  	all_event_list.append(event_info) -def skb__skb_copy_datagram_iovec(name, context, cpu, sec, nsec, pid, comm, +def skb__skb_copy_datagram_iovec(name, context, cpu, sec, nsec, pid, comm, callchain,  	skbaddr, skblen):  	event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,  			skbaddr, skblen) diff --git a/tools/perf/scripts/python/sched-migration.py b/tools/perf/scripts/python/sched-migration.py index 74d55ec08aed..de66cb3b72c9 100644 --- a/tools/perf/scripts/python/sched-migration.py +++ b/tools/perf/scripts/python/sched-migration.py @@ -369,93 +369,92 @@ def trace_end():  def sched__sched_stat_runtime(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, runtime, vruntime): +	common_callchain, comm, pid, runtime, vruntime):  	pass  def sched__sched_stat_iowait(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, delay): +	common_callchain, comm, pid, delay):  	pass  def sched__sched_stat_sleep(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, delay): +	common_callchain, comm, pid, delay):  	pass  def sched__sched_stat_wait(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, delay): +	common_callchain, comm, pid, delay):  	pass  def sched__sched_process_fork(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	parent_comm, parent_pid, child_comm, child_pid): +	common_callchain, parent_comm, parent_pid, child_comm, child_pid):  	pass  def sched__sched_process_wait(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, prio): +	common_callchain, comm, pid, prio):  	pass  def sched__sched_process_exit(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, prio): +	common_callchain, comm, pid, prio):  	pass  def sched__sched_process_free(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, prio): +	common_callchain, comm, pid, prio):  	pass  def sched__sched_migrate_task(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, prio, orig_cpu, +	common_callchain, comm, pid, prio, orig_cpu,  	dest_cpu):  	headers = EventHeaders(common_cpu, common_secs, common_nsecs, -				common_pid, common_comm) +				common_pid, common_comm, common_callchain)  	parser.migrate(headers, pid, prio, orig_cpu, dest_cpu)  def sched__sched_switch(event_name, context, common_cpu, -	common_secs, common_nsecs, common_pid, common_comm, +	common_secs, common_nsecs, common_pid, common_comm, common_callchain,  	prev_comm, prev_pid, prev_prio, prev_state,  	next_comm, next_pid, next_prio):  	headers = EventHeaders(common_cpu, common_secs, common_nsecs, -				common_pid, common_comm) +				common_pid, common_comm, common_callchain)  	parser.sched_switch(headers, prev_comm, prev_pid, prev_prio, prev_state,  			 next_comm, next_pid, next_prio)  def sched__sched_wakeup_new(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, prio, success, +	common_callchain, comm, pid, prio, success,  	target_cpu):  	headers = EventHeaders(common_cpu, common_secs, common_nsecs, -				common_pid, common_comm) +				common_pid, common_comm, common_callchain)  	parser.wake_up(headers, comm, pid, success, target_cpu, 1)  def sched__sched_wakeup(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, prio, success, +	common_callchain, comm, pid, prio, success,  	target_cpu):  	headers = EventHeaders(common_cpu, common_secs, common_nsecs, -				common_pid, common_comm) +				common_pid, common_comm, common_callchain)  	parser.wake_up(headers, comm, pid, success, target_cpu, 0)  def sched__sched_wait_task(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid, prio): +	common_callchain, comm, pid, prio):  	pass  def sched__sched_kthread_stop_ret(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	ret): +	common_callchain, ret):  	pass  def sched__sched_kthread_stop(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	comm, pid): +	common_callchain, comm, pid):  	pass -def trace_unhandled(event_name, context, common_cpu, common_secs, common_nsecs, -		common_pid, common_comm): +def trace_unhandled(event_name, context, event_fields_dict):  	pass diff --git a/tools/perf/scripts/python/sctop.py b/tools/perf/scripts/python/sctop.py index 42c267e292fa..61621b93affb 100644 --- a/tools/perf/scripts/python/sctop.py +++ b/tools/perf/scripts/python/sctop.py @@ -44,7 +44,7 @@ def trace_begin():  def raw_syscalls__sys_enter(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	id, args): +	common_callchain, id, args):  	if for_comm is not None:  		if common_comm != for_comm:  			return @@ -53,6 +53,11 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,  	except TypeError:  		syscalls[id] = 1 +def syscalls__sys_enter(event_name, context, common_cpu, +	common_secs, common_nsecs, common_pid, common_comm, +	id, args): +	raw_syscalls__sys_enter(**locals()) +  def print_syscall_totals(interval):  	while 1:  		clear_term() diff --git a/tools/perf/scripts/python/syscall-counts-by-pid.py b/tools/perf/scripts/python/syscall-counts-by-pid.py index c64d1c55d745..daf314cc5dd3 100644 --- a/tools/perf/scripts/python/syscall-counts-by-pid.py +++ b/tools/perf/scripts/python/syscall-counts-by-pid.py @@ -38,7 +38,7 @@ def trace_end():  def raw_syscalls__sys_enter(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	id, args): +	common_callchain, id, args):  	if (for_comm and common_comm != for_comm) or \  	   (for_pid  and common_pid  != for_pid ): @@ -48,6 +48,11 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,  	except TypeError:  		syscalls[common_comm][common_pid][id] = 1 +def syscalls__sys_enter(event_name, context, common_cpu, +	common_secs, common_nsecs, common_pid, common_comm, +	id, args): +	raw_syscalls__sys_enter(**locals()) +  def print_syscall_totals():      if for_comm is not None:  	    print "\nsyscall events for %s:\n\n" % (for_comm), diff --git a/tools/perf/scripts/python/syscall-counts.py b/tools/perf/scripts/python/syscall-counts.py index b435d3f188e8..e66a7730aeb5 100644 --- a/tools/perf/scripts/python/syscall-counts.py +++ b/tools/perf/scripts/python/syscall-counts.py @@ -35,7 +35,7 @@ def trace_end():  def raw_syscalls__sys_enter(event_name, context, common_cpu,  	common_secs, common_nsecs, common_pid, common_comm, -	id, args): +	common_callchain, id, args):  	if for_comm is not None:  		if common_comm != for_comm:  			return @@ -44,6 +44,11 @@ def raw_syscalls__sys_enter(event_name, context, common_cpu,  	except TypeError:  		syscalls[id] = 1 +def syscalls__sys_enter(event_name, context, common_cpu, +	common_secs, common_nsecs, common_pid, common_comm, +	id, args): +	raw_syscalls__sys_enter(**locals()) +  def print_syscall_totals():      if for_comm is not None:  	    print "\nsyscall events for %s:\n\n" % (for_comm), | 
