From patchwork Tue Oct 22 09:32:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 61634 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 25C2E1BEBD; Tue, 22 Oct 2019 11:33:26 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 475711BEB5 for ; Tue, 22 Oct 2019 11:33:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571736804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=n9sZBS755SLRdw+nHNwHB3X5DIoduPOYixFfElc5oms=; b=MEzXDfz+kkle5ClNWLT6zHRHc+rBvYW/9MyccIDKCpetE6KhH1BVeDeGmymo4VO4PB5wiO vSUvSgwqNnN6IsvZOyL/TNDO00ZKgkRq1mwiIEYupDLOrzWIGsHbtxPg2hi6swwH5w5erU sqsHUvjtZMr0831Z4iLf7UKHnOA1juM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-KMJ60vrgOweKD6qW18i93g-1; Tue, 22 Oct 2019 05:33:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7E215F0; Tue, 22 Oct 2019 09:33:20 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 839D86012D; Tue, 22 Oct 2019 09:33:19 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stephen@networkplumber.org, anatoly.burakov@intel.com, thomas@monjalon.net Date: Tue, 22 Oct 2019 11:32:41 +0200 Message-Id: <1571736761-32134-9-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571736761-32134-1-git-send-email-david.marchand@redhat.com> References: <1571736761-32134-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: KMJ60vrgOweKD6qW18i93g-1 X-Mimecast-Spam-Score: 0 Subject: [dpdk-dev] [PATCH 8/8] log: hide internal log structure 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" No need to expose rte_logs, hide it and remove it from the current ABI. Signed-off-by: David Marchand Acked-by: Stephen Hemminger --- lib/librte_eal/common/eal_common_log.c | 23 ++++++++++++++++------- lib/librte_eal/common/include/rte_log.h | 20 +++----------------- lib/librte_eal/rte_eal_version.map | 1 - 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c index cfe9599..3a7ab88 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -17,13 +17,6 @@ #include "eal_private.h" -/* global log structure */ -struct rte_logs rte_logs = { - .type = ~0, - .level = RTE_LOG_DEBUG, - .file = NULL, -}; - struct rte_eal_opt_loglevel { /** Next list entry */ TAILQ_ENTRY(rte_eal_opt_loglevel) next; @@ -58,6 +51,22 @@ struct rte_log_dynamic_type { uint32_t loglevel; }; +/** The rte_log structure. */ +struct rte_logs { + uint32_t type; /**< Bitfield with enabled logs. */ + uint32_t level; /**< Log level. */ + FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */ + size_t dynamic_types_len; + struct rte_log_dynamic_type *dynamic_types; +}; + +/* global log structure */ +static struct rte_logs rte_logs = { + .type = ~0, + .level = RTE_LOG_DEBUG, + .file = NULL, +}; + /* per core log */ static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg); diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/include/rte_log.h index 1bb0e66..a8d0eb7 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -26,20 +26,6 @@ extern "C" { #include #include -struct rte_log_dynamic_type; - -/** The rte_log structure. */ -struct rte_logs { - uint32_t type; /**< Bitfield with enabled logs. */ - uint32_t level; /**< Log level. */ - FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */ - size_t dynamic_types_len; - struct rte_log_dynamic_type *dynamic_types; -}; - -/** Global log information */ -extern struct rte_logs rte_logs; - /* SDK log type */ #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ #define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */ @@ -260,7 +246,7 @@ void rte_log_dump(FILE *f); * to rte_openlog_stream(). * * The level argument determines if the log should be displayed or - * not, depending on the global rte_logs variable. + * not, depending on the global log level and the per logtype level. * * The preferred alternative is the RTE_LOG() because it adds the * level and type in the logged string. @@ -291,8 +277,8 @@ int rte_log(uint32_t level, uint32_t logtype, const char *format, ...) * to rte_openlog_stream(). * * The level argument determines if the log should be displayed or - * not, depending on the global rte_logs variable. A trailing - * newline may be added if needed. + * not, depending on the global log level and the per logtype level. + * A trailing newline may be added if needed. * * The preferred alternative is the RTE_LOG() because it adds the * level and type in the logged string. diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map index 6d7e0e4..ca9ace0 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -45,7 +45,6 @@ DPDK_2.0 { rte_log; rte_log_cur_msg_loglevel; rte_log_cur_msg_logtype; - rte_logs; rte_malloc; rte_malloc_dump_stats; rte_malloc_get_socket_stats;