On Fri, Nov 02, 2012 at 10:48:57AM +0900, Namhyung Kim wrote:
> Hi Jiri,
> 
> Despite its way to acme's tree, I'd like to leave a few comments. :)
> 
> 
> On Tue, 30 Oct 2012 23:01:43 +0100, Jiri Olsa wrote:
> > Separating test objects into 'tests' directory.
> >
> > Signed-off-by: Jiri Olsa <jo...@redhat.com>
> > Cc: Arnaldo Carvalho de Melo <a...@ghostprotocols.net>
> > Cc: Peter Zijlstra <a.p.zijls...@chello.nl>
> > Cc: Ingo Molnar <mi...@elte.hu>
> > Cc: Paul Mackerras <pau...@samba.org>
> > Cc: Corey Ashford <cjash...@linux.vnet.ibm.com>
> > Cc: Frederic Weisbecker <fweis...@gmail.com>
> > ---
> >  tools/perf/Makefile                 |    9 +-
> >  tools/perf/builtin-test.c           | 1559 
> > -----------------------------------
> >  tools/perf/tests/builtin-test.c     | 1559 
> > +++++++++++++++++++++++++++++++++++
> >  tools/perf/tests/dso-data.c         |  153 ++++
> >  tools/perf/tests/parse-events.c     | 1116 +++++++++++++++++++++++++
> >  tools/perf/util/dso-test-data.c     |  153 ----
> >  tools/perf/util/parse-events-test.c | 1116 -------------------------
> 
> Looks like it should be considered as renames.  Isn't 'git format-patch
> -M' working?

I can see it is.. nice ;) first time I hear about it..

> 
> 
> >  7 files changed, 2833 insertions(+), 2832 deletions(-)
> >  delete mode 100644 tools/perf/builtin-test.c
> >  create mode 100644 tools/perf/tests/builtin-test.c
> >  create mode 100644 tools/perf/tests/dso-data.c
> >  create mode 100644 tools/perf/tests/parse-events.c
> >  delete mode 100644 tools/perf/util/dso-test-data.c
> >  delete mode 100644 tools/perf/util/parse-events-test.c
> >
> > diff --git a/tools/perf/Makefile b/tools/perf/Makefile
> > index 3e807d7..2d3427f 100644
> > --- a/tools/perf/Makefile
> > +++ b/tools/perf/Makefile
> > @@ -169,7 +169,7 @@ endif
> >  
> >  ### --- END CONFIGURATION SECTION ---
> >  
> > -BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util 
> > -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
> > -D_GNU_SOURCE
> > +BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -I$(OUTPUT)util 
> > -Iutil -I. -I$(TRACE_EVENT_DIR) -D_LARGEFILE64_SOURCE 
> > -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
> 
> Hmm..  Do you really want this?  AFAIK there're lots of places that
> include header files under the util directory and they used relative
> path.  I don't know how it affects them but at least they can be changed
> to use simpler path with this change.

[jolsa@krava perf]$ make O=$PWD/../build/
...
    CC /home/jolsa/kernel.org/linux/tools/build/tests/parse-events.o
tests/parse-events.c:2:26: fatal error: parse-events.h: No such file or 
directory

yes, we could consolidate util includes globaly

> 
> 
> >  BASIC_LDFLAGS =
> >  
> >  ifeq ($(call try-cc,$(SOURCE_BIONIC),$(CFLAGS),bionic),y)
> > @@ -371,7 +371,6 @@ LIB_OBJS += $(OUTPUT)util/help.o
> >  LIB_OBJS += $(OUTPUT)util/levenshtein.o
> >  LIB_OBJS += $(OUTPUT)util/parse-options.o
> >  LIB_OBJS += $(OUTPUT)util/parse-events.o
> > -LIB_OBJS += $(OUTPUT)util/parse-events-test.o
> >  LIB_OBJS += $(OUTPUT)util/path.o
> >  LIB_OBJS += $(OUTPUT)util/rbtree.o
> >  LIB_OBJS += $(OUTPUT)util/bitmap.o
> > @@ -389,7 +388,6 @@ LIB_OBJS += $(OUTPUT)util/sigchain.o
> >  LIB_OBJS += $(OUTPUT)util/dso.o
> >  LIB_OBJS += $(OUTPUT)util/symbol.o
> >  LIB_OBJS += $(OUTPUT)util/symbol-elf.o
> > -LIB_OBJS += $(OUTPUT)util/dso-test-data.o
> >  LIB_OBJS += $(OUTPUT)util/color.o
> >  LIB_OBJS += $(OUTPUT)util/pager.o
> >  LIB_OBJS += $(OUTPUT)util/header.o
> > @@ -430,6 +428,9 @@ LIB_OBJS += $(OUTPUT)ui/stdio/hist.o
> >  
> >  LIB_OBJS += $(OUTPUT)arch/common.o
> >  
> > +LIB_OBJS += $(OUTPUT)tests/parse-events.o
> > +LIB_OBJS += $(OUTPUT)tests/dso-data.o
> > +
> 
> Maybe TEST_OBJS?  I guess they don't need to be included in libperf?

I guess we could have NO_TESTS Makefile variable to disable tests

and '[x] Tests' directory under make menuconfig ;)

> 
> 
> >  BUILTIN_OBJS += $(OUTPUT)builtin-annotate.o
> >  BUILTIN_OBJS += $(OUTPUT)builtin-bench.o
> >  # Benchmark modules
> > @@ -459,8 +460,8 @@ BUILTIN_OBJS += $(OUTPUT)builtin-probe.o
> >  BUILTIN_OBJS += $(OUTPUT)builtin-kmem.o
> >  BUILTIN_OBJS += $(OUTPUT)builtin-lock.o
> >  BUILTIN_OBJS += $(OUTPUT)builtin-kvm.o
> > -BUILTIN_OBJS += $(OUTPUT)builtin-test.o
> >  BUILTIN_OBJS += $(OUTPUT)builtin-inject.o
> > +BUILTIN_OBJS += $(OUTPUT)tests/builtin-test.o
> 
> Placing builtin command in a different directory looks little bit odd.

well, it's full of tests ;)

maybe we could have those tests placed in separate files and use
builtin-test as runner only

thanks,
jirka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to