Skip to contentSkip to conversation

tools/perf: Add includes for detected configs in Makefile.perf

PATCH Applied Athira Rajeev 3 participants 4 messages Sep 12, 2023 – Sep 14, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 tools/perf: Add includes for detected configs in Makefile.perf

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.

---
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(+)
tools/perf/Makefile.perf +3 -0
index 37af6df7b978..f6fdc2d5a92f 100644
@@ -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
Signature · 1 line
2.31.1
reviewer Reviewed-by on v3 1/1
#1 lore raw
Quoted 10 lines · Athira Rajeev

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
Quoted 8 lines

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.

Thanks,
Ian

Quoted 31 lines

---
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(+)
tools/perf/Makefile.perf +3 -1
index 37af6df7b978..f6fdc2d5a92f 100644
@@ -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

maintainer Applied
#2 lore raw

Em Tue, Sep 12, 2023 at 07:00:00AM -0700, Ian Rogers escreveu:

Quoted 19 lines
Quoted 17 lines · Athira Rajeev

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.

Quoted 3 lines
Quoted 1 line

Thanks, applied.

- Arnaldo

Quoted 34 lines

Thanks,
Ian

Quoted 31 lines

---
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(+)
tools/perf/Makefile.perf +3 -1
index 37af6df7b978..f6fdc2d5a92f 100644
@@ -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

Signature · 1 line
- Arnaldo
#3 lore raw
Quoted 24 lines · Arnaldo Carvalho de Melo

Em Tue, Sep 12, 2023 at 07:00:00AM -0700, Ian Rogers escreveu:

Quoted 19 lines
Quoted 17 lines · Athira Rajeev

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.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Thanks, applied.

- Arnaldo

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

Athira

Quoted 39 lines
Quoted 35 lines

Thanks,
Ian

Quoted 31 lines

---
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(+)
tools/perf/Makefile.perf +0 -0
index 37af6df7b978..f6fdc2d5a92f 100644
@@ -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

tools/perf/Makefile.perf +3 -0
+# 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

Signature · 1 line
- Arnaldo