All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf report: Find lib path correctly for gtk option
@ 2016-04-28 13:00 Kyeongmin Cho
  2016-04-28 13:00 ` [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param Kyeongmin Cho
  2016-04-28 14:07 ` [PATCH 1/2] perf report: Find lib path correctly for gtk option Jiri Olsa
  0 siblings, 2 replies; 9+ messages in thread
From: Kyeongmin Cho @ 2016-04-28 13:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin
  Cc: linux-kernel, Jiri Olsa, Wang Nan, Adrian Hunter, Namhyung Kim,
	Kyeongmin Cho

When "perf report --gtk", it cannot find libperf-gtk.so.
This patch apply correct path of LIBDIR to setup_gtk_browser().

Signed-off-by: Kyeongmin Cho <korea.drzix@gmail.com>
---
 tools/perf/config/Makefile | 2 +-
 tools/perf/ui/Build        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index f7d7f5a..d96b185 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -794,7 +794,7 @@ $(call detected_var,prefix_SQ)
 $(call detected_var,perfexecdir_SQ)
 $(call detected_var,tipdir_SQ)
 $(call detected_var,srcdir_SQ)
-$(call detected_var,LIBDIR)
+$(call detected_var,libdir)
 $(call detected_var,GTK_CFLAGS)
 $(call detected_var,PERL_EMBED_CCOPTS)
 $(call detected_var,PYTHON_EMBED_CCOPTS)
diff --git a/tools/perf/ui/Build b/tools/perf/ui/Build
index 0a73538..cd3f92f0 100644
--- a/tools/perf/ui/Build
+++ b/tools/perf/ui/Build
@@ -5,7 +5,7 @@ libperf-y += util.o
 libperf-y += hist.o
 libperf-y += stdio/hist.o
 
-CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))"
+CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(libdir))"
 
 libperf-$(CONFIG_SLANG) += browser.o
 libperf-$(CONFIG_SLANG) += browsers/
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param
  2016-04-28 13:00 [PATCH 1/2] perf report: Find lib path correctly for gtk option Kyeongmin Cho
@ 2016-04-28 13:00 ` Kyeongmin Cho
  2016-04-28 14:12   ` Jiri Olsa
  2016-04-28 14:07 ` [PATCH 1/2] perf report: Find lib path correctly for gtk option Jiri Olsa
  1 sibling, 1 reply; 9+ messages in thread
From: Kyeongmin Cho @ 2016-04-28 13:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin
  Cc: linux-kernel, Jiri Olsa, Wang Nan, Adrian Hunter, Namhyung Kim,
	Kyeongmin Cho

As libperf-gtk.so cannot find out undefined symbol 'callchain_param',
'-rdynamic' option is needed to add the symbol to the dynamic symbol
table.

Signed-off-by: Kyeongmin Cho <korea.drzix@gmail.com>
---
 tools/perf/Makefile.perf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 000ea21..a3f8b39 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -344,7 +344,7 @@ $(PERF_IN): prepare FORCE
 	$(Q)$(MAKE) $(build)=perf
 
 $(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST)
-	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
+	$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -rdynamic $(LIBTRACEEVENT_DYNAMIC_LIST_LDFLAGS) \
 		$(PERF_IN) $(LIBS) -o $@
 
 $(GTK_IN): fixdep FORCE
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] perf report: Find lib path correctly for gtk option
  2016-04-28 13:00 [PATCH 1/2] perf report: Find lib path correctly for gtk option Kyeongmin Cho
  2016-04-28 13:00 ` [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param Kyeongmin Cho
@ 2016-04-28 14:07 ` Jiri Olsa
  2016-04-28 14:35   ` drzix
  1 sibling, 1 reply; 9+ messages in thread
From: Jiri Olsa @ 2016-04-28 14:07 UTC (permalink / raw)
  To: Kyeongmin Cho
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, linux-kernel, Wang Nan, Adrian Hunter,
	Namhyung Kim

On Thu, Apr 28, 2016 at 10:00:00PM +0900, Kyeongmin Cho wrote:
> When "perf report --gtk", it cannot find libperf-gtk.so.
> This patch apply correct path of LIBDIR to setup_gtk_browser().

hi,
could you please add to changelog some more info
about why the case change is actualy needed?

thanks,
jirka

> 
> Signed-off-by: Kyeongmin Cho <korea.drzix@gmail.com>
> ---
>  tools/perf/config/Makefile | 2 +-
>  tools/perf/ui/Build        | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> index f7d7f5a..d96b185 100644
> --- a/tools/perf/config/Makefile
> +++ b/tools/perf/config/Makefile
> @@ -794,7 +794,7 @@ $(call detected_var,prefix_SQ)
>  $(call detected_var,perfexecdir_SQ)
>  $(call detected_var,tipdir_SQ)
>  $(call detected_var,srcdir_SQ)
> -$(call detected_var,LIBDIR)
> +$(call detected_var,libdir)
>  $(call detected_var,GTK_CFLAGS)
>  $(call detected_var,PERL_EMBED_CCOPTS)
>  $(call detected_var,PYTHON_EMBED_CCOPTS)
> diff --git a/tools/perf/ui/Build b/tools/perf/ui/Build
> index 0a73538..cd3f92f0 100644
> --- a/tools/perf/ui/Build
> +++ b/tools/perf/ui/Build
> @@ -5,7 +5,7 @@ libperf-y += util.o
>  libperf-y += hist.o
>  libperf-y += stdio/hist.o
>  
> -CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))"
> +CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(libdir))"
>  
>  libperf-$(CONFIG_SLANG) += browser.o
>  libperf-$(CONFIG_SLANG) += browsers/
> -- 
> 2.5.5
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param
  2016-04-28 13:00 ` [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param Kyeongmin Cho
@ 2016-04-28 14:12   ` Jiri Olsa
  2016-04-28 14:49     ` Kyeongmin Cho
  2016-04-28 15:26     ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 9+ messages in thread
From: Jiri Olsa @ 2016-04-28 14:12 UTC (permalink / raw)
  To: Kyeongmin Cho
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, linux-kernel, Wang Nan, Adrian Hunter,
	Namhyung Kim

On Thu, Apr 28, 2016 at 10:00:01PM +0900, Kyeongmin Cho wrote:
> As libperf-gtk.so cannot find out undefined symbol 'callchain_param',
> '-rdynamic' option is needed to add the symbol to the dynamic symbol
> table.

hi,
following command seems to work for me:
  $ perf report --gtk

could you please specify what's failing for you?

thanks,
jirka

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] perf report: Find lib path correctly for gtk option
  2016-04-28 14:07 ` [PATCH 1/2] perf report: Find lib path correctly for gtk option Jiri Olsa
