From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757483Ab2DFPvQ (ORCPT ); Fri, 6 Apr 2012 11:51:16 -0400 Received: from mail.skyhub.de ([78.46.96.112]:50075 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754168Ab2DFPvO (ORCPT ); Fri, 6 Apr 2012 11:51:14 -0400 Date: Fri, 6 Apr 2012 17:51:09 +0200 From: Borislav Petkov To: Frederic Weisbecker Cc: LKML , Steven Rostedt , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Arnaldo Carvalho de Melo , Jiri Olsa , Arun Sharma , Namhyung Kim Subject: Re: [PATCH 03/15] perf: Build libtraceevent.a Message-ID: <20120406155109.GA2693@x1.osrc.amd.com> Mail-Followup-To: Borislav Petkov , Frederic Weisbecker , LKML , Steven Rostedt , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Arnaldo Carvalho de Melo , Jiri Olsa , Arun Sharma , Namhyung Kim References: <1333666086-6517-1-git-send-email-fweisbec@gmail.com> <1333666086-6517-4-git-send-email-fweisbec@gmail.com> <20120406114502.GD30425@liondog.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 06, 2012 at 05:26:35PM +0200, Frederic Weisbecker wrote: > 2012/4/6 Borislav Petkov : > > On Fri, Apr 06, 2012 at 12:47:54AM +0200, Frederic Weisbecker wrote: > >> From: Steven Rostedt > >> > >> Have building perf also build libtraceevent.a. Currently, perf does > >> not use the code within libtraceevent.a, but it soon will. > >> > >> Signed-off-by: Steven Rostedt > >> Cc: Ingo Molnar > >> Cc: Thomas Gleixner > >> Cc: Peter Zijlstra > >> Cc: Arnaldo Carvalho de Melo > >> Cc: Steven Rostedt > >> Cc: Borislav Petkov > >> Cc: Jiri Olsa > >> Cc: Arun Sharma > >> Cc: Namhyung Kim > >> Signed-off-by: Frederic Weisbecker > >> --- > >>  tools/perf/Makefile |   11 ++++++++++- > >>  1 files changed, 10 insertions(+), 1 deletions(-) > >> > >> diff --git a/tools/perf/Makefile b/tools/perf/Makefile > >> index 6f93a99..8e60e51 100644 > >> --- a/tools/perf/Makefile > >> +++ b/tools/perf/Makefile > >> @@ -1,5 +1,6 @@ > >>  ifeq ("$(origin O)", "command line") > >>       OUTPUT := $(O)/ > >> +     COMMAND_O := O=$(O) > >>  endif > >> > >>  # The default target of this Makefile is... > >> @@ -211,6 +212,9 @@ $(OUTPUT)python/perf.so: $(PYRF_OBJS) $(PYTHON_EXT_SRCS) $(PYTHON_EXT_DEPS) > >> > >>  SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) > >> > >> +EVENT_PARSE_DIR = ../lib/traceevent/ > >> +LIBTRACEEVENT = $(OUTPUT)$(EVENT_PARSE_DIR)libtraceevent.a > >> + > >>  # > >>  # Single 'perf' binary right now: > >>  # > >> @@ -335,6 +339,7 @@ LIB_H += util/cpumap.h > >>  LIB_H += util/top.h > >>  LIB_H += $(ARCH_INCLUDE) > >>  LIB_H += util/cgroup.h > >> +LIB_H += $(EVENT_PARSE_DIR)event-parse.h > >> > >>  LIB_OBJS += $(OUTPUT)util/abspath.o > >>  LIB_OBJS += $(OUTPUT)util/alias.o > >> @@ -741,7 +746,7 @@ $(OUTPUT)perf.o: perf.c $(OUTPUT)common-cmds.h $(OUTPUT)PERF-CFLAGS > >>               '-DPERF_HTML_PATH="$(htmldir_SQ)"' \ > >>               $(ALL_CFLAGS) -c $(filter %.c,$^) -o $@ > >> > >> -$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) > >> +$(OUTPUT)perf: $(OUTPUT)perf.o $(BUILTIN_OBJS) $(PERFLIBS) $(LIBTRACEEVENT) > >>       $(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) $(OUTPUT)perf.o \ > >>                 $(BUILTIN_OBJS) $(LIBS) -o $@ > >> > >> @@ -847,6 +852,10 @@ $(sort $(dir $(DIRECTORY_DEPS))): > >>  $(LIB_FILE): $(LIB_OBJS) > >>       $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS) > >> > >> +# libparsevent.a > >> +$(LIBTRACEEVENT): > >> +     make -C $(EVENT_PARSE_DIR) $(COMMAND_O) libtraceevent.a > >> + > > > > With a toplevel Makefile in tools/, this should be made into its own > > target residing in tools/lib/traceevent/Makefile and a perf build should > > be dependent on it instead of adding a perf-specific libtraceevent > > target here. > > Not sure what you mean. The libtraceevent makefile is standalone and > perf is dependant on it. > What am I missing? Right, what I meant was to add the $(LIBTRACEEVENT): target above to the toplevel Makefile so that when you're in the kernel source tree, you do $ make tools/perf it has a target $(LIBTRACEEVENT) dependent on it in the toplevel Makefile instead of perf's Makefile to avoid duplication. Then, when perf is rebuilt, it simply links with this lib. IOW, not have the "make -C" call in perf's Makefile but in the toplevel Makefile because other tools will want to use libtraceevent.a too and link against it. Oh well, the toplevel Makefile patches aren't upstream either so we're wasting cycles here, I'll fix that up when the times comes. Thanks. -- Regards/Gruss, Boris.