linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Olsa <jolsa@kernel.org>, David Ahern <dsahern@gmail.com>,
	Wang Nan <wangnan0@huawei.com>,
	Michael Petlan <mpetlan@redhat.com>,
	linux-perf-users@vger.kernel.org
Subject: Re: bogus values of variables in userspace probes
Date: Tue, 24 Nov 2015 11:54:25 -0300	[thread overview]
Message-ID: <20151124145424.GC18140@kernel.org> (raw)
In-Reply-To: <1448363902.24573.18.camel@redhat.com>

Em Tue, Nov 24, 2015 at 12:18:22PM +0100, Michael Petlan escreveu:
> Hi *,
> 
> I have been playing with perf-probe tool and I found out that some bogus
> values of a function argument are obtained by perf-record.
> 
> How to reproduce:
> 
> gcc -O0 -g -o dummy dummy.c
> perf probe -x ./dummy --add 'isprime a'
> perf record -e probe_dummy:isprime ./dummy
> perf script

Checking this here, but as non root I get:

[acme@zoo ~]$ gcc -O0 -g -o isprime isprime.c
[acme@zoo ~]$ perf probe -x ./isprime --add 'isprime a'
Mapping for the register number 4113 missing on this architecture.
Sorry, we don't support this variable location yet.
  Error: Failed to add events.
[acme@zoo ~]$ 

Masami, can you take a look at this?

More info:

[acme@zoo ~]$ cat /etc/fedora-release 
Fedora release 21 (Twenty One)
[acme@zoo ~]$ uname -a
Linux zoo 4.3.0+ #1 SMP Thu Nov 12 11:29:01 BRT 2015 x86_64 x86_64 x86_64 GNU/Linux

From readelf -wi, the isprime.c is the same as the one in Michael's original report.

Contents of the .debug_info section:

  Compilation Unit @ offset 0x0:
   Length:        0x12a (32-bit)
   Version:       4
   Abbrev Offset: 0x0
   Pointer Size:  8
 <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <c>   DW_AT_producer    : (indirect string, offset: 0x7a): GNU C 4.9.2 20150212 (Red Hat 4.9.2-6) -mtune=generic -march=x86-64 -g -O0       
    <10>   DW_AT_language    : 1        (ANSI C)
<SNIP>
 <1><87>: Abbrev Number: 5 (DW_TAG_subprogram)
    <88>   DW_AT_external    : 1        
    <88>   DW_AT_name        : (indirect string, offset: 0xe): isprime  
    <8c>   DW_AT_decl_file   : 1        
    <8d>   DW_AT_decl_line   : 4        
    <8e>   DW_AT_prototyped  : 1        
    <8e>   DW_AT_type        : <0x34>   
    <92>   DW_AT_low_pc      : 0x400536 
    <9a>   DW_AT_high_pc     : 0x4d     
    <a2>   DW_AT_frame_base  : 1 byte block: 9c         (DW_OP_call_frame_cfa)
    <a4>   DW_AT_GNU_all_call_sites: 1  
    <a4>   DW_AT_sibling     : <0xc1>   
 <2><a8>: Abbrev Number: 6 (DW_TAG_formal_parameter)
    <a9>   DW_AT_name        : a        
    <ab>   DW_AT_decl_file   : 1        
    <ac>   DW_AT_decl_line   : 4        
    <ad>   DW_AT_type        : <0x34>   
    <b1>   DW_AT_location    : 2 byte block: 91 5c      (DW_OP_fbreg: -36)
<SNIP>

  reply	other threads:[~2015-11-24 14:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 11:18 bogus values of variables in userspace probes Michael Petlan
2015-11-24 14:54 ` Arnaldo Carvalho de Melo [this message]
2015-11-24 16:13   ` Arnaldo Carvalho de Melo
2015-11-25  6:32     ` 平松雅巳 / HIRAMATU,MASAMI
2015-11-25 10:34   ` [BUGFIX PATCH perf/core ] perf probe: Fix to free temporal Dwarf_Frame correctly Masami Hiramatsu
2015-11-24 15:08 ` bogus values of variables in userspace probes Arnaldo Carvalho de Melo
2015-11-24 18:30   ` Michael Petlan
2015-11-24 19:16     ` Arnaldo Carvalho de Melo
2015-11-25 13:25       ` Michael Petlan
2015-11-25 13:33         ` Jiri Olsa
2015-11-25 14:43           ` perftool-testsuite was: " Arnaldo Carvalho de Melo
2015-11-25 15:58             ` Michael Petlan
2015-11-25 19:27               ` Arnaldo Carvalho de Melo
2015-11-25 15:07         ` 平松雅巳 / HIRAMATU,MASAMI
2015-11-25  1:03     ` 平松雅巳 / HIRAMATU,MASAMI
2015-11-25  2:24       ` Arnaldo Carvalho de Melo

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=20151124145424.GC18140@kernel.org \
    --to=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mpetlan@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).