linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3] tools/perf: Add includes for detected configs in Makefile.perf
@ 2023-09-12  6:38 Athira Rajeev
  2023-09-12 14:00 ` Ian Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: Athira Rajeev @ 2023-09-12  6:38 UTC (permalink / raw)
  To: acme, jolsa, irogers, namhyung
  Cc: linux-perf-users, linuxppc-dev, maddy, atrajeev, kjain, disgoel

Makefile.perf uses "CONFIG_*" checks in the code. Example the config
for libtraceevent is used to set PYTHON_EXT_SRCS

	ifeq ($(CONFIG_LIBTRACEEVENT),y)
	  PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
	else
	  PYTHON_EXT_SRCS := $(shell grep -v '^\#\|util/trace-event.c' util/python-ext-sources)
	endif

But this is not picking the value for CONFIG_LIBTRACEEVENT that is
set using the settings in Makefile.config. Include the file
".config-detected" so that make will use the system detected
configuration in the CONFIG checks. This will fix isues that
could arise when other "CONFIG_*" checks are added to Makefile.perf
in future as well.

Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
---
Changelog:
v2 -> v3:
Added -include since in some cases make clean or make
will fail when config is not included and if config-detected
file is not present.

v1 -> v2:
Added $(OUTPUT) prefix to config-detected as pointed
out by Ian

 tools/perf/Makefile.perf | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 37af6df7b978..f6fdc2d5a92f 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -351,6 +351,9 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
 
 python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so
 
+# Use the detected configuration
+-include $(OUTPUT).config-detected
+
 ifeq ($(CONFIG_LIBTRACEEVENT),y)
   PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
 else
-- 
2.31.1


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

* Re: [PATCH V3] tools/perf: Add includes for detected configs in Makefile.perf
  2023-09-12  6:38 [PATCH V3] tools/perf: Add includes for detected configs in Makefile.perf Athira Rajeev
@ 2023-09-12 14:00 ` Ian Rogers
  2023-09-12 19:36   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Rogers @ 2023-09-12 14:00 UTC (permalink / raw)
  To: Athira Rajeev
  Cc: acme, jolsa, namhyung, linux-perf-users, linuxppc-dev, maddy,
	kjain, disgoel

On Mon, Sep 11, 2023 at 11:38 PM Athira Rajeev
<atrajeev@linux.vnet.ibm.com> wrote:
>
> Makefile.perf uses "CONFIG_*" checks in the code. Example the config
> for libtraceevent is used to set PYTHON_EXT_SRCS
>
>         ifeq ($(CONFIG_LIBTRACEEVENT),y)
>           PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
>         else
>           PYTHON_EXT_SRCS := $(shell grep -v '^\#\|util/trace-event.c' util/python-ext-sources)
>         endif
>
> But this is not picking the value for CONFIG_LIBTRACEEVENT that is
> set using the settings in Makefile.config. Include the file
> ".config-detected" so that make will use the system detected
> configuration in the CONFIG checks. This will fix isues that
> could arise when other "CONFIG_*" checks are added to Makefile.perf
> in future as well.
>
> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>

Reviewed-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

> ---
> Changelog:
> v2 -> v3:
> Added -include since in some cases make clean or make
> will fail when config is not included and if config-detected
> file is not present.
>
> v1 -> v2:
> Added $(OUTPUT) prefix to config-detected as pointed
> out by Ian
>
>  tools/perf/Makefile.perf | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> index 37af6df7b978..f6fdc2d5a92f 100644
> --- a/tools/perf/Makefile.perf
> +++ b/tools/perf/Makefile.perf
> @@ -351,6 +351,9 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
>
>  python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so
>
> +# Use the detected configuration
> +-include $(OUTPUT).config-detected
> +
>  ifeq ($(CONFIG_LIBTRACEEVENT),y)
>    PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
>  else
> --
> 2.31.1
>

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