@ 2016-04-28 14:35   ` drzix
  2016-04-29 11:50     ` Namhyung Kim
  0 siblings, 1 reply; 9+ messages in thread
From: drzix @ 2016-04-28 14:35 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, linux-kernel, Wang Nan, Adrian Hunter,
	Namhyung Kim

Hi,

$ ./perf report --gtk
GTK browser requested but could not find libperf-gtk.so


When I print buf in setup_gtk_brower() in ui/setup.c:

$ ./perf report --gtk
/libperf-gtk.so
GTK browser requested but could not find libperf-gtk.so

Besides, LIBDIR path is just ""

Does it mean that LIBDIR path could not take the prefix contained to
Makefile.perf?

2016-04-28 23:07 GMT+09:00 Jiri Olsa <jolsa@redhat.com>:
> On Thu, Apr 28, 2016 at 10:00:00PM +0900, Kyeongmin Cho wrote:
>> When "perf report --gtk", it cannot find libperf-gtk.so.
>> This patch apply correct path of LIBDIR to setup_gtk_browser().
>
> hi,
> could you please add to changelog some more info
> about why the case change is actualy needed?
>
> thanks,
> jirka
>
>>
>> Signed-off-by: Kyeongmin Cho <korea.drzix@gmail.com>
>> ---
>>  tools/perf/config/Makefile | 2 +-
>>  tools/perf/ui/Build        | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
>> index f7d7f5a..d96b185 100644
>> --- a/tools/perf/config/Makefile
>> +++ b/tools/perf/config/Makefile
>> @@ -794,7 +794,7 @@ $(call detected_var,prefix_SQ)
>>  $(call detected_var,perfexecdir_SQ)
>>  $(call detected_var,tipdir_SQ)
>>  $(call detected_var,srcdir_SQ)
>> -$(call detected_var,LIBDIR)
>> +$(call detected_var,libdir)
>>  $(call detected_var,GTK_CFLAGS)
>>  $(call detected_var,PERL_EMBED_CCOPTS)
>>  $(call detected_var,PYTHON_EMBED_CCOPTS)
>> diff --git a/tools/perf/ui/Build b/tools/perf/ui/Build
>> index 0a73538..cd3f92f0 100644
>> --- a/tools/perf/ui/Build
>> +++ b/tools/perf/ui/Build
>> @@ -5,7 +5,7 @@ libperf-y += util.o
>>  libperf-y += hist.o
>>  libperf-y += stdio/hist.o
>>
>> -CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))"
>> +CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(libdir))"
>>
>>  libperf-$(CONFIG_SLANG) += browser.o
>>  libperf-$(CONFIG_SLANG) += browsers/
>> --
>> 2.5.5
>>



