From: Jiri Olsa <jolsa@redhat.com>
To: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: mingo@redhat.com, ak@linux.intel.com,
Michael Ellerman <mpe@ellerman.id.au>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Paul Mackerras <paulus@samba.org>,
namhyung@kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] perf: jevents: Program to convert JSON file to C style file
Date: Fri, 22 May 2015 16:56:16 +0200 [thread overview]
Message-ID: <20150522145615.GA16473@krava.redhat.com> (raw)
In-Reply-To: <1432080130-6678-3-git-send-email-sukadev@linux.vnet.ibm.com>
On Tue, May 19, 2015 at 05:02:08PM -0700, Sukadev Bhattiprolu wrote:
SNIP
> ---
> tools/perf/Build | 1 +
> tools/perf/Makefile.perf | 4 +-
> tools/perf/pmu-events/Build | 38 ++
> tools/perf/pmu-events/README | 67 ++++
> tools/perf/pmu-events/jevents.c | 700 ++++++++++++++++++++++++++++++++++++
> tools/perf/pmu-events/jevents.h | 17 +
> tools/perf/pmu-events/pmu-events.h | 39 ++
> 7 files changed, 865 insertions(+), 1 deletion(-)
> create mode 100644 tools/perf/pmu-events/Build
> create mode 100644 tools/perf/pmu-events/README
> create mode 100644 tools/perf/pmu-events/jevents.c
> create mode 100644 tools/perf/pmu-events/jevents.h
> create mode 100644 tools/perf/pmu-events/pmu-events.h
>
> diff --git a/tools/perf/Build b/tools/perf/Build
> index b77370e..40bffa0 100644
> --- a/tools/perf/Build
> +++ b/tools/perf/Build
> @@ -36,6 +36,7 @@ CFLAGS_builtin-help.o += $(paths)
> CFLAGS_builtin-timechart.o += $(paths)
> CFLAGS_perf.o += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" -include $(OUTPUT)PERF-VERSION-FILE
>
> +libperf-y += pmu-events/
there's no concetion (yet) in the new build system to trigger
another binery build as a dependency for object file.. I'd
rather do this the framework way, please check attached patch
also currently the pmu-events.c is generated every time,
so we need to add the event json data files as dependency
jirka
---
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 10df57237a66..f6e7fd868892 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -41,6 +41,7 @@ include $(build-file)
quiet_cmd_flex = FLEX $@
quiet_cmd_bison = BISON $@
+quiet_cmd_gen = GEN $@
# Create directory unless it exists
quiet_cmd_mkdir = MKDIR $(dir $@)
diff --git a/tools/perf/Build b/tools/perf/Build
index 40bffa0b6ee1..b77370ef7005 100644
--- a/tools/perf/Build
+++ b/tools/perf/Build
@@ -36,7 +36,6 @@ CFLAGS_builtin-help.o += $(paths)
CFLAGS_builtin-timechart.o += $(paths)
CFLAGS_perf.o += -DPERF_HTML_PATH="BUILD_STR($(htmldir_SQ))" -include $(OUTPUT)PERF-VERSION-FILE
-libperf-y += pmu-events/
libperf-y += util/
libperf-y += arch/
libperf-y += ui/
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index 57e46a541686..a4ba451cffa2 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -272,14 +272,29 @@ strip: $(PROGRAMS) $(OUTPUT)perf
PERF_IN := $(OUTPUT)perf-in.o
+JEVENTS := $(OUTPUT)pmu-events/jevents
+JEVENTS_IN := $(OUTPUT)pmu-events/jevents-in.o
+PMU_EVENTS_IN := $(OUTPUT)pmu-events/pmu-events-in.o
+
+export JEVENTS
+
export srctree OUTPUT RM CC LD AR CFLAGS V BISON FLEX
build := -f $(srctree)/tools/build/Makefile.build dir=. obj
$(PERF_IN): $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)common-cmds.h FORCE
$(Q)$(MAKE) $(build)=perf
-$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN)
- $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(LIBS) -o $@
+$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(PMU_EVENTS_IN)
+ $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(PMU_EVENTS_IN) $(LIBS) -o $@
+
+$(JEVENTS_IN): FORCE
+ $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(OUTPUT)pmu-events obj=jevents
+
+$(JEVENTS): $(JEVENTS_IN)
+ $(QUIET_LINK)$(CC) $(JEVENTS_IN) -o $@
+
+$(PMU_EVENTS_IN): $(JEVENTS) FORCE
+ $(Q)$(MAKE) -f $(srctree)/tools/build/Makefile.build dir=$(OUTPUT)pmu-events obj=pmu-events
$(GTK_IN): FORCE
$(Q)$(MAKE) $(build)=gtk
@@ -538,7 +553,7 @@ clean: $(LIBTRACEEVENT)-clean $(LIBAPI)-clean config-clean
$(Q)find . -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
$(Q)$(RM) .config-detected
$(call QUIET_CLEAN, core-progs) $(RM) $(ALL_PROGRAMS) perf perf-read-vdso32 perf-read-vdsox32 $(OUTPUT)pmu-events/jevents
- $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex*
+ $(call QUIET_CLEAN, core-gen) $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo $(OUTPUT)common-cmds.h TAGS tags cscope* $(OUTPUT)PERF-VERSION-FILE $(OUTPUT)FEATURE-DUMP $(OUTPUT)util/*-bison* $(OUTPUT)util/*-flex* $(OUTPUT)pmu-events/pmu-events.c
$(QUIET_SUBDIR0)Documentation $(QUIET_SUBDIR1) clean
$(python-clean)
diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build
index 7a2aaafa05e5..c35eeec2674c 100644
--- a/tools/perf/pmu-events/Build
+++ b/tools/perf/pmu-events/Build
@@ -1,26 +1,13 @@
-.SUFFIXES:
-
-libperf-y += pmu-events.o
-
-JEVENTS = $(OUTPUT)pmu-events/jevents
-JEVENTS_OBJS = $(OUTPUT)pmu-events/json.o $(OUTPUT)pmu-events/jsmn.o \
- $(OUTPUT)pmu-events/jevents.o
-
-PMU_EVENTS = $(srctree)/tools/perf/pmu-events/
-
-all: $(OUTPUT)pmu-events.o
-
-$(OUTPUT)pmu-events/jevents: $(JEVENTS_OBJS)
- $(call rule_mkdir)
- $(CC) -o $@ $(JEVENTS_OBJS)
+jevents-y += json.o jsmn.o jevents.o
+pmu-events-y += pmu-events.o
#
-# Look for JSON files in $(PMU_EVENTS)/arch directory,
-# process them and create tables in $(PMU_EVENTS)/pmu-events.c
+# Look for JSON files in arch directory,
+# process them and create tables in pmu-events.c
#
-pmu-events/pmu-events.c: $(JEVENTS) FORCE
- $(JEVENTS) $(PMU_EVENTS)/arch $(PMU_EVENTS)/pmu-events.c
-
+# TODO put event data files as dependencies instead of FORCE
+pmu-events/pmu-events.c: FORCE
+ $(Q)$(call echo-cmd,gen)$(JEVENTS) pmu-events/arch $(OUTPUT)pmu-events/pmu-events.c
#
# If we fail to build pmu-events.o, it could very well be due to
@@ -30,9 +17,3 @@ pmu-events/pmu-events.c: $(JEVENTS) FORCE
# so the build of perf can succeed even if we are not able to use
# the PMU event aliases.
#
-
-clean:
- rm -f $(JEVENTS_OBJS) $(JEVENTS) $(OUTPUT)pmu-events.o \
- $(PMU_EVENTS)pmu-events.c
-
-FORCE:
next prev parent reply other threads:[~2015-05-22 14:56 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-20 0:02 [PATCH 0/4] perf: Add support for PMU events in JSON format Sukadev Bhattiprolu
2015-05-20 0:02 ` Sukadev Bhattiprolu
2015-05-20 0:02 ` [PATCH 1/4] perf: Add jsmn `jasmine' JSON parser Sukadev Bhattiprolu
2015-05-20 0:02 ` Sukadev Bhattiprolu
2015-05-20 0:02 ` [PATCH 2/4] perf: jevents: Program to convert JSON file to C style file Sukadev Bhattiprolu
2015-05-20 0:02 ` Sukadev Bhattiprolu
2015-05-22 14:56 ` Jiri Olsa [this message]
2015-05-22 15:58 ` Sukadev Bhattiprolu
2015-05-22 17:33 ` Jiri Olsa
2015-05-22 18:01 ` Andi Kleen
2015-05-22 18:09 ` Sukadev Bhattiprolu
2015-05-22 21:28 ` Andi Kleen
2015-05-22 14:56 ` Jiri Olsa
2015-05-22 17:25 ` Sukadev Bhattiprolu
2015-05-27 13:54 ` Namhyung Kim
2015-05-27 14:40 ` Andi Kleen
2015-05-27 14:59 ` Namhyung Kim
2015-05-28 11:52 ` Jiri Olsa
2015-05-28 12:09 ` Ingo Molnar
2015-05-28 13:07 ` Ingo Molnar
2015-05-28 15:39 ` Andi Kleen
2015-05-29 7:27 ` Ingo Molnar
2015-05-31 16:07 ` Andi Kleen
2015-05-20 0:02 ` [PATCH 3/4] perf: Use pmu_events_map table to create event aliases Sukadev Bhattiprolu
2015-05-20 0:02 ` Sukadev Bhattiprolu
2015-05-20 23:58 ` Andi Kleen
2015-05-21 0:19 ` Sukadev Bhattiprolu
2015-05-21 2:56 ` Andi Kleen
2015-05-21 5:02 ` Sukadev Bhattiprolu
2015-05-21 18:50 ` Andi Kleen
2015-05-20 0:02 ` [PATCH 4/4] perf: Add power8 PMU events in JSON format Sukadev Bhattiprolu
2015-05-20 0:02 ` Sukadev Bhattiprolu
2015-05-27 13:59 ` Namhyung Kim
2015-05-27 14:41 ` Andi Kleen
2015-05-27 15:01 ` Namhyung Kim
2015-05-27 16:24 ` Andi Kleen
2015-05-27 20:24 ` Sukadev Bhattiprolu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150522145615.GA16473@krava.redhat.com \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=sukadev@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.