linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-perf-user@vger.kernel.org,
	david lerner <dlernerdroid@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	yrl.pp-manager.tt@hitachi.com
Subject: Re: Re: [PATCH perf/core 1/2] perf probe: Do not access kallsyms when analyzing user binaries
Date: Thu, 18 Sep 2014 09:36:06 +0900	[thread overview]
Message-ID: <541A28F6.70702@hitachi.com> (raw)
In-Reply-To: <20140917205934.GD2770@kernel.org>

(2014/09/18 5:59), Arnaldo Carvalho de Melo wrote:
> Em Wed, Sep 17, 2014 at 08:40:54AM +0000, Masami Hiramatsu escreveu:
>> Do not access kallsyms to show available variables and
>> show source lines in user binaries.
>> This behavior always requires the root privilege when
>> sysctl sets kernel.kptr_restrict=1, but we don't need
>> it just for analyzing user binaries.
> 
>> +++ b/tools/perf/util/probe-event.c
>> @@ -697,11 +697,11 @@ end:
>>  	return ret;
>>  }
>>  
>> -int show_line_range(struct line_range *lr, const char *module)
>> +int show_line_range(struct line_range *lr, const char *module, bool user)
>>  {
> 
> make -C tools/perf build-test fails for the static build on:
> 
> acme@linux-goap:~/git/linux> cat /etc/os-release
> NAME=openSUSE
> VERSION="12.3 (Dartmouth)"
> VERSION_ID="12.3"
> PRETTY_NAME="openSUSE 12.3 (Dartmouth) (i586)"
> ID=opensuse
> ANSI_COLOR="0;32"
> CPE_NAME="cpe:/o:opensuse:opensuse:12.3"
> acme@linux-goap:~/git/linux> 
> 
> util/probe-event.c:824:5: error: conflicting types for 'show_line_range'
> In file included from util/probe-event.c:45:0:
> util/probe-event.h:131:12: note: previous declaration of
> 'show_line_range' was here
> make[3]: *** [util/probe-event.o] Error 1
> make[2]: *** [all] Error 2
>   test: test -x ./perf
> make[1]: *** [make_static] Error 1
> make: *** [build-test] Error 2
> make: Leaving directory `/home/acme/git/linux/tools/perf'
> acme@linux-goap:~/git/linux>
> 
> And on:
> 
> acme@ubuntu13:~/git/linux$ cat /etc/os-release 
> NAME="Ubuntu"
> VERSION="13.10, Saucy Salamander"
> ID=ubuntu
> ID_LIKE=debian
> PRETTY_NAME="Ubuntu 13.10"
> VERSION_ID="13.10"
> HOME_URL="http://www.ubuntu.com/"
> SUPPORT_URL="http://help.ubuntu.com/"
> BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
> acme@ubuntu13:~/git/linux$ 
> 
>   CC       util/probe-event.o
> util/probe-event.c:824:5: error: conflicting types for ‘show_line_range’
>  int show_line_range(struct line_range *lr __maybe_unused,
>      ^
> In file included from util/probe-event.c:45:0:
> util/probe-event.h:131:12: note: previous declaration of
> ‘show_line_range’ was here
>  extern int show_line_range(struct line_range *lr, const char *module,
>             ^
> make[3]: *** [util/probe-event.o] Error 1
> make[3]: *** Waiting for unfinished jobs....
> make[2]: *** [all] Error 2
>   test: test -x ./perf
> make[1]: *** [make_static] Error 1
> make: *** [build-test] Error 2
> make: Leaving directory `/home/acme/git/linux/tools/perf'
> 
> ---------------------------------------------------------------------
> 
> Probably because I had not installed needed DWARF support libraries and
> you forgot to update this:
> 
> int show_line_range(struct line_range *lr __maybe_unused,
>                     const char *module __maybe_unused)
> {
>         pr_warning("Debuginfo-analysis is not supported.\n");
>         return -ENOSYS;
> }

Oops! Right, I forgot that. Maybe I should move this to the header file
so that I can easily avoid this kind of mistake...

> Fixing it up by adding the missing 'bool user'.

Thank you!



-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



  reply	other threads:[~2014-09-18  0:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-17  8:40 [PATCH perf/core 1/2] perf probe: Do not access kallsyms when analyzing user binaries Masami Hiramatsu
2014-09-17  8:41 ` [PATCH perf/core 2/2] perf probe: Do not use dwfl_module_addrsym if dwarf_diename finds symbol name Masami Hiramatsu
2014-09-19  5:23   ` [tip:perf/core] " tip-bot for Masami Hiramatsu
2014-09-17 20:59 ` [PATCH perf/core 1/2] perf probe: Do not access kallsyms when analyzing user binaries Arnaldo Carvalho de Melo
2014-09-18  0:36   ` Masami Hiramatsu [this message]
2014-09-19  5:22 ` [tip:perf/core] " 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=541A28F6.70702@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=acme@kernel.org \
    --cc=dlernerdroid@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-user@vger.kernel.org \
    --cc=yrl.pp-manager.tt@hitachi.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).