From ace9429bb58fd418f0c81d4c2835699bddf6bde6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 11 Apr 2024 10:27:49 +0200 Subject: Adding upstream version 6.6.15. Signed-off-by: Daniel Baumann --- tools/perf/pmu-events/Build | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tools/perf/pmu-events/Build (limited to 'tools/perf/pmu-events/Build') diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build new file mode 100644 index 0000000000..1d18bb8940 --- /dev/null +++ b/tools/perf/pmu-events/Build @@ -0,0 +1,43 @@ +pmu-events-y += pmu-events.o +JDIR = pmu-events/arch/$(SRCARCH) +JSON = $(shell [ -d $(JDIR) ] && \ + find $(JDIR) -name '*.json' -o -name 'mapfile.csv') +JDIR_TEST = pmu-events/arch/test +JSON_TEST = $(shell [ -d $(JDIR_TEST) ] && \ + find $(JDIR_TEST) -name '*.json') +JEVENTS_PY = pmu-events/jevents.py +METRIC_PY = pmu-events/metric.py +METRIC_TEST_PY = pmu-events/metric_test.py +EMPTY_PMU_EVENTS_C = pmu-events/empty-pmu-events.c +PMU_EVENTS_C = $(OUTPUT)pmu-events/pmu-events.c +METRIC_TEST_LOG = $(OUTPUT)pmu-events/metric_test.log + +ifeq ($(JEVENTS_ARCH),) +JEVENTS_ARCH=$(SRCARCH) +endif +JEVENTS_MODEL ?= all + +# +# Locate/process JSON files in pmu-events/arch/ +# directory and create tables in pmu-events.c. +# + +ifeq ($(NO_JEVENTS),1) +$(PMU_EVENTS_C): $(EMPTY_PMU_EVENTS_C) + $(call rule_mkdir) + $(Q)$(call echo-cmd,gen)cp $< $@ +else +$(METRIC_TEST_LOG): $(METRIC_TEST_PY) $(METRIC_PY) + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)$(PYTHON) $< 2> $@ || (cat $@ && false) + +$(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_TEST_LOG) + $(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) -- cgit v1.2.3