All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Gregg <brendan.d.gregg@gmail.com>
To: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Wang Nan <wangnan0@huawei.com>, Jiri Olsa <jolsa@kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	treeze.taeung@gmail.com,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	He Kuang <hekuang@huawei.com>,
	sukadev@linux.vnet.ibm.com, ananth@in.ibm.com,
	"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Hemant Kumar <hemant@linux.vnet.ibm.com>,
	Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH v3 2/2] perf/sdt: Directly record SDT events with 'perf record'
Date: Tue, 28 Feb 2017 21:04:33 -0800	[thread overview]
Message-ID: <CAE40pdeKQg-qv37k4QaCAs1ieuaqAXtm9RK1UiLSG7xh6EP0dw@mail.gmail.com> (raw)
In-Reply-To: <CAE40pdfWxQ45KBHMurPd5bAoprrqftzfPcHJhqm8cnndUax+gQ@mail.gmail.com>

On Tue, Feb 28, 2017 at 2:31 PM, Brendan Gregg
<brendan.d.gregg@gmail.com> wrote:
> G'Day Ravi,
>
[...]
> Now retrying perf:
>
> # ./perf record -e sdt_node:http__server__request -a
> ^C[ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.446 MB perf.data (3 samples) ]
> # ./perf script
>             node  7646 [002]   361.012364:
> sdt_node:http__server__request: (dc2e69)
>             node  7646 [002]   361.204718:
> sdt_node:http__server__request: (dc2e69)
>             node  7646 [002]   361.363043:
> sdt_node:http__server__request: (dc2e69)
>
> Now perf works.
>
> If I restart the node process, it goes back to the broken state.
>

Oh sorry, I forgot about that these Node.js probes are behind an
is-enabled semaphore.

$ readelf -n `which node`
[...]
  stapsdt              0x00000089    NT_STAPSDT (SystemTap probe descriptors)
    Provider: node
    Name: http__server__request
    Location: 0x0000000000dc2e69, Base: 0x000000000112e064, Semaphore:
0x0000000001470954
    Arguments: 8@%r14 8@%rax 8@-4344(%rbp) -4@-4348(%rbp)
8@-4304(%rbp) 8@-4312(%rbp) -4@-4352(%rbp)
# dd if=/proc/31695/mem bs=1 count=1 skip=$(( 0x0000000001470954 ))
2>/dev/null | xxd
00000000: 00                                       .
 # printf "\x1" | dd of=/proc/31695/mem bs=1 count=1 seek=$((
0x0000000001470954 )) 2>/dev/null
# dd if=/proc/31695/mem bs=1 count=1 skip=$(( 0x0000000001470954 ))
2>/dev/null | xxd
00000000: 01                                       .
# ./perf record -e sdt_node:http__server__request -a
Matching event(s) from uprobe_events:
   sdt_node:http__server__request  0x9c2e69@/usr/local/bin/node
Use 'perf probe -d <event>' to delete event(s).
^C[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.280 MB perf.data (3 samples) ]
# ./perf script
            node 31695 [003] 24947.168761:
sdt_node:http__server__request: (dc2e69)
            node 31695 [003] 24947.476143:
sdt_node:http__server__request: (dc2e69)
            node 31695 [003] 24947.679090:
sdt_node:http__server__request: (dc2e69)

So setting that to 1 made the probe work from perf. I guess this is
not a problem with this patch set, but rather a feature request for
the next one: is-enabled SDT support.

Were probe arguments supposed to work? I don't notice them in the perf
script output.

PS, if it's helpful, here's the commands to build node with these SDT probes:

$ sudo apt-get install systemtap-sdt-dev       # adds "dtrace", used
by node build
$ wget https://nodejs.org/dist/v4.4.1/node-v4.4.1.tar.gz
$ tar xvf node-v4.4.1.tar.gz
$ cd node-v4.4.1
$ ./configure --with-dtrace
$ make -j 8

Brendan

  reply	other threads:[~2017-03-01  7:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-24  7:43 [PATCH v3 0/2] perf/sdt: Directly record SDT events with 'perf record' Ravi Bangoria
2017-02-24  7:43 ` [PATCH v3 1/2] perf/sdt: Introduce util func is_sdt_event() Ravi Bangoria
2017-02-28  1:34   ` Masami Hiramatsu
2017-02-24  7:43 ` [PATCH v3 2/2] perf/sdt: Directly record SDT events with 'perf record' Ravi Bangoria
2017-02-28  5:45   ` Masami Hiramatsu
2017-02-28 10:56     ` Ravi Bangoria
2017-03-01  5:45       ` Masami Hiramatsu
2017-02-28 22:31   ` Brendan Gregg
2017-03-01  5:04     ` Brendan Gregg [this message]
2017-03-01  5:45       ` Ravi Bangoria
2017-02-27  4:54 ` [PATCH v3 0/2] " Ravi Bangoria

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=CAE40pdeKQg-qv37k4QaCAs1ieuaqAXtm9RK1UiLSG7xh6EP0dw@mail.gmail.com \
    --to=brendan.d.gregg@gmail.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth@in.ibm.com \
    --cc=hekuang@huawei.com \
    --cc=hemant@linux.vnet.ibm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=ravi.bangoria@linux.vnet.ibm.com \
    --cc=sukadev@linux.vnet.ibm.com \
    --cc=treeze.taeung@gmail.com \
    --cc=wangnan0@huawei.com \
    /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.