Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933210AbbENM5K (ORCPT ); Thu, 14 May 2015 08:57:10 -0400 Received: from szxga01-in.huawei.com ([58.251.152.64]:51315 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932490AbbENM5H (ORCPT ); Thu, 14 May 2015 08:57:07 -0400 Subject: Re: [PATCH v2 1/2] tools lib traceevent: Export dynamic symbols used by traceevent plugins To: Jiri Olsa , hekuang References: <1431412917-101336-1-git-send-email-hekuang@huawei.com> <20150512123744.GF22341@krava.redhat.com> <55521B79.60202@zoho.com> <20150513145049.GF25652@krava.redhat.com> CC: , , , , , From: He Kuang Message-ID: <55549B6F.3030701@huawei.com> Date: Thu, 14 May 2015 20:56:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: <20150513145049.GF25652@krava.redhat.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.110.54.65] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2584 Lines: 70 Hi, jirka On 2015/5/13 22:50, Jiri Olsa wrote: > On Tue, May 12, 2015 at 11:25:45PM +0800, hekuang wrote: >> Hi, jirka >> >> On 05/12/2015 08:37 PM, Jiri Olsa wrote: >>> On Tue, May 12, 2015 at 06:41:56AM +0000, He Kuang wrote: >>> >>> SNIP >>> >>>> $(Q)$(MAKE) $(build)=perf >>>> -$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) >>>> - $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(PERF_IN) $(LIBS) -o $@ >>>> +LD_LIBTRACEEVENT_FLAGS += -Xlinker --dynamic-list=$(LIBTRACEEVENT_DYNAMIC_LIST) >>>> +$(OUTPUT)perf: $(PERFLIBS) $(PERF_IN) $(LIBTRACEEVENT_DYNAMIC_LIST) >>>> + $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $(LD_LIBTRACEEVENT_FLAGS) $(PERF_IN) $(LIBS) -o $@ >>>> $(GTK_IN): FORCE >>>> $(Q)$(MAKE) $(build)=gtk >>>> @@ -373,7 +375,13 @@ $(LIB_FILE): $(LIBPERF_IN) >>>> LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) >>>> $(LIBTRACEEVENT): FORCE >>>> - $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a plugins >>>> + $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a >>>> + >>>> +libtraceevent_plugins: FORCE >>>> + $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) plugins >>>> + >>>> +$(LIBTRACEEVENT_DYNAMIC_LIST): libtraceevent_plugins >>>> + $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent-dynamic-list >>> I thought the idea of v2 was not to introduce new target, >>> something like in attached patch (not completely tested) >>> >>> jirka >> >> There is a problem, the target perf executable is dependent on >> the dynamic-list-file, so we should add plugins or the >> dynamic-list-file to perf's dependencies. >> >> As your patch below, the dynamic-list-file is built implictly >> when building plugins, so we should not add it directly to the >> dependency list of perf. >> >> It seems new targets are needed. In the v2 patch, > > hum, I dont get it.. why ? > > dynamic-list-file gets rebuilt any time plugins are rebuilt.. > why not keep just the 'plugins' dependency? You can test your patch as following steps: $ touch ../lib/traceevent/plugin_function.c $ make CC plugin_function.o LD plugin_function-in.o LINK plugin_function.so GEN libtraceevent-dynamic-list perf is not rebuilt. There should be a 'GEN perf', right? > > jirka > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/