All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Zanussi <tom.zanussi@intel.com>
To: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Tracing events with GPIOs
Date: Sat, 28 Dec 2013 20:28:45 -0600	[thread overview]
Message-ID: <1388284125.3048.5.camel@empanada> (raw)
In-Reply-To: <1388163096.9098.10.camel@empanada>

On Fri, 2013-12-27 at 10:51 -0600, Tom Zanussi wrote:
> On Fri, 2013-12-27 at 15:54 +0100, Jean-Jacques Hiblot wrote:
> > 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 ?
> > 
> 
> No, it's just that kprobes hasn't been hooked up yet to actually invoke
> the triggers.
> 
> Let me look at doing that over the weekend...
> 

OK, I just posted a patch to add trigger invocations to kprobes, which
you can also find here:

http://git.yoctoproject.org/cgit/cgit.cgi/linux-yocto-contrib/log/?h=tzanussi/kprobes-event-triggers 

I tested it a bit here, but it could use more, so please let me know how
it goes..

Tom


> Tom
> 
> > 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
> > #              | |       |   ||||       |         |
> 



  reply	other threads:[~2013-12-29  2:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17  0:22 [PATCH] Tracing events with GPIOs Jean-Jacques Hiblot
2013-12-17  1:16 ` Masami Hiramatsu
2013-12-17 17:22   ` Jean-Jacques Hiblot
2013-12-17 18:29     ` Tom Zanussi
2013-12-17 19:05       ` Steven Rostedt
2013-12-17 20:45         ` Tom Zanussi
2013-12-27 14:54           ` Jean-Jacques Hiblot
2013-12-27 16:51             ` Tom Zanussi
2013-12-29  2:28               ` Tom Zanussi [this message]
2013-12-31 10:16     ` Jean-Jacques Hiblot
2013-12-19  6:52 ` Alexandre Courbot
2013-12-19 11:38   ` Jean-Jacques Hiblot
2013-12-20  7:33     ` Alexandre Courbot
2013-12-20  8:40       ` Jean-Jacques Hiblot
2014-01-03 10:50         ` Alexandre Courbot
2014-01-03 16:39           ` Jean-Jacques Hiblot
2014-01-02 12:43   ` Linus Walleij
2014-01-03 16:32     ` Jean-Jacques Hiblot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1388284125.3048.5.camel@empanada \
    --to=tom.zanussi@intel.com \
    --cc=jjhiblot@traphandler.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.