-- 
Thanks,
Dr.Zix
" http://cin.fail "

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param
  2016-04-28 14:12   ` Jiri Olsa
@ 2016-04-28 14:49     ` Kyeongmin Cho
  2016-05-01 15:44       ` Jiri Olsa
  2016-04-28 15:26     ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 9+ messages in thread
From: Kyeongmin Cho @ 2016-04-28 14:49 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, linux-kernel, Wang Nan, Adrian Hunter,
	Namhyung Kim

Hi,

Althogh applying my previous patch, it still prints

$ ./perf report --gtk
GTK browser requested but could not find libperf-gtk.so

When printing dlerror() in setup_gtk_browser(),

$ ./perf report --gtk
/home/drzix/lib64/libperf-gtk.so: undefined symbol: callchain_param
GTK browser requested but could not find libperf-gtk.so

After applying this patch, compiling rdynamically to make
libperf-gtk.so find out the symbol, it works.

2016-04-28 23:12 GMT+09:00 Jiri Olsa <jolsa@redhat.com>:
> On Thu, Apr 28, 2016 at 10:00:01PM +0900, Kyeongmin Cho wrote:
>> As libperf-gtk.so cannot find out undefined symbol 'callchain_param',
>> '-rdynamic' option is needed to add the symbol to the dynamic symbol
>> table.
>
> hi,
> following command seems to work for me:
>   $ perf report --gtk
>
> could you please specify what's failing for you?
>
> thanks,
> jirka



-- 
Thanks,
Dr.Zix
" http://cin.fail "

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param
  2016-04-28 14:12   ` Jiri Olsa
  2016-04-28 14:49     ` Kyeongmin Cho
@ 2016-04-28 15:26     ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 9+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-04-28 15:26 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Kyeongmin Cho, Peter Zijlstra, Ingo Molnar, Alexander Shishkin,
	linux-kernel, Wang Nan, Adrian Hunter, Namhyung Kim

Em Thu, Apr 28, 2016 at 04:12:16PM +0200, Jiri Olsa escreveu:
> On Thu, Apr 28, 2016 at 10:00:01PM +0900, Kyeongmin Cho wrote:
> > As libperf-gtk.so cannot find out undefined symbol 'callchain_param',
> > '-rdynamic' option is needed to add the symbol to the dynamic symbol
> > table.
> 
> hi,
> following command seems to work for me:
>   $ perf report --gtk
> 
> could you please specify what's failing for you?

I haven't tested this one, but I thought it was legit, as
callchain_param is used in more places now, so perhaps you haven't
updated the gtk.so thing that gets created with the perf gtk UI?

- Arnaldo

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] perf report: Find lib path correctly for gtk option
  2016-04-28 14:35   ` drzix
