From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 373E8A0096 for ; Mon, 3 Jun 2019 19:35:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0E06D1BA64; Mon, 3 Jun 2019 19:34:54 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id E6EEE1BA64 for ; Mon, 3 Jun 2019 19:34:51 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x53HKMDE027514; Mon, 3 Jun 2019 10:34:51 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=rpgUILtyAp2qJyqBVXYo+jIPPNBVfOX+xy2skWrpedY=; b=jLlqRnwR5Q9KQkzhTdA045ZtyUgHdSZHDhVntodPGHO/OlSf5DIx736oNvxAT3ipw8n+ T5/9MrodIKHo30BYReofjijlywOG7pBX/9ACzgZba4snppAFKl+DQLcLuubPd2/QPn46 ZZXxXAqZx+S1Nic2P3MQyvO0c+NYH9uWdBWlK8yepvZIr3JrXILK62uCt5nqoFlV0X5g uyESfClpTj3MbQdN2w5TrS+IhdWi9QDe8PRxEA7w4qqKBav66oxFVZbTnS/uPFqbWsMz L7LlaK5O4stFi/TLYMIgFrl4cpBmJggN4p/gDCIxAHs9d6gCHCv5sujsBXX7tVAwdnso /Q== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2sw79pr6up-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 03 Jun 2019 10:34:51 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 3 Jun 2019 10:34:49 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Mon, 3 Jun 2019 10:34:49 -0700 Received: from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56]) by maili.marvell.com (Postfix) with ESMTP id 296DC3F703F; Mon, 3 Jun 2019 10:34:44 -0700 (PDT) From: Anoob Joseph To: Jerin Jacob , Nikhil Rao , "Erik Gabriel Carrillo" , Abhinandan Gujjar , Bruce Richardson , Pablo de Lara CC: Anoob Joseph , Narayana Prasad , , Lukasz Bartosik , Pavan Nikhilesh , Hemant Agrawal , "Nipun Gupta" , Harry van Haaren , =?UTF-8?q?Mattias=20R=C3=B6nnblom?= , Liang Ma Date: Mon, 3 Jun 2019 23:02:15 +0530 Message-ID: <1559583160-13944-16-git-send-email-anoobj@marvell.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1559583160-13944-1-git-send-email-anoobj@marvell.com> References: <1559583160-13944-1-git-send-email-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-03_13:, , signatures=0 Subject: [dpdk-dev] [PATCH 15/39] eventdev: add routines for logging eventmode helper 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" Adding routines for logging eventmode helper. Signed-off-by: Anoob Joseph Signed-off-by: Lukasz Bartosik --- config/common_base | 1 + lib/librte_eal/common/eal_common_log.c | 1 + lib/librte_eal/common/include/rte_log.h | 1 + .../rte_eventmode_helper_internal.h | 29 ++++++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/config/common_base b/config/common_base index 8576973..96c2537 100644 --- a/config/common_base +++ b/config/common_base @@ -685,6 +685,7 @@ CONFIG_RTE_LIBRTE_PMD_ZLIB=n # CONFIG_RTE_LIBRTE_EVENTDEV=y CONFIG_RTE_LIBRTE_EVENTDEV_DEBUG=n +CONFIG_RTE_LIBRTE_EVENTMODE_HELPER_DEBUG=n CONFIG_RTE_EVENT_MAX_DEVS=16 CONFIG_RTE_EVENT_MAX_QUEUES_PER_DEV=64 CONFIG_RTE_EVENT_TIMER_ADAPTER_NUM_MAX=32 diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index c714a4b..bc34dc2 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -324,6 +324,7 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_EFD, "lib.efd"}, {RTE_LOGTYPE_EVENTDEV, "lib.eventdev"}, {RTE_LOGTYPE_GSO, "lib.gso"}, + {RTE_LOGTYPE_EVENTMODE, "lib.eventmode"}, {RTE_LOGTYPE_USER1, "user1"}, {RTE_LOGTYPE_USER2, "user2"}, {RTE_LOGTYPE_USER3, "user3"}, diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index cbb4184..78d595c 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -62,6 +62,7 @@ extern struct rte_logs rte_logs; #define RTE_LOGTYPE_EFD 18 /**< Log related to EFD. */ #define RTE_LOGTYPE_EVENTDEV 19 /**< Log related to eventdev. */ #define RTE_LOGTYPE_GSO 20 /**< Log related to GSO. */ +#define RTE_LOGTYPE_EVENTMODE 21 /**< Log related to eventmode. */ /* these log types can be used in an application */ #define RTE_LOGTYPE_USER1 24 /**< User-defined log type 1. */ diff --git a/lib/librte_eventdev/rte_eventmode_helper_internal.h b/lib/librte_eventdev/rte_eventmode_helper_internal.h index 0da7003..7af7758 100644 --- a/lib/librte_eventdev/rte_eventmode_helper_internal.h +++ b/lib/librte_eventdev/rte_eventmode_helper_internal.h @@ -3,4 +3,33 @@ */ #ifndef _RTE_EVENTMODE_HELPER_INTERNAL_H_ #define _RTE_EVENTMODE_HELPER_INTERNAL_H_ + +#include + +/* Logging macros */ + +#define RTE_EM_HLPR_LOG_ERR(...) \ + RTE_LOG(ERR, EVENTMODE, \ + RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \ + __func__, RTE_FMT_TAIL(__VA_ARGS__ ,))) + +#define RTE_EM_HLPR_LOG_WARNING(...) \ + RTE_LOG(WARNING, EVENTMODE, \ + RTE_FMT("%s(): " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \ + __func__, RTE_FMT_TAIL(__VA_ARGS__ ,))) + +#define RTE_EM_HLPR_LOG_INFO(...) \ + RTE_LOG(INFO, EVENTMODE, \ + RTE_FMT(RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \ + RTE_FMT_TAIL(__VA_ARGS__ ,))) + +#ifdef RTE_LIBRTE_EVENTMODE_HELPER_DEBUG +#define RTE_EM_HLPR_LOG_DEBUG(...) \ + RTE_LOG(DEBUG, EVENTMODE, \ + RTE_FMT("%s() line %u: " RTE_FMT_HEAD(__VA_ARGS__ ,) "\n", \ + __func__, __LINE__, RTE_FMT_TAIL(__VA_ARGS__ ,))) +#else +#define RTE_EM_HLPR_LOG_DEBUG(...) (void)0 +#endif + #endif /* _RTE_EVENTMODE_HELPER_INTERNAL_H_ */ -- 2.7.4