All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: [PATCH v4 2/3] perf: kretprobes: offset from reloc_sym if kernel supports it
Date: Mon, 6 Mar 2017 20:34:10 +0530	[thread overview]
Message-ID: <20170306150410.GA7467@naverao1-tp.localdomain> (raw)
In-Reply-To: <20170304094911.5f96a10a9f075b6f16fe90d3@kernel.org>

On 2017/03/04 09:49AM, Masami Hiramatsu wrote:
> On Thu,  2 Mar 2017 23:25:06 +0530
> "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> wrote:
> 
> > We indicate support for accepting sym+offset with kretprobes through a
> > line in ftrace README. Parse the same to identify support and choose the
> > appropriate format for kprobe_events.
> 
> Could you give us an example of this change here? :)
> for example, comment of commit 613f050d68a8 .
> 
> I think the code is OK, but we need actual example of result.

Sure :)
As an example, without this perf patch, but with the ftrace changes:

  naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/tracing/README | grep kretprobe
  place (kretprobe): [<module>:]<symbol>[+<offset>]|<memaddr>
  naveen@ubuntu:~/linux/tools/perf$ 
  naveen@ubuntu:~/linux/tools/perf$ sudo ./perf probe -v do_open%return
  probe-definition(0): do_open%return 
  symbol:do_open file:(null) line:0 offset:0 return:1 lazy:(null)
  0 arguments
  Looking at the vmlinux_path (8 entries long)
  Using /boot/vmlinux for symbols
  Open Debuginfo file: /boot/vmlinux
  Try to find probe point from debuginfo.
  Matched function: do_open [2d0c7d8]
  Probe point found: do_open+0
  Matched function: do_open [35d76b5]
  found inline addr: 0xc0000000004ba984
  Failed to find "do_open%return",
   because do_open is an inlined function and has no return point.
  An error occurred in debuginfo analysis (-22).
  Trying to use symbols.
  Opening /sys/kernel/debug/tracing//kprobe_events write=1
  Writing event: r:probe/do_open do_open+0
  Writing event: r:probe/do_open_1 do_open+0
  Added new events:
    probe:do_open        (on do_open%return)
    probe:do_open_1      (on do_open%return)

  You can now use it in all perf tools, such as:

	  perf record -e probe:do_open_1 -aR sleep 1

  naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/kprobes/list
  c000000000041370  k  kretprobe_trampoline+0x0    [OPTIMIZED]
  c0000000004433d0  r  do_open+0x0    [DISABLED]
  c0000000004433d0  r  do_open+0x0    [DISABLED]

And after this patch (and the subsequent powerpc patch):

  naveen@ubuntu:~/linux/tools/perf$ sudo ./perf probe -v do_open%return
  probe-definition(0): do_open%return 
  symbol:do_open file:(null) line:0 offset:0 return:1 lazy:(null)
  0 arguments
  Looking at the vmlinux_path (8 entries long)
  Using /boot/vmlinux for symbols
  Open Debuginfo file: /boot/vmlinux
  Try to find probe point from debuginfo.
  Matched function: do_open [2d0c7d8]
  Probe point found: do_open+0
  Matched function: do_open [35d76b5]
  found inline addr: 0xc0000000004ba984
  Failed to find "do_open%return",
   because do_open is an inlined function and has no return point.
  An error occurred in debuginfo analysis (-22).
  Trying to use symbols.
  Opening /sys/kernel/debug/tracing//README write=0
  Opening /sys/kernel/debug/tracing//kprobe_events write=1
  Writing event: r:probe/do_open _text+4469712
  Writing event: r:probe/do_open_1 _text+4956248
  Added new events:
    probe:do_open        (on do_open%return)
    probe:do_open_1      (on do_open%return)

  You can now use it in all perf tools, such as:

	  perf record -e probe:do_open_1 -aR sleep 1

  naveen@ubuntu:~/linux/tools/perf$ sudo cat /sys/kernel/debug/kprobes/list
  c000000000041370  k  kretprobe_trampoline+0x0    [OPTIMIZED]
  c0000000004433d0  r  do_open+0x0    [DISABLED]
  c0000000004ba058  r  do_open+0x8    [DISABLED]


