DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: ktraynor@redhat.com
Subject: [PATCH] eal/unix: lower log level for reading files
Date: Fri, 27 Oct 2023 10:00:30 +0200	[thread overview]
Message-ID: <20231027080031.251425-1-david.marchand@redhat.com> (raw)

The eal_parse_sysfs_value helper both returns an error code and logs an
error level message when something goes wrong.
On the other hand, internal users of this helper either ignore this
error code (like when trying to find out some numa information from the
Linux sysfs, or discovering some optional feature), or add their own error
logging when reading the file actually matters.

Lower this helper log messages to debug level as it provides no useful
information to final DPDK users.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/eal/unix/eal_filesystem.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/eal/unix/eal_filesystem.c b/lib/eal/unix/eal_filesystem.c
index afbab9368a..282df50347 100644
--- a/lib/eal/unix/eal_filesystem.c
+++ b/lib/eal/unix/eal_filesystem.c
@@ -84,20 +84,20 @@ int eal_parse_sysfs_value(const char *filename, unsigned long *val)
 	char *end = NULL;
 
 	if ((f = fopen(filename, "r")) == NULL) {
-		RTE_LOG(ERR, EAL, "%s(): cannot open sysfs value %s\n",
+		RTE_LOG(DEBUG, EAL, "%s(): cannot open sysfs value %s\n",
 			__func__, filename);
 		return -1;
 	}
 
 	if (fgets(buf, sizeof(buf), f) == NULL) {
-		RTE_LOG(ERR, EAL, "%s(): cannot read sysfs value %s\n",
+		RTE_LOG(DEBUG, EAL, "%s(): cannot read sysfs value %s\n",
 			__func__, filename);
 		fclose(f);
 		return -1;
 	}
 	*val = strtoul(buf, &end, 0);
 	if ((buf[0] == '\0') || (end == NULL) || (*end != '\n')) {
-		RTE_LOG(ERR, EAL, "%s(): cannot parse sysfs value %s\n",
+		RTE_LOG(DEBUG, EAL, "%s(): cannot parse sysfs value %s\n",
 				__func__, filename);
 		fclose(f);
 		return -1;
-- 
2.41.0


             reply	other threads:[~2023-10-27  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  8:00 David Marchand [this message]
2023-10-27  9:00 ` Morten Brørup
2023-10-27  9:13   ` David Marchand
2023-10-30 10:34     ` Thomas Monjalon
2023-10-30 10:45       ` Morten Brørup

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=20231027080031.251425-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).