From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 9C2BC8E01 for ; Tue, 19 Dec 2017 12:15:40 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1739720B2E; Tue, 19 Dec 2017 06:15:40 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 19 Dec 2017 06:15:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=JB4X+eq+mZprtvO7fQbQUzeVNS nT/NexE7BJAhg1JeU=; b=jpJ/G2ig5aes3NWqIXC0usXodejitV+QDTleqr01Sv JV9NX1dLPjKZ7L9jCyomHXqGMCn9O9Z1GfGMen/FYYIQVOYPvrU23Cwi1uEeT6fN QKuLeG0KnyjiKhzY7Kq+g9Fh97eaj98daFpPfsbxbao1fzzKLvzgRRpSHA1fZLix c= 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-sender:x-me-sender:x-sasl-enc; s=fm1; bh=JB4X+e q+mZprtvO7fQbQUzeVNSnT/NexE7BJAhg1JeU=; b=SLu3VqFw0nuWLvCluxhmpf kgfy24aFq7QQB9dX+40V2B7wpw/Bm21xPxPWUi0aJkXxtMZeYAx8CvkprTk0GLz3 P9kwA4CDnQFVBOrYTf8Y8UDrQ/tVBEVMuJtr71YjlXfc1AVTN8lkKd+J6KY3GMFR RSPuBjpZu+7BOQ9NN60HaN/Xm9rI4ERhrhz5FPsiqrMkLrrQMtu1lXdYD4xSxh/U f6xb953qGzxNvJ56AWjBruXabhu5DaTNOGdUCiGa+Lo3zIkWAwH6b5MNNLYgBqtB K5nPiwXSp85TC2/03ZP39YKEn5stH7VUHTbbWC1vq3ecOTBv5QPY4usxzcRKzKkw == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id BFCE724009; Tue, 19 Dec 2017 06:15:39 -0500 (EST) From: Thomas Monjalon To: Adrien Mazarguil Cc: dev@dpdk.org, Stephen Hemminger , Ferruh Yigit Date: Tue, 19 Dec 2017 12:15:38 +0100 Message-ID: <18024020.yCgE5lJeyx@xps> In-Reply-To: <20171219100117.GA5377@6wind.com> References: <20171124172132.GW4062@6wind.com> <20171218131751.5c5d9467@xeon-e3> <20171219100117.GA5377@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v1 1/3] net/hyperv: introduce MS Hyper-V platform driver 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: Tue, 19 Dec 2017 11:15:41 -0000 19/12/2017 11:01, Adrien Mazarguil: > On Mon, Dec 18, 2017 at 01:17:51PM -0800, Stephen Hemminger wrote: > > On Mon, 18 Dec 2017 20:54:16 +0100 > > Thomas Monjalon wrote: > > > > > > > +#endif /* RTE_LIBRTE_HYPERV_DEBUG */ > > > > > + > > > > > +#define DEBUG(...) PMD_DRV_LOG(DEBUG, __VA_ARGS__) > > > > > +#define INFO(...) PMD_DRV_LOG(INFO, __VA_ARGS__) > > > > > +#define WARN(...) PMD_DRV_LOG(WARNING, __VA_ARGS__) > > > > > +#define ERROR(...) PMD_DRV_LOG(ERR, __VA_ARGS__) > > > > > + > > > > > > > > Please don't use DEBUG() etc macros. It makes it easier for tools that do > > > > global updates or scans if all drivers use the same model of PMD_DRV_LOG > > > > > > The new standard is to use dynamic logtype. > > > > Agree, please use dynamic logging, and also don't redefine new macros like DEBUG/INFO/WARN/ERROR. > > Instead use PMD_DRV_LOG or equivalent macros. > > Wait, the above definitions are only convenience wrappers to PMD_DRV_LOG(), > itself a wrapper to RTE_LOG(), itself a wrapper to rte_log(), their presence > is not triggered according to compilation options, did I miss something? > > Let me bring back some context from the original patch: > > #ifdef RTE_LIBRTE_HYPERV_DEBUG > > #define PMD_DRV_LOG(level, ...) \ > RTE_LOG(level, PMD, \ > RTE_FMT("%s:%u: %s(): " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ > strrchr("/" __FILE__, '/') + 1, \ > __LINE__, \ > __func__, \ > RTE_FMT_TAIL(__VA_ARGS__,))) > > #else /* RTE_LIBRTE_HYPERV_DEBUG */ > > #define PMD_DRV_LOG(level, ...) \ > RTE_LOG(level, PMD, \ > RTE_FMT(RTE_STR(HYPERV_DRIVER) ": " \ > RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ > RTE_FMT_TAIL(__VA_ARGS__,))) > > #endif /* RTE_LIBRTE_HYPERV_DEBUG */ > > #define DEBUG(...) PMD_DRV_LOG(DEBUG, __VA_ARGS__) > #define INFO(...) PMD_DRV_LOG(INFO, __VA_ARGS__) > #define WARN(...) PMD_DRV_LOG(WARNING, __VA_ARGS__) > #define ERROR(...) PMD_DRV_LOG(ERR, __VA_ARGS__) > > Enabling RTE_LIBRTE_HYPERV_DEBUG adds file and line information to log > output, messages are otherwise unaffected by that compilation option. Adding > this information required some sort of wrapper to avoid needless clutter. > > Nothing against outputting file/line information when compiled in debug mode > right? I am not sure __FILE__, __LINE__ and __func__ are so much useful. The log message should be unique enough. > > The base rule here is that all drivers should look the same as much > > as reasonably possible. This makes reviewers of other subsystems more likely > > to see problems. It also allows for later changes where some developer does a global > > improvement across many PMD's. > > > > Drivers should not be snowflakes, each one is not unique. > > Point taken, do you confirm replacing i.e. WARN(...) with > PMD_DRV_LOG(WARN, ...) and friends is all that's needed? You need to remove the compile-time option for DEBUG, and rely on dynamic log type, thanks to rte_log_register().