@ 2016-04-29 11:50     ` Namhyung Kim
  0 siblings, 0 replies; 9+ messages in thread
From: Namhyung Kim @ 2016-04-29 11:50 UTC (permalink / raw)
  To: drzix
  Cc: Jiri Olsa, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, linux-kernel, Wang Nan, Adrian Hunter

Hi drzix,

On Thu, Apr 28, 2016 at 11:35:09PM +0900, drzix wrote:
> Hi,
> 
> $ ./perf report --gtk
> GTK browser requested but could not find libperf-gtk.so
> 
> 
> When I print buf in setup_gtk_brower() in ui/setup.c:
> 
> $ ./perf report --gtk
> /libperf-gtk.so
> GTK browser requested but could not find libperf-gtk.so
> 
> Besides, LIBDIR path is just ""

AFAIK this fallback code is only needed if perf was not installed in
the standard directory (and system has no perf package installed
also).  Anyway I think it's better to add a debug message when loading
is failed (preferably with dlerror() or so).

In addition, I think the loading order should be reversed.  It
currently tries to load libperf-gtk.so in the system directory and
then LIBDIR/libperf-gtk.so.  But it'd be better to try LIBDIR first
and then falls back to system directory IMHO.

> 
> Does it mean that LIBDIR path could not take the prefix contained to
> Makefile.perf?

No, LIBDIR used to libdir_SQ.

Thanks,
Namhyung


> 
> 2016-04-28 23:07 GMT+09:00 Jiri Olsa <jolsa@redhat.com>:
> > On Thu, Apr 28, 2016 at 10:00:00PM +0900, Kyeongmin Cho wrote:
> >> When "perf report --gtk", it cannot find libperf-gtk.so.
> >> This patch apply correct path of LIBDIR to setup_gtk_browser().
> >
> > hi,
> > could you please add to changelog some more info
> > about why the case change is actualy needed?
> >
> > thanks,
> > jirka
> >
> >>
> >> Signed-off-by: Kyeongmin Cho <korea.drzix@gmail.com>
> >> ---
> >>  tools/perf/config/Makefile | 2 +-
> >>  tools/perf/ui/Build        | 2 +-
> >>  2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
> >> index f7d7f5a..d96b185 100644
> >> --- a/tools/perf/config/Makefile
> >> +++ b/tools/perf/config/Makefile
> >> @@ -794,7 +794,7 @@ $(call detected_var,prefix_SQ)
> >>  $(call detected_var,perfexecdir_SQ)
> >>  $(call detected_var,tipdir_SQ)
> >>  $(call detected_var,srcdir_SQ)
> >> -$(call detected_var,LIBDIR)
> >> +$(call detected_var,libdir)
> >>  $(call detected_var,GTK_CFLAGS)
> >>  $(call detected_var,PERL_EMBED_CCOPTS)
> >>  $(call detected_var,PYTHON_EMBED_CCOPTS)
> >> diff --git a/tools/perf/ui/Build b/tools/perf/ui/Build
> >> index 0a73538..cd3f92f0 100644
> >> --- a/tools/perf/ui/Build
> >> +++ b/tools/perf/ui/Build
> >> @@ -5,7 +5,7 @@ libperf-y += util.o
> >>  libperf-y += hist.o
> >>  libperf-y += stdio/hist.o
> >>
> >> -CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(LIBDIR))"
> >> +CFLAGS_setup.o += -DLIBDIR="BUILD_STR($(libdir))"
> >>
> >>  libperf-$(CONFIG_SLANG) += browser.o
> >>  libperf-$(CONFIG_SLANG) += browsers/
> >> --
> >> 2.5.5
> >>
> 
> 
> 
> -- 
> Thanks,
> Dr.Zix
> " http://cin.fail "

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param
  2016-04-28 14:49     ` Kyeongmin Cho
@ 2016-05-01 15:44       ` Jiri Olsa
  0 siblings, 0 replies; 9+ messages in thread
From: Jiri Olsa @ 2016-05-01 15:44 UTC (permalink / raw)
  To: Kyeongmin Cho
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, linux-kernel, Wang Nan, Adrian Hunter,
	Namhyung Kim

On Thu, Apr 28, 2016 at 11:49:06PM +0900, Kyeongmin Cho wrote:
> Hi,
> 
> Althogh applying my previous patch, it still prints
> 
> $ ./perf report --gtk
> GTK browser requested but could not find libperf-gtk.so
> 
> When printing dlerror() in setup_gtk_browser(),
> 
> $ ./perf report --gtk
> /home/drzix/lib64/libperf-gtk.so: undefined symbol: callchain_param
> GTK browser requested but could not find libperf-gtk.so
> 
> After applying this patch, compiling rdynamically to make
> libperf-gtk.so find out the symbol, it works.

hum, I'm running that with:
  LD_LIBRARY_PATH=$PWD ./perf report --gtk

jirka

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-05-01 15:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-28 13:00 [PATCH 1/2] perf report: Find lib path correctly for gtk option Kyeongmin Cho
2016-04-28 13:00 ` [PATCH 2/2] perf report: Add gcc option '-rdynamic' to define symbol callchain_param Kyeongmin Cho
2016-04-28 14:12   ` Jiri Olsa
2016-04-28 14:49     ` Kyeongmin Cho
2016-05-01 15:44       ` Jiri Olsa
2016-04-28 15:26     ` Arnaldo Carvalho de Melo
2016-04-28 14:07 ` [PATCH 1/2] perf report: Find lib path correctly for gtk option Jiri Olsa
2016-04-28 14:35   ` drzix
2016-04-29 11:50     ` Namhyung Kim

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.