From: John Garry <john.garry@huawei.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Like Xu <like.xu.linux@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
<linux-perf-users@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: perf tools jevents build flags (was Re: [PATCH] perf jevents: Fix sys_event_tables to be freed like arch_std_events)
Date: Mon, 11 Oct 2021 18:03:19 +0100 [thread overview]
Message-ID: <e5c0123b-31d2-5f07-52a4-724ae89747c1@huawei.com> (raw)
In-Reply-To: <bd98c9f3-de67-7ca5-534c-f7fd6cc69915@huawei.com>
On 28/09/2021 21:30, John Garry wrote:
>>>
>>> OK, would you also consider reusing CFLAGS:
>>>
>>> --- a/tools/perf/pmu-events/Build
>>> +++ b/tools/perf/pmu-events/Build
>>> @@ -9,10 +9,12 @@ JSON = $(shell [ -d $(JDIR) ] &&
>>> \
>>> JDIR_TEST = pmu-events/arch/test
>>> JSON_TEST = $(shell [ -d $(JDIR_TEST) ] && \
>>> find $(JDIR_TEST) -name '*.json')
>>> -
>>> +HOSTCFLAGS_jevents += $(CFLAGS)
>> Humm, we have to check if CFLAGS doesn't come with cross-build options,
>> i.e. IIRC we have to use HOSTCFLAGS instead. Unsure if there is some
>> *CFLAGS variable that gets the common part, where these -Wall and
>> -Wextra, -Werror could go.
>
> not sure. As I see, the bulk of flags we have in CFLAGS comes from
> EXTRA_WARNINGS in scripts/Makefile.include; but CFLAGS seems to also
> include EXTRA_CLAGS, which are for cross-builds (see perf/Makefile.config)
>
Hi Arnaldo,
I'm just looking at enabling warning cflags for jevents again.
So how about this:
--->8----
Subject: [PATCH] perf pmu-events: Enable jevents warnings through HOSTCFLAGS
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 0ae2e3d8b832..65934984f032 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -17,6 +17,7 @@ detected = $(shell echo "$(1)=y" >>
$(OUTPUT).config-detected)
detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected)
CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
+HOSTCFLAGS := $(filter-out -Wnested-externs,$(EXTRA_WARNINGS))
include $(srctree)/tools/scripts/Makefile.arch
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 7df13e74450c..118bcdc70bb4 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -226,7 +226,7 @@ else
endif
export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK
-export HOSTCC HOSTLD HOSTAR
+export HOSTCC HOSTLD HOSTAR HOSTCFLAGS
include $(srctree)/tools/build/Makefile.include
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
index a055dee6a46a..d5c287f069a2 100644
--- a/tools/perf/pmu-events/Build
+++ b/tools/perf/pmu-events/Build
@@ -1,7 +1,7 @@
hostprogs := jevents
jevents-y += json.o jsmn.o jevents.o
-HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include
+HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include $(HOSTCFLAGS)
pmu-events-y += pmu-events.o
JDIR = pmu-events/arch/$(SRCARCH)
JSON = $(shell [ -d $(JDIR) ] && \
--
2.26.2
---8<---
The newly generated warnings in jevents.c are pretty straightforward to
tidy up.
Thanks,
John
prev parent reply other threads:[~2021-10-11 17:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 10:29 [PATCH] perf jevents: Fix sys_event_tables to be freed like arch_std_events Like Xu
2021-09-28 11:52 ` Arnaldo Carvalho de Melo
2021-09-28 11:53 ` Like Xu
2021-09-28 12:37 ` Arnaldo Carvalho de Melo
2021-09-28 12:49 ` John Garry
2021-09-28 13:16 ` Arnaldo Carvalho de Melo
2021-09-28 13:22 ` Arnaldo Carvalho de Melo
2021-09-28 13:32 ` John Garry
2021-09-28 17:56 ` Arnaldo Carvalho de Melo
2021-09-28 20:30 ` John Garry
2021-10-11 17:03 ` John Garry [this message]
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=e5c0123b-31d2-5f07-52a4-724ae89747c1@huawei.com \
--to=john.garry@huawei.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@redhat.com \
--cc=like.xu.linux@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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
all inboxes | Powered by JetHome®