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 39F8A43214; Fri, 27 Oct 2023 10:00:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 043184029A; Fri, 27 Oct 2023 10:00:42 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 2356C40272 for ; Fri, 27 Oct 2023 10:00:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1698393640; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9lenrYwJKplK90OyyCKbBAGuEJ4O/+RpIy0U+uFU2Vg=; b=OQ6NUGI/kr7Wio9/XaUuPE+xNfsHph78uS/5Uo+YCSSw8n8j3fjnbGcoOyIs6SPQmIopJ5 MG0TVRdbuj4agIMjUX2Y7gqV/XSRSckhUO4ha2y1Sg3k35wVFx4EmaBJgVaLsFbUujZG34 n0r+NxMy0NOXdNeUmePw9Be3bhX0LAs= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-92-3z9zFTX1Ob-jAZbZfx5yOw-1; Fri, 27 Oct 2023 04:00:38 -0400 X-MC-Unique: 3z9zFTX1Ob-jAZbZfx5yOw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5ADC51C05EDC for ; Fri, 27 Oct 2023 08:00:38 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.98]) by smtp.corp.redhat.com (Postfix) with ESMTP id C185D492BE9; Fri, 27 Oct 2023 08:00:37 +0000 (UTC) From: David Marchand 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 Message-ID: <20231027080031.251425-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 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 --- 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