All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: david.marchand@redhat.com,
	"Bruce Richardson" <bruce.richardson@intel.com>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Tyler Retzlaff" <roretzla@linux.microsoft.com>
Subject: [PATCH v8 3/3] telemetry: use standard logging
Date: Wed,  9 Aug 2023 14:35:53 +0100	[thread overview]
Message-ID: <20230809133553.1396119-4-bruce.richardson@intel.com> (raw)
In-Reply-To: <20230809133553.1396119-1-bruce.richardson@intel.com>

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 <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 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 477ad03d38..ed50576d99 100644
--- a/lib/eal/linux/eal.c
+++ b/lib/eal/linux/eal.c
@@ -1314,13 +1314,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


  parent reply	other threads:[~2023-08-09 13:36 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 15:18 [RFC PATCH 0/3] Split logging out of EAL Bruce Richardson
2022-08-29 15:18 ` [RFC PATCH 1/3] os: begin separating some OS compatibility from EAL Bruce Richardson
2022-08-29 18:57   ` Morten Brørup
2022-08-30  8:41     ` Bruce Richardson
2022-08-30  8:42   ` David Marchand
2022-08-30  9:59     ` Bruce Richardson
2022-08-29 15:19 ` [RFC PATCH 2/3] log: separate logging functions out of EAL Bruce Richardson
2022-08-29 15:19 ` [RFC PATCH 3/3] telemetry: use standard logging Bruce Richardson
2023-01-13 16:19 ` [RFC PATCH v2 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-13 16:19   ` [RFC PATCH v2 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-13 16:41     ` Morten Brørup
2023-01-13 17:01       ` Bruce Richardson
2023-01-13 17:31         ` Tyler Retzlaff
2023-01-13 17:37           ` Bruce Richardson
2023-01-13 16:20   ` [RFC PATCH v2 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-13 16:20   ` [RFC PATCH v2 3/3] telemetry: use standard logging Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-13 20:36   ` [PATCH v3 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-13 20:36   ` [PATCH v3 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-13 20:36   ` [PATCH v3 3/3] telemetry: use standard logging Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-20 18:21   ` [PATCH v4 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-20 18:21   ` [PATCH v4 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-20 18:21   ` [PATCH v4 3/3] telemetry: use standard logging Bruce Richardson
2023-01-22 14:56   ` [PATCH v4 0/3] Split logging functionality out of EAL David Marchand
2023-01-23 14:24     ` Bruce Richardson
2023-01-23 14:31       ` David Marchand
2023-01-23 14:36         ` Bruce Richardson
2023-01-23 14:42           ` David Marchand
2023-05-18 12:49 ` [PATCH v5 " Bruce Richardson
2023-05-18 12:49   ` [PATCH v5 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-05-18 12:49   ` [PATCH v5 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-05-18 12:49   ` [PATCH v5 3/3] telemetry: use standard logging Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 0/3] Split logging functionality out of EAL Bruce Richardson
2023-07-31 10:17   ` [PATCH v6 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-07-31 10:17   ` [PATCH v6 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-07-31 10:17   ` [PATCH v6 3/3] telemetry: use standard logging Bruce Richardson
2023-07-31 15:38 ` [PATCH v7 0/3] Split logging functionality out of EAL Bruce Richardson
2023-07-31 15:39   ` [PATCH v7 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-08-09 11:18     ` David Marchand
2023-08-09 12:35       ` Bruce Richardson
2023-07-31 15:39   ` [PATCH v7 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-07-31 16:22     ` David Marchand
2023-07-31 16:29       ` Bruce Richardson
2023-08-09 10:00         ` Bruce Richardson
2023-08-09 11:58     ` David Marchand
2023-08-09 12:24     ` David Marchand
2023-08-09 12:32       ` Bruce Richardson
2023-07-31 15:39   ` [PATCH v7 3/3] telemetry: use standard logging Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 0/3] Split logging functionality out of EAL Bruce Richardson
2023-08-09 13:35   ` [PATCH v8 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-08-09 13:35   ` [PATCH v8 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-08-09 13:35   ` Bruce Richardson [this message]
2023-08-11 12:46   ` [PATCH v8 0/3] Split logging functionality " David Marchand
2023-08-11 12:59     ` Bruce Richardson
2023-09-01 11:25       ` Thomas Monjalon
2023-09-01 12:26         ` Morten Brørup
2023-10-23  7:37     ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230809133553.1396119-4-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=roretzla@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.