From: Ingo Molnar <mingo@kernel.org>
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Peter Zijlstra <peterz@infradead.org>,
Jiri Olsa <jolsa@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] perf tools: Including pre-generated flex files
Date: Tue, 27 Mar 2012 20:33:37 +0200 [thread overview]
Message-ID: <20120327183335.GA27621@gmail.com> (raw)
In-Reply-To: <20120327181547.GA7374@infradead.org>
* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:
> [...]
>
> But Ingo argues that flex and bison are just a
> yum/whatever install away, so we shouldn't clutter the kernel
> git history with things we can generate at build time.
>
> What is your take on this?
I.e. we could just autogenerate automatically via something like
the patch below.
My main worry was that Linus would (somewhat rightfully) object
to the large diffstats that these things introduce:
tools/perf/util/parse-events-bison.c | 1917 +++++++++++++++++
tools/perf/util/parse-events-bison.h | 81 +
tools/perf/util/parse-events-flex.c | 2272 ++++++++++++++++++++
tools/perf/util/parse-events-flex.h | 316 +++
tools/perf/util/parse-events.c | 603 +++---
tools/perf/util/parse-events.h | 49 +
tools/perf/util/parse-events.l | 126 ++
tools/perf/util/parse-events.y | 229 ++
tools/perf/util/pmu-bison.c | 1663 ++++++++++++++
tools/perf/util/pmu-bison.h | 73 +
tools/perf/util/pmu-flex.c | 1821 ++++++++++++++++
tools/perf/util/pmu-flex.h | 316 +++
I mean, since auto-generating them is in the Makefile *already*,
the only argument in favor of it is that whether we want to make
the perf build depend on bison and flex.
Anyway, it would be nice if we could hear an official opinion on
this. I didn't want to send the latest perf/urgent with this
diffstat until this is settled one way or another.
Thanks,
Ingo
------------->
>From 3cfa99c3a09224cc270ed1e1260cc4fe1b79cebc Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@kernel.org>
Date: Tue, 27 Mar 2012 14:07:50 +0200
Subject: [PATCH] perf tools: Remove auto-generated bison/flex files
These should not be in the Git history - they are auto-generated.
Extend the Makefile rules of the parser files to include the generation
run.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lkml.kernel.org/n/tip-h6jnlwdy7by4v7yljrvzbii0@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/Makefile | 25 +-
tools/perf/util/parse-events-bison.c | 1917 ----------------------------
tools/perf/util/parse-events-bison.h | 81 --
tools/perf/util/parse-events-flex.c | 2272 ----------------------------------
tools/perf/util/parse-events-flex.h | 316 -----
tools/perf/util/pmu-bison.c | 1663 -------------------------
tools/perf/util/pmu-bison.h | 73 --
tools/perf/util/pmu-flex.c | 1821 ---------------------------
tools/perf/util/pmu-flex.h | 316 -----
9 files changed, 15 insertions(+), 8469 deletions(-)
diff --git a/tools/perf/Makefile b/tools/perf/Makefile
index 2f42886..a9dfd1f 100644
--- a/tools/perf/Makefile
+++ b/tools/perf/Makefile
@@ -61,8 +61,6 @@ ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
CC = $(CROSS_COMPILE)gcc
AR = $(CROSS_COMPILE)ar
-FLEX = $(CROSS_COMPILE)flex
-BISON= $(CROSS_COMPILE)bison
# Additional ARCH settings for x86
ifeq ($(ARCH),i386)
@@ -236,6 +234,21 @@ endif
export PERL_PATH
+FLEX = $(CROSS_COMPILE)flex
+BISON= $(CROSS_COMPILE)bison
+
+event-parser:
+ $(QUIET_BISON)$(BISON) -v util/parse-events.y -d -o util/parse-events-bison.c
+ $(QUIET_FLEX)$(FLEX) --header-file=util/parse-events-flex.h -t util/parse-events.l > util/parse-events-flex.c
+
+util/parse-events-flex.c: event-parser
+
+pmu-parser:
+ $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o util/pmu-bison.c
+ $(QUIET_FLEX)$(FLEX) --header-file=util/pmu-flex.h -t util/pmu.l > util/pmu-flex.c
+
+util/pmu-flex.c: pmu-parser
+
LIB_FILE=$(OUTPUT)libperf.a
LIB_H += ../../include/linux/perf_event.h
@@ -883,14 +896,6 @@ cscope:
$(RM) cscope*
$(FIND) . -name '*.[hcS]' -print | xargs cscope -b
-event-parser:
- $(QUIET_BISON)$(BISON) -v util/parse-events.y -d -o util/parse-events-bison.c
- $(QUIET_FLEX)$(FLEX) --header-file=util/parse-events-flex.h -t util/parse-events.l > util/parse-events-flex.c
-
-pmu-parser:
- $(QUIET_BISON)$(BISON) -v util/pmu.y -d -o util/pmu-bison.c
- $(QUIET_FLEX)$(FLEX) --header-file=util/pmu-flex.h -t util/pmu.l > util/pmu-flex.c
-
### Detect prefix changes
TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
$(bindir_SQ):$(perfexecdir_SQ):$(template_dir_SQ):$(prefix_SQ)
[...]
next prev parent reply other threads:[~2012-03-27 18:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-27 18:15 [RFC] perf tools: Including pre-generated flex files Arnaldo Carvalho de Melo
2012-03-27 18:33 ` Ingo Molnar [this message]
2012-03-29 6:43 ` Jiri Olsa
2012-03-31 7:47 ` [tip:perf/urgent] perf tools: Remove auto-generated bison/ " tip-bot for Ingo Molnar
2012-03-28 19:46 ` [RFC] perf tools: Including pre-generated " Linus Torvalds
2012-03-29 12:22 ` Jiri Olsa
2012-03-29 14:37 ` Arnaldo Carvalho de Melo
2012-03-29 14:38 ` Ingo Molnar
2012-03-29 15:45 ` Arnaldo Carvalho de Melo
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=20120327183335.GA27621@gmail.com \
--to=mingo@kernel.org \
--cc=acme@infradead.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox