From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0082.outbound.protection.outlook.com [104.47.32.82]) by dpdk.org (Postfix) with ESMTP id 99A8B1BE0 for ; Tue, 4 Sep 2018 06:03:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CDBPEO4EvPgjxBzatpN4nK0kxZxveYSWLR1fpQtSGI8=; b=Z8KYiSkUToYJRF+pfjxNB65eRbPoFM1K7TYraqBiMj9A+8tJXg2n1PVRM+20JQXXBBj5sr4EiAdsqZ6SwMkXLnMVAckz+/vigs6rdvuhxAr0nJS4tZZ57+JkgON5T5PBor9pCffaai5a+/rfM/Y0QUGLzf4DuBcwFc35riceudQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anoob.Joseph@cavium.com; Received: from ajoseph83.caveonetworks.com.com (115.113.156.2) by BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.15; Tue, 4 Sep 2018 04:01:49 +0000 From: Anoob Joseph To: Akhil Goyal , Pablo de Lara , Thomas Monjalon Cc: Ankur Dwivedi , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Anoob Joseph , Murthy NSSR , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj Date: Tue, 4 Sep 2018 09:28:49 +0530 Message-Id: <1536033560-21541-3-git-send-email-ajoseph@caviumnetworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> References: <1528476325-15585-1-git-send-email-anoob.joseph@caviumnetworks.com> <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [115.113.156.2] X-ClientProxiedBy: BMXPR01CA0023.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::33) To BYAPR07MB4902.namprd07.prod.outlook.com (2603:10b6:a02:ef::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 410d8f72-e93b-4807-71f4-08d6121b261b X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4902; X-Microsoft-Exchange-Diagnostics: 1; BYAPR07MB4902; 3:mc+nInErFWaBaUFOTRSzTkVP+L/ps+tHBKSXRFP4y+TxvCNK9rMD2qnEXx1LQ0HvMFrLr9Qpm34JtgHqZ13vKva6m1leOTLT1HAlbPXMcqNnZtlQV7BuuhPtrTYeOh/6S4qJ66KcxAja4gdhkBF3/8mOBsHuBUgWnjdn8nCVhVQgAVOs93znbJM/9PwSB3xuIp6A3grzXP2alOsfkM/3DCd9XbtWEB8Cla9EICG8v+deX6tIN3E9Sa/muROHkYvs; 25:GpZvnHlmGNVjjE/Z+Q+J4TgJelOjwT/wIxWCHtdFLbPu7jZLyNPsyzs8caCYnAOvK61GQ165DbbvCbcnPGja5i6OsY7y1khwym+aooGexzBwqseyq+PuuAQY07ztTbKHzgyObhnZavyMVU7P70tDz+y0/F9LjsilrvcNmYYz+rC/h0Atd7h0Qc2l/lx/56x1fmgQs2zrLupBAaJBkfYQNRNubeVQQ5vxgrkW562ycxTZ9OH5qW2BMCg+8DPmSM3kVy8OdgkIe5yTxbligJdCHA22fSYM+rGbkK/Z/7PGFhDDEYckLECmNhGH8Iz/dxhsJFbNuKnp87G7E4KDNwfVLQ==; 31:SZpZzKnvQc/REB8bU7DFeKqwBJuKU2AZ7ie2SDLGIbTJTKWNFVCAsfz3UdVAvF79cx8RF3lgBbWJ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CFzdJy9uS4l7RciZrpea7JHZyX4eH1sLru95WYrF8KyzYhuySawZYg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(201708071742011)(7699016); SRVR:BYAPR07MB4902; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4902; X-Forefront-PRVS: 0785459C39 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(346002)(376002)(39860400002)(199004)(189003)(26005)(51416003)(52116002)(76176011)(81166006)(305945005)(81156014)(7736002)(105586002)(316002)(6506007)(106356001)(6512007)(8936002)(446003)(54906003)(25786009)(68736007)(50226002)(110136005)(53936002)(16586007)(42882007)(386003)(5660300001)(2906002)(72206003)(50466002)(6486002)(36756003)(6116002)(107886003)(2616005)(14444005)(186003)(3846002)(478600001)(66066001)(476003)(8676002)(47776003)(486006)(956004)(48376002)(11346002)(4326008)(97736004)(16526019); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4902; H:ajoseph83.caveonetworks.com.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR07MB4902; 23:w39/S0OrGHdltqHHEc+zr1oK0ySNO1sBLtg5U0uWc?= =?us-ascii?Q?UR2XSIUw4+2j+Z/LMsQGAcPXcCAF3ZwYJE868Uyeqt1skfuH39xrZd9PDI7X?= =?us-ascii?Q?vmmu2v2fNt+H+Ra5lL/p9Ma4LF+nw1ATyvpoq56UgB107hNYJAbwuctCz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ONgsBG17WQrO+qUED5ljvK7yCVHm1b1Sb6DBZ68j6ngH/k+EQ7e3S++fTLZra1y5TZW21C5Q3WYP2lBaaTp5eaPFVtpyEiNsAS9Lhr7Sxw==; 5:x5b/wd7iWytwKf/coPNayoncLPv2Nm+XZZZeqc+3U1YBvy2qcFfPAizuxbTEMVG+BWuctv+LbU9ZxP1/yiNdzMILv7h0l7sPDmA8zeIm5iNonb6ucutpSZOLtwnnUpag4bTl0qGuFDdPRlW+38nXyAJxd+N7rjsGNgVyZ0gsPHI=; 7:C2TY+p5km/XA1ICRUfVJpcY8B8tQaEeOyRva66D0qjqCJr78VO45bR96Gw9b+oT0r+l1Pi4QpeVJm4Xb/0teSFl64NmERzrUuExczLiRrFWBRE9wLFuKCqD+1j31RVm0apMGtlmxI3MV8jAnCkWvhlfrtEdLZX5mlFq45vMsH/HgJixALgI9MpT8SblaXgz6/sccIscpo8fuGHVLo5ceJkoC67+9za64+FU7f72Ql1JdFD5TFrleJva1jjiDQw6c SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 04:01:49.3191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 410d8f72-e93b-4807-71f4-08d6121b261b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4902 Subject: [dpdk-dev] [PATCH v2 02/33] common/cpt: add common logging support 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, 04 Sep 2018 04:03:05 -0000 From: Ankur Dwivedi Add common logging macros Signed-off-by: Ankur Dwivedi Signed-off-by: Anoob Joseph Signed-off-by: Murthy NSSR Signed-off-by: Nithin Dabilpuram Signed-off-by: Ragothaman Jayaraman Signed-off-by: Srisivasubramanian S Signed-off-by: Tejasree Kondoj --- drivers/common/cpt/cpt_pmd_logs.h | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 drivers/common/cpt/cpt_pmd_logs.h diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h new file mode 100644 index 0000000..e1bfbb3 --- /dev/null +++ b/drivers/common/cpt/cpt_pmd_logs.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Cavium, Inc + */ + +#ifndef _CPT_PMD_LOGS_H_ +#define _CPT_PMD_LOGS_H_ + +#include + +/* + * This file defines log macros + */ + +#define CPT_PMD_DRV_LOG_RAW(level, fmt, args...) \ + rte_log(RTE_LOG_ ## level, cpt_logtype, \ + "cpt: %s(): " fmt "\n", __func__, ##args) + +#define CPT_PMD_INIT_FUNC_TRACE() CPT_PMD_DRV_LOG_RAW(DEBUG, " >>") +#define CPT_PMD_DRV_LOG(level, args...) \ + CPT_PMD_DRV_LOG_RAW(level, ##args) + +#define CPT_LOG_INFO(fmt, args...) \ + CPT_PMD_DRV_LOG_RAW(INFO, fmt, ## args) +#define CPT_LOG_WARN(fmt, args...) \ + CPT_PMD_DRV_LOG_RAW(WARNING, fmt, ## args) +#define CPT_LOG_ERR(fmt, args...) \ + CPT_PMD_DRV_LOG_RAW(ERR, fmt, ## args) + +/* + * DP logs, toggled out at compile time if level lower than current level. + * DP logs would be logged under 'PMD' type. So for dynamic logging, the + * level of 'pmd' has to be used. + */ +#define CPT_LOG_DP(level, fmt, args...) \ + RTE_LOG_DP(level, PMD, fmt "\n", ## args) + +#define CPT_LOG_DP_DEBUG(fmt, args...) \ + CPT_LOG_DP(DEBUG, fmt, ## args) +#define CPT_LOG_DP_INFO(fmt, args...) \ + CPT_LOG_DP(INFO, fmt, ## args) +#define CPT_LOG_DP_WARN(fmt, args...) \ + CPT_LOG_DP(WARNING, fmt, ## args) +#define CPT_LOG_DP_ERR(fmt, args...) \ + CPT_LOG_DP(ERR, fmt, ## args) + +/* + * cpt_logtype will be used for common logging. This field would be intiailized + * by otx_* driver routines during PCI probe. + */ +int cpt_logtype; + +#endif /* _CPT_PMD_LOGS_H_ */ -- 2.7.4