linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: "Frank Ch . Eigler" <fche@redhat.com>,
	Aaron Merey <amerey@redhat.com>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] perf probe: Support debuginfod client
Date: Thu, 17 Sep 2020 01:44:33 +0900	[thread overview]
Message-ID: <160027467316.803747.10741549521899847231.stgit@devnote2> (raw)

Hi,

Here is a couple of patches to enable debuginfod support on
perf probe command. This allows users to access debuginfo binary
from remote device. 

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  |   60 +++++++++++++++++++++++++++++++++++++---
 tools/perf/util/probe-finder.c |   56 ++++++++++++++++++++++++++++++++++---
 tools/perf/util/probe-finder.h |    7 +++--
 3 files changed, 112 insertions(+), 11 deletions(-)

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

             reply	other threads:[~2020-09-16 20:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 16:44 Masami Hiramatsu [this message]
2020-09-16 16:44 ` [PATCH 1/2] perf probe: Fix to adjust symbol address with correct reloc_sym address Masami Hiramatsu
2020-09-16 16:44 ` [PATCH 2/2] perf probe: Fall back to debuginfod query if debuginfo and source not found Masami Hiramatsu
2020-09-18  0:40   ` Arnaldo Carvalho de Melo
2020-09-18  2:47     ` Masami Hiramatsu
2020-09-18 12:26       ` Arnaldo Carvalho de Melo
2020-09-16 18:13 ` [PATCH 0/2] perf probe: Support debuginfod client Frank Ch. Eigler
2020-09-16 18:52   ` Arnaldo Carvalho de Melo
2020-09-16 20:17     ` Frank Ch. Eigler
2020-09-17  3:07       ` Masami Hiramatsu
2020-09-17 13:54         ` Frank Ch. Eigler
2020-09-17 19:56       ` Arnaldo Carvalho de Melo

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=160027467316.803747.10741549521899847231.stgit@devnote2 \
    --to=mhiramat@kernel.org \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=amerey@redhat.com \
    --cc=daniel.thompson@linaro.org \
    --cc=fche@redhat.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).