Patch "perf build: Update build rule for generated files" has been added to the 6.5-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    perf build: Update build rule for generated files

to the 6.5-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     perf-build-update-build-rule-for-generated-files.patch
and it can be found in the queue-6.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 7822a8913f4c51c7d1aff793b525d60c3384fb5b Mon Sep 17 00:00:00 2001
From: Namhyung Kim <namhyung@xxxxxxxxxx>
Date: Thu, 27 Jul 2023 19:24:46 -0700
Subject: perf build: Update build rule for generated files

From: Namhyung Kim <namhyung@xxxxxxxxxx>

commit 7822a8913f4c51c7d1aff793b525d60c3384fb5b upstream.

The bison and flex generate C files from the source (.y and .l)
files.  When O= option is used, they are saved in a separate directory
but the default build rule assumes the .C files are in the source
directory.  So it might read invalid file if there are generated files
from an old version.  The same is true for the pmu-events files.

For example, the following command would cause a build failure:

  $ git checkout v6.3
  $ make -C tools/perf  # build in the same directory

  $ git checkout v6.5-rc2
  $ mkdir build  # create a build directory
  $ make -C tools/perf O=build  # build in a different directory but it
                                # refers files in the source directory

Let's update the build rule to specify those cases explicitly to depend
on the files in the output directory.

Note that it's not a complete fix and it needs the next patch for the
include path too.

Fixes: 80eeb67fe577aa76 ("perf jevents: Program to convert JSON file")
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
Cc: Anup Sharma <anupnewsmail@xxxxxxxxx>
Cc: Ian Rogers <irogers@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Link: https://lore.kernel.org/r/20230728022447.1323563-1-namhyung@xxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 tools/build/Makefile.build  |   10 ++++++++++
 tools/perf/pmu-events/Build |    6 ++++++
 2 files changed, 16 insertions(+)

--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -117,6 +117,16 @@ $(OUTPUT)%.s: %.c FORCE
 	$(call rule_mkdir)
 	$(call if_changed_dep,cc_s_c)
 
+# bison and flex files are generated in the OUTPUT directory
+# so it needs a separate rule to depend on them properly
+$(OUTPUT)%-bison.o: $(OUTPUT)%-bison.c FORCE
+	$(call rule_mkdir)
+	$(call if_changed_dep,$(host)cc_o_c)
+
+$(OUTPUT)%-flex.o: $(OUTPUT)%-flex.c FORCE
+	$(call rule_mkdir)
+	$(call if_changed_dep,$(host)cc_o_c)
+
 # Gather build data:
 #   obj-y        - list of build objects
 #   subdir-y     - list of directories to nest
--- a/tools/perf/pmu-events/Build
+++ b/tools/perf/pmu-events/Build
@@ -35,3 +35,9 @@ $(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(
 	$(call rule_mkdir)
 	$(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) $(JEVENTS_MODEL) pmu-events/arch $@
 endif
+
+# pmu-events.c file is generated in the OUTPUT directory so it needs a
+# separate rule to depend on it properly
+$(OUTPUT)pmu-events/pmu-events.o: $(PMU_EVENTS_C)
+	$(call rule_mkdir)
+	$(call if_changed_dep,cc_o_c)


Patches currently in stable-queue which might be from namhyung@xxxxxxxxxx are

queue-6.5/perf-hists-browser-fix-the-number-of-entries-for-e-key.patch
queue-6.5/perf-test-stat_bpf_counters_cgrp-fix-shellcheck-issu.patch
queue-6.5/perf-tools-handle-old-data-in-perf_record_attr.patch
queue-6.5/perf-test-stat_bpf_counters_cgrp-enhance-perf-stat-c.patch
queue-6.5/perf-vendor-events-move-json-events-to-appropriate-f.patch
queue-6.5/perf-hists-browser-fix-hierarchy-mode-header.patch
queue-6.5/perf-build-update-build-rule-for-generated-files.patch
queue-6.5/perf-header-fix-missing-pmu-caps.patch
queue-6.5/perf-parse-events-separate-enomem-memory-handling.patch
queue-6.5/perf-dlfilter-initialize-addr_location-before-passin.patch
queue-6.5/perf-top-don-t-pass-an-err_ptr-directly-to-perf_sess.patch
queue-6.5/perf-annotate-bpf-don-t-enclose-non-debug-code-with-.patch
queue-6.5/perf-trace-really-free-the-evsel-priv-area.patch
queue-6.5/perf-parse-events-move-instances-of-yyabort-to-yynom.patch
queue-6.5/perf-vendor-events-arm64-remove-l1d_cache_lmiss-from.patch
queue-6.5/perf-script-print-cgroup-field-on-the-same-line-as-c.patch
queue-6.5/perf-vendor-events-update-metric-event-names-for-pow.patch
queue-6.5/perf-test-shell-stat_bpf_counters-fix-test-on-intel.patch
queue-6.5/perf-parse-events-separate-yyabort-and-yynomem-cases.patch
queue-6.5/perf-vendor-events-drop-stores_per_inst-metric-event.patch
queue-6.5/perf-bpf-filter-fix-sample-flag-check-with.patch
queue-6.5/perf-parse-events-additional-error-reporting.patch
queue-6.5/perf-vendor-events-drop-some-of-the-json-events-for-.patch
queue-6.5/perf-dlfilter-add-al_cleanup.patch
queue-6.5/perf-vendor-events-update-the-json-events-descriptio.patch
queue-6.5/perf-lock-don-t-pass-an-err_ptr-directly-to-perf_ses.patch
queue-6.5/perf-build-include-generated-header-files-properly.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux