public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Ahern <dsahern@gmail.com>,
	Brendan Gregg <brendan.d.gregg@gmail.com>
Subject: Re: [BUGFIX PATCH perf/core ] perf-probe: Fix to show lines of sys_ functions correctly
Date: Wed, 12 Aug 2015 10:40:42 -0300	[thread overview]
Message-ID: <20150812134042.GE31059@kernel.org> (raw)
In-Reply-To: <20150812132355.GD31059@kernel.org>

Em Wed, Aug 12, 2015 at 10:23:55AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Wed, Aug 12, 2015 at 10:24:07AM +0900, Masami Hiramatsu escreveu:
> > "perf probe --lines sys_poll" shows only the first line of
> > sys_poll, because the SYSCALL_DEFINE macro
> > ----
 
> Thanks! Just try prefixing those ---- lines one space so that git-am
> works on your messages :-)
 
> Now to build and test, will report here the results.

Ok, now -L works:

  [root@zoo ~]# perf probe -L sys_select
  <SyS_select@/home/git/linux/fs/select.c:0>
      0  SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp,
                        fd_set __user *, exp, struct timeval __user *, tvp)
         {
      3         struct timespec end_time, *to = NULL;
                struct timeval tv;
                int ret;
         
      7         if (tvp) {
      8                 if (copy_from_user(&tv, tvp, sizeof(tv)))
      9                         return -EFAULT;
         
     11                 to = &end_time;
     12                 if (poll_select_set_timeout(to,
                                        tv.tv_sec + (tv.tv_usec / USEC_PER_SEC),
     14                                 (tv.tv_usec % USEC_PER_SEC) * NSEC_PER_USEC))
     15                         return -EINVAL;
                }
         
     18         ret = core_sys_select(n, inp, outp, exp, to);
     19         ret = poll_select_copy_remaining(&end_time, tvp, 1, ret);
         
     21         return ret;
         }
         
         static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp,

But then adding a probe doesn't work on sys_select, even with -L stating that I
can add a probe at that line, maybe the code you added to make -L work needs to
be shared with the other operations in 'perf probe'?

  [root@zoo ~]# 
  [root@zoo ~]# perf probe 'get_timeval=sys_select:11 tv_sec=tv.tv_sec tv_usec=tv.tv_usec'
  Probe point 'sys_select:11' not found.
    Error: Failed to add events.
  [root@zoo ~]#

  [root@zoo ~]# perf probe -V sys_select
  Available variables at sys_select
        @<SyS_select+0>
                long int        exp
                long int        inp
                long int        n
                long int        outp
                long int        tvp
  [root@zoo ~]# perf probe -V sys_select:11
  Failed to find the address of sys_select:11
    Error: Failed to show vars.
  [root@zoo ~]# 

While this works:

  [root@zoo ~]# perf probe 'vfs_getname=getname_flags:72 pathname=filename:string'
  Added new event:
    probe:vfs_getname    (on getname_flags:72 with pathname=filename:string)

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

	perf record -e probe:vfs_getname -aR sleep 1

- Arnaldo

  reply	other threads:[~2015-08-12 13:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-11 14:18 perf probe -L sys_select or sys_poll Arnaldo Carvalho de Melo
2015-08-11 22:59 ` 平松雅巳 / HIRAMATU,MASAMI
2015-08-12  0:49 ` 平松雅巳 / HIRAMATU,MASAMI
2015-08-12  1:24   ` [BUGFIX PATCH perf/core ] perf-probe: Fix to show lines of sys_ functions correctly Masami Hiramatsu
2015-08-12 13:23     ` Arnaldo Carvalho de Melo
2015-08-12 13:40       ` Arnaldo Carvalho de Melo [this message]
2015-08-12 21:37         ` 平松雅巳 / HIRAMATU,MASAMI
2015-08-13  8:06     ` [tip:perf/core] perf probe: " tip-bot for Masami Hiramatsu

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=20150812134042.GE31059@kernel.org \
    --to=acme@kernel.org \
    --cc=brendan.d.gregg@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=namhyung@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