Re: [PATCH] Tracing events with GPIOs

From: Jean-Jacques Hiblot
Date: Fri Dec 27 2013 - 10:03:34 EST


Hi Tom, Steven,

I'm currently doing some tests with the event triggers
(git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next).
At the moment I can't use event triggers with probes dynamically
created (with perf probe or via
/sys/kernel/debug/tracing/kprobe_events)
Predefined probes like
/sys/kernel/debug/tracing/events/kmem/kmalloc/trigger are working
fine.
Am I missing something ?

example:

----------------------------------------------------------------
with a predefined probe
----------------------------------------------------------------

prompt> echo 'stacktrace' >
/sys/kernel/debug/tracing/events/kmem/kmalloc/trigger
prompt> ls
prompt> cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 14/14 #P:1
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# ||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
ls-971 [000] .... 298.050000: <stack trace>
=> ftrace_raw_event_kmem_alloc
=> kmem_cache_alloc_trace
=> do_execve
=> SyS_execve
=> ret_fast_syscall
ls-971 [000] .... 298.050000: <stack trace>
=> ftrace_raw_event_kmem_alloc
=> kmem_cache_alloc_trace
=> load_elf_binary
[...]

----------------------------------------------------------------
with a dynamically defined probe
----------------------------------------------------------------

prompt> perf probe -a in_kmalloc=__kmalloc
prompt> echo 'stacktrace' >
/sys/kernel/debug/tracing/events/probe/in_kmalloc/trigger
prompt> perf record -e probe:in_kmalloc -aR sleep 10&
[... do something here ...]
prompt> perf report
[...]
# Samples: 24 of event 'probe:in_kmalloc'
# Event count (approx.): 24
#
# Overhead Command Shared Object Symbol
# ........ ....... ................. .............
#
50.00% ls [kernel.kallsyms] [k] __kmalloc
12.50% sleep [kernel.kallsyms] [k] __kmalloc
12.50% sh [kernel.kallsyms] [k] __kmalloc
12.50% perf [kernel.kallsyms] [k] __kmalloc
12.50% more [kernel.kallsyms] [k] __kmalloc
[...]

prompt> cat /sys/kernel/debug/tracing/trace
# tracer: nop
#
# entries-in-buffer/entries-written: 0/0 #P:1
#
# _-----=> irqs-off
# / _----=> need-resched
# | / _---=> hardirq/softirq
# || / _--=> preempt-depth
# random: nonblocking pool is initialized
||| / delay
# TASK-PID CPU# |||| TIMESTAMP FUNCTION
# | | | |||| | |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/