From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D5BA42FA5; Mon, 31 Jul 2023 17:39:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1064F4325E; Mon, 31 Jul 2023 17:39:23 +0200 (CEST) Received: from mgamail.intel.com (unknown [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id C14DF4067B for ; Mon, 31 Jul 2023 17:39:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690817958; x=1722353958; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=52ieCOGnjcizSGMcHdVKnEmMdP+L7S4cyb7V/2ZkEkI=; b=D+yvG20ENW2SJBbNajcJDiZr3+K6MeYaEm1Xd34OSNUhLN31+If5x/ow 5abIQ3bL5Av6MbRqFXQy5VRTkzHbifIYho7IFwI64tkutmW+f0pnIxh6d JGvPIiLcydvaVqjb6k5ffIBZkzOjq756u98BHUf5seTcBLEIro2KVYhQW Iy1I1GJbtYLJWjd55/FF8nCXUX5kca1biQlos8lcdp58xkzB+CUvfV/YC TrdV71wLj6IMUnWVgV+bBDxBuo5NdDjyKRtch6pJ7Ht6DTfMjb2dcQ4lD S+OwnMNh17FWo3vF4XL0Vt1DJiWy3yxhg+l0sBJiROkL18qh7XdxTAOPB g==; X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="432868960" X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; d="scan'208";a="432868960" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Jul 2023 08:39:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10788"; a="974909572" X-IronPort-AV: E=Sophos;i="6.01,244,1684825200"; d="scan'208";a="974909572" Received: from silpixa00401385.ir.intel.com ([10.237.214.14]) by fmsmga006.fm.intel.com with ESMTP; 31 Jul 2023 08:39:15 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Tyler Retzlaff Subject: [PATCH v7 3/3] telemetry: use standard logging Date: Mon, 31 Jul 2023 16:39:02 +0100 Message-Id: <20230731153902.2350026-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230731153902.2350026-1-bruce.richardson@intel.com> References: <20220829151901.376754-1-bruce.richardson@intel.com> <20230731153902.2350026-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Now that logging is moved out of EAL, we don't need injection of the logtype and logging function from EAL to telemetry library, simplifying things. Signed-off-by: Bruce Richardson Acked-by: Morten Brørup Acked-by: Tyler Retzlaff --- lib/eal/freebsd/eal.c | 6 +----- lib/eal/linux/eal.c | 6 +----- lib/telemetry/telemetry.c | 11 +++-------- lib/telemetry/telemetry_internal.h | 3 +-- 4 files changed, 6 insertions(+), 20 deletions(-) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index dfe973e6fd..0175d89e4b 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -898,13 +898,9 @@ rte_eal_init(int argc, char **argv) return -1; } if (rte_eal_process_type() == RTE_PROC_PRIMARY && !internal_conf->no_telemetry) { - int tlog = rte_log_register_type_and_pick_level( - "lib.telemetry", RTE_LOG_WARNING); - if (tlog < 0) - tlog = RTE_LOGTYPE_EAL; if (rte_telemetry_init(rte_eal_get_runtime_dir(), rte_version(), - &internal_conf->ctrl_cpuset, rte_log, tlog) != 0) + &internal_conf->ctrl_cpuset) != 0) return -1; } diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index 2f9203c87d..543cbe75fa 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -1333,13 +1333,9 @@ rte_eal_init(int argc, char **argv) return -1; } if (rte_eal_process_type() == RTE_PROC_PRIMARY && !internal_conf->no_telemetry) { - int tlog = rte_log_register_type_and_pick_level( - "lib.telemetry", RTE_LOG_WARNING); - if (tlog < 0) - tlog = RTE_LOGTYPE_EAL; if (rte_telemetry_init(rte_eal_get_runtime_dir(), rte_version(), - &internal_conf->ctrl_cpuset, rte_log, tlog) != 0) + &internal_conf->ctrl_cpuset) != 0) return -1; } diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c index 590720bfa6..7d0488a6d7 100644 --- a/lib/telemetry/telemetry.c +++ b/lib/telemetry/telemetry.c @@ -54,11 +54,9 @@ static struct socket v1_socket; /* socket for v1 telemetry */ static const char *telemetry_version; /* save rte_version */ static const char *socket_dir; /* runtime directory */ static rte_cpuset_t *thread_cpuset; -static rte_log_fn rte_log_ptr; -static uint32_t logtype; -#define TMTY_LOG(l, ...) \ - rte_log_ptr(RTE_LOG_ ## l, logtype, "TELEMETRY: " __VA_ARGS__) +RTE_LOG_REGISTER_DEFAULT(logtype, WARNING); +#define TMTY_LOG(l, ...) rte_log(RTE_LOG_ ## l, logtype, "TELEMETRY: " __VA_ARGS__) /* list of command callbacks, with one command registered by default */ static struct cmd_callback *callbacks; @@ -627,14 +625,11 @@ telemetry_v2_init(void) #endif /* !RTE_EXEC_ENV_WINDOWS */ int32_t -rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset, - rte_log_fn log_fn, uint32_t registered_logtype) +rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset) { telemetry_version = rte_version; socket_dir = runtime_dir; thread_cpuset = cpuset; - rte_log_ptr = log_fn; - logtype = registered_logtype; #ifndef RTE_EXEC_ENV_WINDOWS if (telemetry_v2_init() != 0) diff --git a/lib/telemetry/telemetry_internal.h b/lib/telemetry/telemetry_internal.h index 80e2bd3a49..b331e9458f 100644 --- a/lib/telemetry/telemetry_internal.h +++ b/lib/telemetry/telemetry_internal.h @@ -108,7 +108,6 @@ typedef int (*rte_log_fn)(uint32_t level, uint32_t logtype, const char *format, */ __rte_internal int -rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset, - rte_log_fn log_fn, uint32_t registered_logtype); +rte_telemetry_init(const char *runtime_dir, const char *rte_version, rte_cpuset_t *cpuset); #endif -- 2.39.2