[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ygqxb4R5arsW2yiD@kernel.org>
Date: Mon, 14 Feb 2022 16:45:51 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Ian Rogers <irogers@...gle.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Darren Hart <dvhart@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>,
André Almeida <andrealmeid@...labora.com>,
James Clark <james.clark@....com>,
John Garry <john.garry@...wei.com>,
Riccardo Mancini <rickyman7@...il.com>,
Yury Norov <yury.norov@...il.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Jin Yao <yao.jin@...ux.intel.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Leo Yan <leo.yan@...aro.org>, Andi Kleen <ak@...ux.intel.com>,
Thomas Richter <tmricht@...ux.ibm.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Shunsuke Nakamura <nakamura.shun@...itsu.com>,
Song Liu <song@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Miaoqian Lin <linmq006@...il.com>,
Stephen Brennan <stephen.s.brennan@...cle.com>,
Kajol Jain <kjain@...ux.ibm.com>,
Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>,
German Gomez <german.gomez@....com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Eric Dumazet <edumazet@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Hao Luo <haoluo@...gle.com>, eranian@...gle.com
Subject: Re: [PATCH v3 05/22] perf maps: Use a pointer for kmaps
Em Fri, Feb 11, 2022 at 02:23:03PM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Feb 11, 2022 at 02:33:58AM -0800, Ian Rogers escreveu:
> > struct maps is reference counted, using a pointer is more idiomatic.
>
> So, I tried to apply this after adding this to the cset comming log to
> make sure reviewers know that this is just a clarifying comming, no code
> change:
>
> Committer notes:
>
> Definition of machine__kernel_maps(machine), the replacement of &machine->kmaps
>
> static inline
> struct maps *machine__kernel_maps(struct machine *machine)
> {
> return machine->kmaps;
> }
>
> but then when building on a f34 system I got:
>
> CC /tmp/build/perf/bench/inject-buildid.o
> In file included from /var/home/acme/git/perf/tools/perf/util/build-id.h:10,
> from /var/home/acme/git/perf/tools/perf/util/dso.h:13,
> from tests/vmlinux-kallsyms.c:8:
> In function ‘machine__kernel_maps’,
> inlined from ‘test__vmlinux_matches_kallsyms’ at tests/vmlinux-kallsyms.c:122:22:
> /var/home/acme/git/perf/tools/perf/util/machine.h:86:23: error: ‘vmlinux.kmaps’ is used uninitialized [-Werror=uninitialized]
> 86 | return machine->kmaps;
> | ~~~~~~~^~~~~~~
> tests/vmlinux-kallsyms.c: In function ‘test__vmlinux_matches_kallsyms’:
> tests/vmlinux-kallsyms.c:121:34: note: ‘vmlinux’ declared here
> 121 | struct machine kallsyms, vmlinux;
> | ^~~~~~~
> cc1: all warnings being treated as errors
> make[4]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:96: /tmp/build/perf/tests/vmlinux-kallsyms.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
> CC /tmp/build/perf/util/config.o
> CC /tmp/build/perf/arch/x86/util/archinsn.o
> CC /tmp/build/perf/arch/x86/util/intel-pt.o
> CC /tmp/build/perf/arch/x86/util/intel-bts.o
> CC /tmp/build/perf/util/db-export.o
> CC /tmp/build/perf/util/event.o
> make[3]: *** [/var/home/acme/git/perf/tools/build/Makefile.build:139: tests] Error 2
> make[3]: *** Waiting for unfinished jobs....
>
> Can you please take a look at that?
I'm applying this on top:
diff --git a/tools/perf/tests/vmlinux-kallsyms.c b/tools/perf/tests/vmlinux-kallsyms.c
index 84bf5f64006560f5..93dee542a177ed1d 100644
--- a/tools/perf/tests/vmlinux-kallsyms.c
+++ b/tools/perf/tests/vmlinux-kallsyms.c
@@ -119,7 +119,7 @@ static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused
struct symbol *sym;
struct map *kallsyms_map, *vmlinux_map, *map;
struct machine kallsyms, vmlinux;
- struct maps *maps = machine__kernel_maps(&vmlinux);
+ struct maps *maps;
u64 mem_start, mem_end;
bool header_printed;
@@ -132,6 +132,8 @@ static int test__vmlinux_matches_kallsyms(struct test_suite *test __maybe_unused
machine__init(&kallsyms, "", HOST_KERNEL_ID);
machine__init(&vmlinux, "", HOST_KERNEL_ID);
+ maps = machine__kernel_maps(&vmlinux);
+
/*
* Step 2:
*
Powered by blists - more mailing lists