Thanks,
- Naveen

  parent reply	other threads:[~2017-03-06 15:05 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-22 13:53 [PATCH v2 0/5] kretprobe fixes Naveen N. Rao
2017-02-22 13:53 ` [PATCH v2 1/5] kretprobes: ensure probe location is at function entry Naveen N. Rao
2017-03-07  8:13   ` [tip:perf/core] kretprobes: Ensure " tip-bot for Naveen N. Rao
2017-02-22 13:53 ` [PATCH v2 2/5] powerpc: kretprobes: override default function entry offset Naveen N. Rao
2017-02-24 19:57   ` Arnaldo Carvalho de Melo
2017-02-27 12:56     ` Michael Ellerman
2017-02-25  2:45   ` Ananth N Mavinakayanahalli
2017-02-22 13:53 ` [PATCH v2 3/5] trace/kprobes: allow return probes with offsets and absolute addresses Naveen N. Rao
2017-02-27 16:32   ` Steven Rostedt
2017-02-27 16:52     ` [PATCH v2 3.5/5] trace/kprobes: Add back warning about offset in return probes Steven Rostedt (VMware)
2017-02-28  0:01       ` Masami Hiramatsu
2017-03-01 15:16       ` Naveen N. Rao
2017-03-07  8:20       ` [tip:perf/core] " tip-bot for Steven Rostedt (VMware)
2017-03-07  8:15   ` [tip:perf/core] trace/kprobes: Allow return probes with offsets and absolute addresses tip-bot for Naveen N. Rao
2017-02-22 13:53 ` [PATCH v2 4/5] perf: kretprobes: offset from reloc_sym if kernel supports it Naveen N. Rao
2017-02-23  9:10   ` Masami Hiramatsu
2017-02-23 11:37     ` [PATCH v3 1/2] perf: probe: generalize probe event file open routine Naveen N. Rao
2017-02-24 16:46       ` Masami Hiramatsu
2017-02-24 20:07         ` Arnaldo Carvalho de Melo
2017-03-01 15:12         ` Naveen N. Rao
2017-03-07  8:17       ` [tip:perf/core] perf probe: Generalize " tip-bot for Naveen N. Rao
2017-02-23 11:37     ` [PATCH v3 2/2] perf: kretprobes: offset from reloc_sym if kernel supports it Naveen N. Rao
2017-02-24 17:12       ` Masami Hiramatsu
2017-03-01 15:11         ` Naveen N. Rao
2017-02-23 19:16     ` [PATCH v2 4/5] " Naveen N. Rao
2017-02-24 17:29       ` Masami Hiramatsu
2017-02-24 20:11         ` Arnaldo Carvalho de Melo
2017-02-24 23:55           ` Masami Hiramatsu
2017-03-01 15:14             ` Naveen N. Rao
2017-03-02 17:55           ` Naveen N. Rao
2017-03-02 19:06             ` Arnaldo Carvalho de Melo
2017-03-02 17:55           ` [PATCH v4 1/3] perf: probe: factor out the ftrace README scanning Naveen N. Rao
2017-03-04  0:09             ` Masami Hiramatsu
2017-03-07 20:45             ` Steven Rostedt
2017-03-02 17:55           ` [PATCH v4 2/3] perf: kretprobes: offset from reloc_sym if kernel supports it Naveen N. Rao
2017-03-04  0:49             ` Masami Hiramatsu
2017-03-04  2:35               ` Masami Hiramatsu
2017-03-04  2:38                 ` Masami Hiramatsu
2017-03-04  4:34                 ` Masami Hiramatsu
2017-03-06 16:20                   ` Naveen N. Rao
2017-03-06 17:49                   ` Naveen N. Rao
2017-03-06 21:06                     ` Masami Hiramatsu
2017-03-07 10:47                       ` [PATCH v4 2/3] perf: kretprobes: offset from reloc_sym if kernel Naveen N. Rao
2017-03-07 10:47                       ` [RESEND PATCH 1/6] trace/kprobes: fix check for kretprobe offset within function entry Naveen N. Rao
2017-03-07 20:47                         ` Steven Rostedt
2017-03-08  8:01                           ` Naveen N. Rao
2017-03-07 10:47                       ` [RESEND PATCH 2/6] powerpc: kretprobes: override default function entry offset Naveen N. Rao
2017-03-07 10:47                       ` [RESEND PATCH 3/6] perf: probe: factor out the ftrace README scanning Naveen N. Rao
2017-03-07 10:47                       ` [RESEND PATCH 4/6] perf: kretprobes: offset from reloc_sym if kernel supports it Naveen N. Rao
2017-03-07 10:47                       ` [PATCH 5/6] perf: probes: move ftrace README parsing logic into trace-event-parse.c Naveen N. Rao
2017-03-07 14:03                         ` Masami Hiramatsu
2017-03-07 14:29                           ` Naveen N. Rao
2017-03-07 15:51                         ` Masami Hiramatsu
2017-03-07 16:31                           ` Naveen N. Rao
2017-03-07 10:47                       ` [RESEND PATCH 6/6] perf: powerpc: choose local entry point with kretprobes Naveen N. Rao
2017-03-07 16:49                         ` [PATCH v2 " Naveen N. Rao
2017-03-06 15:04               ` Naveen N. Rao [this message]
2017-03-06 21:14                 ` [PATCH v4 2/3] perf: kretprobes: offset from reloc_sym if kernel supports it Masami Hiramatsu
2017-03-02 17:55           ` [PATCH v4 3/3] perf: powerpc: choose local entry point with kretprobes Naveen N. Rao
2017-03-04  0:50             ` Masami Hiramatsu
2017-02-22 13:53 ` [PATCH v2 5/5] " Naveen N. Rao

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=20170306150410.GA7467@naverao1-tp.localdomain \
    --to=naveen.n.rao@linux.vnet.ibm.com \
    --cc=acme@kernel.org \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --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.