From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by dpdk.org (Postfix) with ESMTP id D3117239 for ; Wed, 7 Nov 2018 22:08:34 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 52D3521FF1; Wed, 7 Nov 2018 16:08:31 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 07 Nov 2018 16:08:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=rD4IU8r/+/pjADWez6jsMgbS79WvLEP7I9yQNYQ+8xI=; b=Iz0J7yMK/8L/ UoiI7qd+WHrQ097YDtdQjtP/LKZbDo7aUOnpy+CQ1Vkkmhs+YkJsmc7Z7qL17vPi P/n5frFy+t/x37D52eboy/rq9kUS4y3AIJtDOJGq+w+vq5aCezCM0Cqrd09MpeI5 60UOoGVBfol/IpkCbddnXM1v/8x5Lq8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=rD4IU8r/+/pjADWez6jsMgbS79WvLEP7I9yQNYQ+8 xI=; b=dFtXLIn7oiR85tJPwBkbgZHg3IOqVzsyM7GMlxfuTKzCChIcY5LiPYLGa N7nfKjTJ6sIMz3J1JXyR5GGqtu191pVKQ5uj4EMT2tBteLvaiSCOIlQqxsKVRIXh NcgKI//cziJPTvsYUc3GSM31ISVip5nA5XbHzXW4+egU+10GFQprU9L7CU2uzomK i4w8XpqbAd3aSzjRAqKzQp31NMtI7LqV/HOyCAA1fZIpwGOB49rlFKYV4EVhbyXW /+Qhel5NTVb8q/BKKe/LpP5z5AoPd6ureMHYbl/CYJ3SJg6czUEs5xuFuCOs/u+A OQrLU5SRHfeDjcSMIloKdz/mXTTfQ== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6AF77102F2; Wed, 7 Nov 2018 16:08:29 -0500 (EST) From: Thomas Monjalon To: Kevin Laatz , harry.van.haaren@intel.com Cc: dev@dpdk.org, gaetan.rivet@6wind.com, mattias.ronnblom@ericsson.com, bruce.richardson@intel.com, radu.nicolau@intel.com, ciara.power@intel.com, brian.archbold@intel.com Date: Wed, 07 Nov 2018 22:08:28 +0100 Message-ID: <6475218.XGFdfmr2Ql@xps> In-Reply-To: <20181107181018.80224-1-kevin.laatz@intel.com> References: <20181107181018.80224-1-kevin.laatz@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] telemetry: fix shared build for make X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Nov 2018 21:08:35 -0000 07/11/2018 19:10, Kevin Laatz: > Currently, telemetry is not working for shared builds in make. > > The --as-needed flag is preventing telemetry from being linked as there are > no direct API calls from the app to telemetry. This is causing the > --telemetry option to not be recognized by EAL. > Telemetry registers it's EAL option using the RTE_INIT constructor. Since > EAL's option parsing is done before the plugins init, the --telemetry > option isn't registered at the time of parsing, and as a result, the > --telemetry option is not being recognized. I do not understand how linking is related to parsing done before plugin init. Do you mean telemetry cannot be linked with dlopen? It makes me think that we could have avoided all the rte_option infrastructure by using plugin loading. If it is built statically, we can enable telemetry with a compilation option. If it is built as a shared library, the -d option is enough. About the patch itself, > This patch fixes this issue by explicitly linking telemetry to the > application by setting the "--no-as-needed" flag for the library in > mk/rte.app.mk. > > Fixes: 8877ac688b52 ("telemetry: introduce infrastructure") > > Reported-by: Yanjie Xu > Signed-off-by: Kevin Laatz [...] > --- a/mk/rte.app.mk > +++ b/mk/rte.app.mk > +_LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += --no-as-needed > _LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += --whole-archive > _LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += -lrte_telemetry -ljansson > _LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += --no-whole-archive > +_LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += --as-needed It is forcing --as-needed even if it was disabled in LDFLAGS. I think this form may be better: --push-state,--as-needed --pop-state but it may not be supported by all linkers.