* Re: [PATCH V3] tools/perf: Add includes for detected configs in Makefile.perf
  2023-09-12 14:00 ` Ian Rogers
@ 2023-09-12 19:36   ` Arnaldo Carvalho de Melo
  2023-09-14 17:19     ` Athira Rajeev
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-09-12 19:36 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Athira Rajeev, jolsa, namhyung, linux-perf-users, linuxppc-dev,
	maddy, kjain, disgoel

Em Tue, Sep 12, 2023 at 07:00:00AM -0700, Ian Rogers escreveu:
> On Mon, Sep 11, 2023 at 11:38 PM Athira Rajeev
> <atrajeev@linux.vnet.ibm.com> wrote:
> >
> > Makefile.perf uses "CONFIG_*" checks in the code. Example the config
> > for libtraceevent is used to set PYTHON_EXT_SRCS
> >
> >         ifeq ($(CONFIG_LIBTRACEEVENT),y)
> >           PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
> >         else
> >           PYTHON_EXT_SRCS := $(shell grep -v '^\#\|util/trace-event.c' util/python-ext-sources)
> >         endif
> >
> > But this is not picking the value for CONFIG_LIBTRACEEVENT that is
> > set using the settings in Makefile.config. Include the file
> > ".config-detected" so that make will use the system detected
> > configuration in the CONFIG checks. This will fix isues that
> > could arise when other "CONFIG_*" checks are added to Makefile.perf
> > in future as well.
> >
> > Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
> 
> Reviewed-by: Ian Rogers <irogers@google.com>

Thanks, applied.

- Arnaldo

 
> Thanks,
> Ian
> 
> > ---
> > Changelog:
> > v2 -> v3:
> > Added -include since in some cases make clean or make
> > will fail when config is not included and if config-detected
> > file is not present.
> >
> > v1 -> v2:
> > Added $(OUTPUT) prefix to config-detected as pointed
> > out by Ian
> >
> >  tools/perf/Makefile.perf | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
> > index 37af6df7b978..f6fdc2d5a92f 100644
> > --- a/tools/perf/Makefile.perf
> > +++ b/tools/perf/Makefile.perf
> > @@ -351,6 +351,9 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
> >
> >  python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so
> >
> > +# Use the detected configuration
> > +-include $(OUTPUT).config-detected
> > +
> >  ifeq ($(CONFIG_LIBTRACEEVENT),y)
> >    PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
> >  else
> > --
> > 2.31.1
> >

-- 

- Arnaldo

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

* Re: [PATCH V3] tools/perf: Add includes for detected configs in Makefile.perf
  2023-09-12 19:36   ` Arnaldo Carvalho de Melo
@ 2023-09-14 17:19     ` Athira Rajeev
  0 siblings, 0 replies; 4+ messages in thread
From: Athira Rajeev @ 2023-09-14 17:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers
  Cc: Kajol Jain, linux-perf-users, Madhavan Srinivasan, Jiri Olsa,
	Namhyung Kim, Disha Goel, linuxppc-dev



> On 13-Sep-2023, at 1:06 AM, Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> 
> Em Tue, Sep 12, 2023 at 07:00:00AM -0700, Ian Rogers escreveu:
>> On Mon, Sep 11, 2023 at 11:38 PM Athira Rajeev
>> <atrajeev@linux.vnet.ibm.com> wrote:
>>> 
>>> Makefile.perf uses "CONFIG_*" checks in the code. Example the config
>>> for libtraceevent is used to set PYTHON_EXT_SRCS
>>> 
>>>        ifeq ($(CONFIG_LIBTRACEEVENT),y)
>>>          PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
>>>        else
>>>          PYTHON_EXT_SRCS := $(shell grep -v '^\#\|util/trace-event.c' util/python-ext-sources)
>>>        endif
>>> 
>>> But this is not picking the value for CONFIG_LIBTRACEEVENT that is
>>> set using the settings in Makefile.config. Include the file
>>> ".config-detected" so that make will use the system detected
>>> configuration in the CONFIG checks. This will fix isues that
>>> could arise when other "CONFIG_*" checks are added to Makefile.perf
>>> in future as well.
>>> 
>>> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>> 
>> Reviewed-by: Ian Rogers <irogers@google.com>
> 
> Thanks, applied.
> 
> - Arnaldo
> 

Thanks Ian for the review and thanks Arnaldo for picking this fix

Athira
> 
>> Thanks,
>> Ian
>> 
>>> ---
>>> Changelog:
>>> v2 -> v3:
>>> Added -include since in some cases make clean or make
>>> will fail when config is not included and if config-detected
>>> file is not present.
>>> 
>>> v1 -> v2:
>>> Added $(OUTPUT) prefix to config-detected as pointed
>>> out by Ian
>>> 
>>> tools/perf/Makefile.perf | 3 +++
>>> 1 file changed, 3 insertions(+)
>>> 
>>> diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
>>> index 37af6df7b978..f6fdc2d5a92f 100644
>>> --- a/tools/perf/Makefile.perf
>>> +++ b/tools/perf/Makefile.perf
>>> @@ -351,6 +351,9 @@ export PYTHON_EXTBUILD_LIB PYTHON_EXTBUILD_TMP
>>> 
>>> python-clean := $(call QUIET_CLEAN, python) $(RM) -r $(PYTHON_EXTBUILD) $(OUTPUT)python/perf*.so
>>> 
>>> +# Use the detected configuration
>>> +-include $(OUTPUT).config-detected
>>> +
>>> ifeq ($(CONFIG_LIBTRACEEVENT),y)
>>>   PYTHON_EXT_SRCS := $(shell grep -v ^\# util/python-ext-sources)
>>> else
>>> --
>>> 2.31.1
>>> 
> 
> -- 
> 
> - Arnaldo



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

end of thread, other threads:[~2023-09-14 17:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-12  6:38 [PATCH V3] tools/perf: Add includes for detected configs in Makefile.perf Athira Rajeev
2023-09-12 14:00 ` Ian Rogers
2023-09-12 19:36   ` Arnaldo Carvalho de Melo
2023-09-14 17:19     ` Athira Rajeev

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).