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: linux-kernel@vger.kernel.org, Namhyung Kim <namhyung@kernel.org>,
	Jiri Olsa <jolsa@redhat.com>, Ingo Molnar <mingo@redhat.com>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH -tip ] [BUGFIX] perf/probe: Fix perf probe to find correct variable DIE
Date: Tue, 3 Jun 2014 15:56:13 -0300	[thread overview]
Message-ID: <20140603185613.GE3696@kernel.org> (raw)
In-Reply-To: <20140529121930.30879.87092.stgit@ltc230.yrl.intra.hitachi.co.jp>

Em Thu, May 29, 2014 at 09:19:30PM +0900, Masami Hiramatsu escreveu:
> Fix perf probe to find correct variable DIE which has location or
> external instance by tracking down the lexical blocks.
> 
> Current die_find_variable() expects that the all variable DIEs
> which has DW_TAG_variable have a location. However, since recent
> dwarf information may have declaration variable DIEs at the
> entry of function (subprogram), die_find_variable() returns it.
> 
> To solve this problem, it must track down the DIE tree to find
> a DIE which has an actual location or a reference for external
> instance.

Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Before:

[root@zoo ~]# perf probe --del probe:vfs_getname
Removed event: probe:vfs_getname
[root@zoo ~]# perf probe 'vfs_getname=getname_flags:65 pathname=result->name:string'
Added new event:
Segmentation fault (core dumped)

After:

[root@zoo ~]# perf probe 'vfs_getname=getname_flags:65 pathname=result->name:string'
Added new event:
  probe:vfs_getname    (on getname_flags:65 with pathname=result->name:string)

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

	perf record -e probe:vfs_getname -aR sleep 1

[root@zoo ~]# perf record -e probe:vfs_getname -a sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.550 MB perf.data (~24022 samples) ]
[root@zoo ~]# perf script | head -5
            perf 27758 [001] 12022.551584: probe:vfs_getname: (ffffffff811c2e43) pathname="/home/acme/libexec/perf-core/sleep"
            perf 27758 [001] 12022.551616: probe:vfs_getname: (ffffffff811c2e43) pathname="/usr/lib64/ccache/sleep"
            perf 27758 [001] 12022.551628: probe:vfs_getname: (ffffffff811c2e43) pathname="/usr/local/sbin/sleep"
            perf 27758 [001] 12022.551636: probe:vfs_getname: (ffffffff811c2e43) pathname="/usr/local/bin/sleep"
            perf 27758 [001] 12022.551644: probe:vfs_getname: (ffffffff811c2e43) pathname="/sbin/sleep"
[root@zoo ~]#

- Arnaldo

  parent reply	other threads:[~2014-06-03 18:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-28 21:44 [BUG] perf probe segfaulting when asked for variable it doesn't find Arnaldo Carvalho de Melo
2014-05-29  9:56 ` Masami Hiramatsu
2014-05-29 10:52 ` [PATCH -tip/urgent ] [BUGFIX] perf/probe: Fix a segfault if " Masami Hiramatsu
2014-05-29 11:03   ` Masami Hiramatsu
2014-05-29 12:19   ` [PATCH -tip ] [BUGFIX] perf/probe: Fix perf probe to find correct variable DIE Masami Hiramatsu
2014-05-29 12:39     ` Masami Hiramatsu
2014-05-29 13:41       ` Jiri Olsa
2014-06-03 18:29         ` Ingo Molnar
2014-05-29 13:56       ` Arnaldo Carvalho de Melo
2014-06-03 20:38       ` Arnaldo Carvalho de Melo
2014-06-04  8:25         ` Masami Hiramatsu
2014-06-04 11:31           ` Jiri Olsa
2014-06-04 12:19             ` Masami Hiramatsu
2014-06-04 12:22               ` Jiri Olsa
2014-06-03 18:56     ` Arnaldo Carvalho de Melo [this message]
2014-06-05  8:15     ` [tip:perf/urgent] perf probe: " tip-bot for Masami Hiramatsu
2014-05-30  6:03   ` [PATCH -tip/urgent ] [BUGFIX] perf/probe: Fix a segfault if asked for variable it doesn't find Namhyung Kim
2014-05-30  6:32     ` Masami Hiramatsu
2014-06-05  8:15   ` [tip:perf/urgent] 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=20140603185613.GE3696@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.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