Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f5f5bcd authored by Joseph Schuchart's avatar Joseph Schuchart Committed by Arnaldo Carvalho de Melo
Browse files

perf script: Add callchain to generic and tracepoint events



This provides valuable information for tracing performance problems.

Since this change alters the interface for the python scripts, also
adjust the script generation and the provided scripts.

Signed-off-by: default avatarJoseph Schuchart <joseph.schuchart@tu-dresden.de>
Acked-by: default avatarThomas Ilsche <thomas.ilsche@tu-dresden.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Ilsche <thomas.ilsche@tu-dresden.de>
Link: http://lkml.kernel.org/r/53BE7E1B.10503@tu-dresden.de


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 05f832e3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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)
+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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]
+1 −1
Original line number Diff line number Diff line
@@ -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:
Loading