All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] perf probe: Support debuginfod client
@ 2020-09-18  8:01 Masami Hiramatsu
  2020-09-18  8:01 ` [PATCH v2 1/2] perf probe: Fix to adjust symbol address with correct reloc_sym address Masami Hiramatsu
  2020-09-18  8:01 ` [PATCH v2 2/2] perf probe: Fall back to debuginfod query if debuginfo and source not found Masami Hiramatsu
  0 siblings, 2 replies; 3+ messages in thread
From: Masami Hiramatsu @ 2020-09-18  8:01 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Arnaldo Carvalho de Melo
  Cc: Frank Ch . Eigler, Aaron Merey, Daniel Thompson, Masami Hiramatsu,
	linux-kernel

Hi,

Here is the 2nd version of a series to enable debuginfod support on
perf probe command. This allows users to access debuginfo binary
from remote device. 

In this version I fixed a build error when libdebuginfod is not
installed ([2/2]).


Since the perf-probe heavily depends on the debuginfo, debuginfod
gives us many benefits on the perf probe command on remote
machine, especially for the embedded devices.

Here is an example (copied from [2/2])

1. at first you need to start debuginfod on the host machine.
   -F option scans local debuginfo binary. (You don't need to pass
   the source tree, but you must keep the source tree untouched)

  (host) $ cd PATH/TO/KBUILD/DIR/
  (host) $ debuginfod -F .
  ...

2. In the remote machine, you need to set DEBUGINFOD_URLS.
   debuginfod uses 8002 tcp port.

  (remote) # export DEBUGINFOD_URLS="http://$HOST_IP:8002/"

3. Then you can use the perf probe (it can refer the source code)

  (remote) # perf probe -L vfs_read
  <vfs_read@...>
        0  ssize_t vfs_read(struct file *file, char __user *buf, size_t count, loff_t *pos)
           {
        2         ssize_t ret;

                  if (!(file->f_mode & FMODE_READ))
                          return -EBADF;
        6         if (!(file->f_mode & FMODE_CAN_READ))
                          return -EINVAL;
        8         if (unlikely(!access_ok(buf, count)))
                          return -EFAULT;

       11         ret = rw_verify_area(READ, file, pos, count);
       12         if (ret)
                          return ret;
                  if (count > MAX_RW_COUNT)
  ...

  (remote) # perf probe -a "vfs_read count"
  Added new event:
    probe:vfs_read       (on vfs_read with count)

  (remote) # perf probe -l
    probe:vfs_read       (on vfs_read@ksrc/linux/fs/read_write.c with count)



Thank you,

---

Masami Hiramatsu (2):
      perf probe: Fix to adjust symbol address with correct reloc_sym address
      perf probe: Fall back to debuginfod query if debuginfo and source not found


 tools/perf/util/probe-event.c  |   66 ++++++++++++++++++++++++++++++++++++++--
 tools/perf/util/probe-finder.c |   61 ++++++++++++++++++++++++++++++++++---
 tools/perf/util/probe-finder.h |    7 +++-
 3 files changed, 123 insertions(+), 11 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-18  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-18  8:01 [PATCH v2 0/2] perf probe: Support debuginfod client Masami Hiramatsu
2020-09-18  8:01 ` [PATCH v2 1/2] perf probe: Fix to adjust symbol address with correct reloc_sym address Masami Hiramatsu
2020-09-18  8:01 ` [PATCH v2 2/2] perf probe: Fall back to debuginfod query if debuginfo and source not found Masami Hiramatsu

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.