2014-01-13 18:06:07

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: perf probe: Build error with missing libraries

On a Ubuntu system just installed (13.10, x86_64), I'm installing the
devel libs one by one to check if there are problems with the automatic
disabling of features that requires libraries not installed.

Stumbled at this:

CC /tmp/build/perf/util/probe-event.o
util/probe-event.c: In function ‘try_to_find_probe_trace_events’:
util/probe-event.c:753:46: error: unused parameter ‘target’
[-Werror=unused-parameter]
int max_tevs __maybe_unused, const char *target)
^
util/probe-event.c: At top level:
util/probe-event.c:193:12: error: ‘get_text_start_address’ defined but
not used [-Werror=unused-function]
static int get_text_start_address(const char *exec, unsigned long
*address)
^
cc1: all warnings being treated as errors
make[1]: *** [/tmp/build/perf/util/probe-event.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [install] Error 2
make: Leaving directory `/home/acme/git/linux/tools/perf'
acme@ubuntu13:~/git/linux$

Investigating...

- Arnaldo


2014-01-13 18:15:08

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: perf probe: Build error with missing libraries

Em Mon, Jan 13, 2014 at 03:04:00PM -0300, Arnaldo Carvalho de Melo escreveu:
> On a Ubuntu system just installed (13.10, x86_64), I'm installing the
> devel libs one by one to check if there are problems with the automatic
> disabling of features that requires libraries not installed.

> Stumbled at this:

> util/probe-event.c: At top level:
> util/probe-event.c:193:12: error: ‘get_text_start_address’ defined but
> not used [-Werror=unused-function]

> Investigating...

This patch below fixes it, applying.

Jiri, this is something else for the give-me-more-ponies list for
tests/make: build it on freshly provisioned systems with multiple mixes
of devel packages installed ;-)

- Arnaldo

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 86ed858..a4ee6b4 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -172,6 +172,7 @@ const char *kernel_get_module_path(const char *module)
return (dso) ? dso->long_name : NULL;
}

+#ifdef HAVE_DWARF_SUPPORT
/* Copied from unwind.c */
static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
GElf_Shdr *shp, const char *name)
@@ -217,6 +218,7 @@ out:
elf_end(elf);
return ret;
}
+#endif

static int init_user_exec(void)
{
@@ -750,7 +752,8 @@ static int kprobe_convert_to_perf_probe(struct probe_trace_point *tp,

static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
struct probe_trace_event **tevs __maybe_unused,
- int max_tevs __maybe_unused, const char *target)
+ int max_tevs __maybe_unused,
+ const char *target __maybe_unused)
{
if (perf_probe_event_need_dwarf(pev)) {
pr_warning("Debuginfo-analysis is not supported.\n");

Subject: Re: perf probe: Build error with missing libraries

(2014/01/14 3:14), Arnaldo Carvalho de Melo wrote:
> Em Mon, Jan 13, 2014 at 03:04:00PM -0300, Arnaldo Carvalho de Melo escreveu:
>> On a Ubuntu system just installed (13.10, x86_64), I'm installing the
>> devel libs one by one to check if there are problems with the automatic
>> disabling of features that requires libraries not installed.
>
>> Stumbled at this:
>
>> util/probe-event.c: At top level:
>> util/probe-event.c:193:12: error: ‘get_text_start_address’ defined but
>> not used [-Werror=unused-function]
>
>> Investigating...
>
> This patch below fixes it, applying.

Thank you for fixing it! It looks good for me.

Acked-by: Masami Hiramatsu <[email protected]>


>
> Jiri, this is something else for the give-me-more-ponies list for
> tests/make: build it on freshly provisioned systems with multiple mixes
> of devel packages installed ;-)

I think we can change makefile to get some combinations of config options
when building perf tools.

Thank you,

>
> - Arnaldo
>
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 86ed858..a4ee6b4 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -172,6 +172,7 @@ const char *kernel_get_module_path(const char *module)
> return (dso) ? dso->long_name : NULL;
> }
>
> +#ifdef HAVE_DWARF_SUPPORT
> /* Copied from unwind.c */
> static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
> GElf_Shdr *shp, const char *name)
> @@ -217,6 +218,7 @@ out:
> elf_end(elf);
> return ret;
> }
> +#endif
>
> static int init_user_exec(void)
> {
> @@ -750,7 +752,8 @@ static int kprobe_convert_to_perf_probe(struct probe_trace_point *tp,
>
> static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
> struct probe_trace_event **tevs __maybe_unused,
> - int max_tevs __maybe_unused, const char *target)
> + int max_tevs __maybe_unused,
> + const char *target __maybe_unused)
> {
> if (perf_probe_event_need_dwarf(pev)) {
> pr_warning("Debuginfo-analysis is not supported.\n");
>


--
Masami HIRAMATSU
IT Management Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: [email protected]

2014-01-14 13:09:15

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: perf probe: Build error with missing libraries

Em Tue, Jan 14, 2014 at 10:41:37AM +0900, Masami Hiramatsu escreveu:
> (2014/01/14 3:14), Arnaldo Carvalho de Melo wrote:
> > Jiri, this is something else for the give-me-more-ponies list for
> > tests/make: build it on freshly provisioned systems with multiple mixes
> > of devel packages installed ;-)

> I think we can change makefile to get some combinations of config options
> when building perf tools.

This is what:

make -C tools/perf -f tests/make

does, and we use it already, many config combos are tested, but that
kinda expects that all optional devel libs be installed.

What I'm talking about is to, in addition, install the devel packages
iteratively, testing those config options combos with and without
installed devel packages combos.

- Arnaldo

2014-01-14 13:15:52

by Jiri Olsa

[permalink] [raw]
Subject: Re: perf probe: Build error with missing libraries

On Tue, Jan 14, 2014 at 10:09:07AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jan 14, 2014 at 10:41:37AM +0900, Masami Hiramatsu escreveu:
> > (2014/01/14 3:14), Arnaldo Carvalho de Melo wrote:
> > > Jiri, this is something else for the give-me-more-ponies list for
> > > tests/make: build it on freshly provisioned systems with multiple mixes
> > > of devel packages installed ;-)
>
> > I think we can change makefile to get some combinations of config options
> > when building perf tools.
>
> This is what:
>
> make -C tools/perf -f tests/make
>
> does, and we use it already, many config combos are tested, but that
> kinda expects that all optional devel libs be installed.
>
> What I'm talking about is to, in addition, install the devel packages
> iteratively, testing those config options combos with and without
> installed devel packages combos.

yep, sounds good.. maybe another script setting the environment
(randomly, with some logic never to repeat any config?) and running
tests/make suite

jirka

2014-01-14 14:21:31

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: perf probe: Build error with missing libraries

Em Tue, Jan 14, 2014 at 02:15:40PM +0100, Jiri Olsa escreveu:
> On Tue, Jan 14, 2014 at 10:09:07AM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Jan 14, 2014 at 10:41:37AM +0900, Masami Hiramatsu escreveu:
> > > (2014/01/14 3:14), Arnaldo Carvalho de Melo wrote:
> > > > Jiri, this is something else for the give-me-more-ponies list for
> > > > tests/make: build it on freshly provisioned systems with multiple mixes
> > > > of devel packages installed ;-)

> > > I think we can change makefile to get some combinations of config options
> > > when building perf tools.

> > This is what:
> >
> > make -C tools/perf -f tests/make

> > does, and we use it already, many config combos are tested, but that
> > kinda expects that all optional devel libs be installed.

> > What I'm talking about is to, in addition, install the devel packages
> > iteratively, testing those config options combos with and without
> > installed devel packages combos.

> yep, sounds good.. maybe another script setting the environment
> (randomly, with some logic never to repeat any config?) and running
> tests/make suite

What I'm usually doing, from time to time, when people report problems
building on some specific distro, is to install a VM with the default
set of packages, then try to build perf and go on installing the strict
requirements, then add the suggested libraries for features marked as
OFF by the automatic feature detection mechanism.

Something that kinda replicated that, perhaps using 'mock'
(https://fedoraproject.org/wiki/Using_Mock_to_test_package_builds) or
something similar, could help testing that.

- Arnaldo

2014-01-15 01:59:02

by Namhyung Kim

[permalink] [raw]
Subject: Re: perf probe: Build error with missing libraries

Hi Arnaldo,

On Tue, 14 Jan 2014 10:09:07 -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jan 14, 2014 at 10:41:37AM +0900, Masami Hiramatsu escreveu:
>> (2014/01/14 3:14), Arnaldo Carvalho de Melo wrote:
>> > Jiri, this is something else for the give-me-more-ponies list for
>> > tests/make: build it on freshly provisioned systems with multiple mixes
>> > of devel packages installed ;-)
>
>> I think we can change makefile to get some combinations of config options
>> when building perf tools.
>
> This is what:
>
> make -C tools/perf -f tests/make
>
> does, and we use it already, many config combos are tested, but that
> kinda expects that all optional devel libs be installed.

I've been thinking that the above should look like below.

make build-test (-C tools/perf)


Maybe something like this?


diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index eefb9fb0c02f..e110c2a2ade1 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -75,6 +75,12 @@ clean:
$(make)

#
+# The build-test target is not really parallel, don't print the jobs info:
+#
+build-test:
+ @$(MAKE) -f tests/make --no-print-directory
+
+#
# All other targets get passed through:
#
%:

--
Thanks,
Namhyung

2014-01-15 18:39:05

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: perf probe: Build error with missing libraries

Em Wed, Jan 15, 2014 at 10:58:58AM +0900, Namhyung Kim escreveu:
> Hi Arnaldo,
>
> On Tue, 14 Jan 2014 10:09:07 -0300, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Jan 14, 2014 at 10:41:37AM +0900, Masami Hiramatsu escreveu:
> >> (2014/01/14 3:14), Arnaldo Carvalho de Melo wrote:
> >> > Jiri, this is something else for the give-me-more-ponies list for
> >> > tests/make: build it on freshly provisioned systems with multiple mixes
> >> > of devel packages installed ;-)
> >
> >> I think we can change makefile to get some combinations of config options
> >> when building perf tools.
> >
> > This is what:
> >
> > make -C tools/perf -f tests/make
> >
> > does, and we use it already, many config combos are tested, but that
> > kinda expects that all optional devel libs be installed.
>
> I've been thinking that the above should look like below.
>
> make build-test (-C tools/perf)
>
>
> Maybe something like this?

Haven't tested, but I think it is worth to make this a shortcut, care to
test (if not yet) and resubmit with proper S-O-B, etc?

- Arnaldo

>
> diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> index eefb9fb0c02f..e110c2a2ade1 100644
> --- a/tools/perf/Makefile
> +++ b/tools/perf/Makefile
> @@ -75,6 +75,12 @@ clean:
> $(make)
>
> #
> +# The build-test target is not really parallel, don't print the jobs info:
> +#
> +build-test:
> + @$(MAKE) -f tests/make --no-print-directory
> +
> +#
> # All other targets get passed through:
> #
> %:
>
> --
> Thanks,
> Namhyung

2014-01-16 01:26:20

by Namhyung Kim

[permalink] [raw]
Subject: Re: perf probe: Build error with missing libraries

On Wed, 15 Jan 2014 15:38:56 -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Jan 15, 2014 at 10:58:58AM +0900, Namhyung Kim escreveu:
>> Hi Arnaldo,
>>
>> On Tue, 14 Jan 2014 10:09:07 -0300, Arnaldo Carvalho de Melo wrote:
>> > Em Tue, Jan 14, 2014 at 10:41:37AM +0900, Masami Hiramatsu escreveu:
>> >> (2014/01/14 3:14), Arnaldo Carvalho de Melo wrote:
>> >> > Jiri, this is something else for the give-me-more-ponies list for
>> >> > tests/make: build it on freshly provisioned systems with multiple mixes
>> >> > of devel packages installed ;-)
>> >
>> >> I think we can change makefile to get some combinations of config options
>> >> when building perf tools.
>> >
>> > This is what:
>> >
>> > make -C tools/perf -f tests/make
>> >
>> > does, and we use it already, many config combos are tested, but that
>> > kinda expects that all optional devel libs be installed.
>>
>> I've been thinking that the above should look like below.
>>
>> make build-test (-C tools/perf)
>>
>>
>> Maybe something like this?
>
> Haven't tested, but I think it is worth to make this a shortcut, care to
> test (if not yet) and resubmit with proper S-O-B, etc?

OK, will do!

Thanks,
Namhyung