All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexei Starovoitov <ast@plumgrid.com>
Cc: David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: perf probe and structs
Date: Sun, 14 Jun 2015 21:18:13 +0900	[thread overview]
Message-ID: <557D7105.2000409@hitachi.com> (raw)
In-Reply-To: <20150612192716.GE6850@kernel.org>

On 2015/06/13 4:27, Arnaldo Carvalho de Melo wrote:
> Hi Masami,
> 
> 	I tried somethig with perf probe today, namely to ask for a
> variable that is a struct perf_event_attr to be collected after
> the perf_event_open syscall copies it from userspace, and got this
> message:
> 
> [root@zoo ~]# perf probe SYSC_perf_event_open:23 args
> Failed to find 'args' in this function.
>   Error: Failed to add events.
> [root@zoo ~]#

BTW, would you sure that the args exists at the given place?
I couldn't find it in kernel/events/core.c.

And also, could you make sure to run below command to clarify
the existed variables and its valid ranges?
 # perf probe -V --range SYSC_perf_event_open

For example, I got below outouts.

# perf probe -V SYSC_perf_event_open:23
Available variables at SYSC_perf_event_open:23
        @<SYSC_perf_event_open+502>
                int     cpu
                int     group_fd
                long unsigned int       flags
                pid_t   pid
                struct perf_event_attr  attr
# perf probe SYSC_perf_event_open:23 attr
perf_event_attr exceeds max-bitwidth. Cut down to 64 bits.
Added new event:
  probe:SYSC_perf_event_open (on SYSC_perf_event_open:23 with attr)

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

        perf record -e probe:SYSC_perf_event_open -aR sleep 1

Of course, this is still not enough, I must fix this as you suggested.

> 
> Ok, I guess it should be instead:
> 
> [root@zoo ~]# perf probe SYSC_perf_event_open:23 args
> The 'args' variable is a struct, this is not supported yet.
>   Error: Failed to add events.
> [root@zoo ~]#
> 
> :-)
> 
-- 
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering
Hitachi, Ltd., Research & Development Group
E-mail: masami.hiramatsu.pt@hitachi.com

      parent reply	other threads:[~2015-06-14 12:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 19:27 perf probe and structs Arnaldo Carvalho de Melo
2015-06-13  1:38 ` Masami Hiramatsu
2015-06-13  2:58 ` Alexei Starovoitov
2015-06-14 12:18 ` Masami Hiramatsu [this message]

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=557D7105.2000409@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=acme@kernel.org \
    --cc=ast@plumgrid.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --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 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.