summaryrefslogtreecommitdiffstats
path: root/tools/perf/pmu-events/Build
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/pmu-events/Build')
-rw-r--r--tools/perf/pmu-events/Build15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
new file mode 100644
index 000000000..215ba30b8
--- /dev/null
+++ b/tools/perf/pmu-events/Build
@@ -0,0 +1,15 @@
+hostprogs := jevents
+
+jevents-y += json.o jsmn.o jevents.o
+HOSTCFLAGS_jevents.o = -I$(srctree)/tools/include
+pmu-events-y += pmu-events.o
+JDIR = pmu-events/arch/$(SRCARCH)
+JSON = $(shell [ -d $(JDIR) ] && \
+ find $(JDIR) -name '*.json' -o -name 'mapfile.csv')
+
+#
+# Locate/process JSON files in pmu-events/arch/
+# directory and create tables in pmu-events.c.
+#
+$(OUTPUT)pmu-events/pmu-events.c: $(JSON) $(JEVENTS)
+ $(Q)$(call echo-cmd,gen)$(JEVENTS) $(SRCARCH) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c $(V)