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>,
	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: perf probe and structs
Date: Fri, 12 Jun 2015 16:27:16 -0300	[thread overview]
Message-ID: <20150612192716.GE6850@kernel.org> (raw)

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 ~]#

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 ~]#

:-)

That said, can't we just go ahead and collect sizeof(args) into the
buffer and let userspace cast the result to the right type, etc, i.e.
kinda like what is done now for a string.

Alexei, is this already possible with eBPF?

This is all in the context of:

  [root@zoo ~]# perf trace -e perf_event_open &
  [1] 20775
  [root@zoo ~]# perf stat -e cycles usleep 1
    7304.425 ( 0.519 ms): perf/20776 perf_event_open(attr_uptr: 0x222b220, pid: 20777, cpu: -1, group_fd: -1, flags: FD_CLOEXEC) = 3

   Performance counter stats for 'usleep 1':

         2,024,026      cycles                                                      

       0.005277428 seconds time elapsed

  [root@zoo ~]#

I want to decode that attr_uptr thing :-)

- Arnaldo

             reply	other threads:[~2015-06-12 19:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 19:27 Arnaldo Carvalho de Melo [this message]
2015-06-13  1:38 ` perf probe and structs Masami Hiramatsu
2015-06-13  2:58 ` Alexei Starovoitov
2015-06-14 12:18 ` 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=20150612192716.GE6850@kernel.org \
    --to=acme@kernel.org \
    --cc=ast@plumgrid.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox