From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8D3F1A0350; Sun, 21 Jun 2020 11:30:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C56E71C00F; Sun, 21 Jun 2020 11:30:56 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2046.outbound.protection.outlook.com [40.107.21.46]) by dpdk.org (Postfix) with ESMTP id 88A5D1C002 for ; Sun, 21 Jun 2020 11:30:55 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RiMfVDXK1xo0zmkaMjosvdLlrgcFRHBoNXnihoNJvo3oOTHHJpfTRLGgvP2keSrFOk5/jLeS65ZrRJPs1aXoCTaj9gO5tJI4EcOxXRu7dC5N8l5EE8vlcyBv1V6xQ9CTVIA27HdTb/nJP2b5hPLnnGNXy5IEsOnp44mc1n7U4PyMePnPCVjLwZs9tJbhJ/+AJsa+4icpA4TPds80CFsetpbKi820XZhF/4uvEFsiAKYp1nJpflZSWEDcdlUsAC3x8one4lp11T0/aCRYX3XYPQqYAT6xCIzhCgq/udM4Bi9/rCVjkvBpNXWtr7ys8DUcBJ4EdpQ9L/atR2e3lxINZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mnjudpvkG/b4Gjy4MGBCMWJYHbl7Vzv8oHpTKFQ8zJc=; b=kunXt3WFniAJj/Gc2jhhsae7477AxWZe/+Yesx8q+KWpAoSlfOioubYOLyD+SOgBNffmf79Aml22bXa2yfdJ+apvGmEGevUGBOOSh9EnGWkbjfzwRH6oDcghoJ7495cjnwxLyZr6dSYiWdX8ir2W6scwAs6a1siGBmnIW9rLyz8Rc0e1Upg7Um+kign8yvX6NMjcD/Dg+HraCOpRAqYBBhqJgOos+F2uuNzzXBoxOieJoXxbPIlv61czWhkZsUJcRs9WMSeK5kmZ+5VDHpsPRFMcqbzEh7Z24rryZs/L7EirBQh9GfjaLUtWOzv/WMIh5IsfKAXgYxwf9D+R7URhiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mnjudpvkG/b4Gjy4MGBCMWJYHbl7Vzv8oHpTKFQ8zJc=; b=ZRX1uBK1kwivv/iRx5r0ex7ZuEo40Sbr+vGXuvqjJJIuE6swHW2Yrgw/ob4xR+NUvDzwyEhLAntEdkDhVdlxAbKjY6dQF0AOtEcDiaJkAcbzsi8AOMnvg3lw9GrCsCzQYm1s0mEHB15jHrXf8ifZmR2waLIpJFzZE4+JcWCeIqA= Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=oss.nxp.com; Received: from VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) by VI1PR04MB5519.eurprd04.prod.outlook.com (2603:10a6:803:cf::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Sun, 21 Jun 2020 09:30:52 +0000 Received: from VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::d4d6:f65d:34cd:aa43]) by VI1PR04MB5837.eurprd04.prod.outlook.com ([fe80::d4d6:f65d:34cd:aa43%3]) with mapi id 15.20.3109.025; Sun, 21 Jun 2020 09:30:52 +0000 To: jerinj@marvell.com, dev@dpdk.org Cc: thomas@monjalon.net, olivier.matz@6wind.com, david.marchand@redhat.com References: <20200617063047.1555518-1-jerinj@marvell.com> <20200617063047.1555518-2-jerinj@marvell.com> From: "Sachin Saxena (OSS)" Message-ID: <3ab7bcf6-b79e-34f7-7802-289c7cd0ca81@oss.nxp.com> Date: Sun, 21 Jun 2020 15:00:43 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 In-Reply-To: <20200617063047.1555518-2-jerinj@marvell.com> Content-Language: en-US X-ClientProxiedBy: SG2PR06CA0167.apcprd06.prod.outlook.com (2603:1096:1:1e::21) To VI1PR04MB5837.eurprd04.prod.outlook.com (2603:10a6:803:ec::28) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.10] (223.190.62.152) by SG2PR06CA0167.apcprd06.prod.outlook.com (2603:1096:1:1e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.22 via Frontend Transport; Sun, 21 Jun 2020 09:30:50 +0000 X-Originating-IP: [223.190.62.152] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d881d8d3-6613-45c5-3f33-08d815c5ca6f X-MS-TrafficTypeDiagnostic: VI1PR04MB5519: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 04410E544A X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: waXLjLAPStCLg2333zS4s/Pamnu4e5TE5/GS9as4BI6XOlZG+QJAQviGGjhPGpY65pPLZsX30CTpk/Xa5vyyNNkREVsJ3umpOP/ido/GP8rs5kESF8emtITFdEKEvn/lLW3mxCU4vKmN6adwa0yrWwdzKUVIBMvmvYpN9Ybsq6tqRJH+bYkMYJQb/Jhoc+y3oDiYZi1XhG9ee6pw4ZqNP+rvdtEXPc1AaGDY7VajOde5Yp22bU5Brz7BEipxDr7dWw3JgeNkDoeRWbu3aGszJ2tSEB1Q3owS2YJ6ji40FyYZqmdnPi4dG69CJukWUpUZjTsjxdn7smAVn9kNAaZOzoUKfL9l1fDAGI7G7N0nx/jWrDxb9PTRFT/oowL2KvbI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB5837.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(39850400004)(376002)(136003)(346002)(366004)(186003)(16526019)(26005)(8676002)(31686004)(956004)(2616005)(86362001)(66946007)(6666004)(66476007)(5660300002)(2906002)(66556008)(31696002)(83380400001)(478600001)(53546011)(8936002)(4326008)(52116002)(33964004)(6486002)(16576012)(316002)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 3ZCRKESWYlrIeNaljEIFhm8QHSYueFZ9w/KH4BuR6GltVeurBJuxDKdEF8nzaO4WIVDZAn7gaFcv/exhXADOXljZLsDhRA7ZTqNhi2E0zoICvyWFAx/XeItIPhkFl9iTfo9ixO4X9DpKHRIKe+esCFQjnspz59oPsYdCGKcPnDmDEPi8w96Vt/EdkIwEYivSenORqN4jmiHOlsVV2TCSMimwKIjajUWWZ1HcolbEG6ESW0C9Zn50vW9NssryXFF2eoVVWd41XVGPvBndlD2w6rCRGx/YCmpa4OHh1gzjQwrftGFO5WrzmW4XZ1/2obD8uSNjFE47APLy1JF7W89BGJ31FNh6C3QjID0uJKloE3depHBEMdkQT1AM6wRJgsaBd51ONbIi3SRqu4Gx4r97Z/KpPSm4TBh6HbQWZj23J90Z4exMWtdjXZIAxTxfyVNa23CEi3gegzPWbETzTCIpYIT4c+YKhpcIqlC1wkKInUZ8undiMYsa81yyMpCMQudO X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d881d8d3-6613-45c5-3f33-08d815c5ca6f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2020 09:30:52.4932 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BBA4m82KPno+YXoNe04ymZ+wv1jh6pC+rzxfnaz+nLYPV0l+WIXw0COK0Oc8nb6RsokPTbSQnPRXSe9WMSKOeQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5519 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 01/13] eal/log: introduce log register macro 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 17-Jun-20 12:00 PM, jerinj@marvell.com wrote: > From: Jerin Jacob > > Introducing the RTE_LOG_REGISTER macro to avoid the code duplication > in the log registration process. > > It is a wrapper macro for declaring the logtype, register the log and sets > it's level in the constructor context. > > Signed-off-by: Jerin Jacob > --- > lib/librte_eal/include/rte_log.h | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h > index 1789ede56..4dc357074 100644 > --- a/lib/librte_eal/include/rte_log.h > +++ b/lib/librte_eal/include/rte_log.h > @@ -376,6 +376,31 @@ int rte_vlog(uint32_t level, uint32_t logtype, const char *format, va_list ap) > RTE_LOGTYPE_ ## t, # t ": " __VA_ARGS__) : \ > 0) > > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice > + * > + * Register a dynamic log type in constructor context with its name and level. > + * > + * It is a wrapper macro for declaring the logtype, register the log and sets > + * it's level in the constructor context. > + * > + * @param type > + * The log type identifier > + * @param name > + * Name for the log type to be registered > + * @param level > + * Log level. A value between EMERG (1) and DEBUG (8). > + */ > +#define RTE_LOG_REGISTER(type, name, level) \ > +int type; \ > +RTE_INIT(__##type) \ > +{ \ > + type = rte_log_register(RTE_STR(name)); \ > + if (type >= 0) \ > + rte_log_set_level(type, RTE_LOG_##level); \ > +} > + > #ifdef __cplusplus > } > #endif Do we like to add some way of notifying the driver (may be simple print) regarding failure case of "rte_log_*" API?