All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chengwen Feng <fengchengwen@huawei.com>
To: <thomas@monjalon.net>, <dev@dpdk.org>, <david.marchand@redhat.com>
Cc: <anatoly.burakov@intel.com>, <jerinj@marvell.com>,
	<bruce.richardson@intel.com>
Subject: [PATCH v3 3/4] eal: fix trace init fail with long file-prefix
Date: Fri, 17 Jun 2022 10:29:12 +0800	[thread overview]
Message-ID: <20220617022913.47564-4-fengchengwen@huawei.com> (raw)
In-Reply-To: <20220617022913.47564-1-fengchengwen@huawei.com>

Bug scenario:
1. start testpmd:
	dpdk-testpmd -l 4-6 -a 0000:7d:00.0 --trace=.* \
	--file-prefix=trace_autotest -- -i
2. then observed:
	EAL: eal_trace_init():93 failed to initialize trace \
		[No space left on device]
	EAL: FATAL: Cannot init trace
	EAL: Cannot init trace
	EAL: Error - exiting with code: 1

The root cause it that the offset set wrong with long file-prefix and
then lead the strftime return failed.

Fixes: 321dd5f8fa62 ("trace: add internal init and fini interface")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 lib/eal/common/eal_common_trace_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/common/eal_common_trace_utils.c b/lib/eal/common/eal_common_trace_utils.c
index 09f97d3c34..2b55dbec65 100644
--- a/lib/eal/common/eal_common_trace_utils.c
+++ b/lib/eal/common/eal_common_trace_utils.c
@@ -104,7 +104,7 @@ trace_session_name_generate(char *trace_dir)
 	rc = rte_strscpy(trace_dir, eal_get_hugefile_prefix(),
 			TRACE_PREFIX_LEN);
 	if (rc == -E2BIG)
-		rc = TRACE_PREFIX_LEN;
+		rc = TRACE_PREFIX_LEN - 1;
 	trace_dir[rc++] = '-';
 
 	rc = strftime(trace_dir + rc, TRACE_DIR_STR_LEN - rc,
-- 
2.33.0


  parent reply	other threads:[~2022-06-17  2:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 12:00 [PATCH] eal: fix segment fault when exit trace Chengwen Feng
2022-06-07 12:26 ` fengchengwen
2022-06-13 14:15   ` David Marchand
2022-06-14  0:33     ` fengchengwen
2022-06-07 13:00 ` David Marchand
2022-06-08 10:31 ` Jerin Jacob
2022-06-14  5:58 ` [PATCH v2 0/3] bugfix for trace Chengwen Feng
2022-06-14  5:58   ` [PATCH v2 1/3] eal: fix segment fault when exit trace Chengwen Feng
2022-06-14  8:25     ` David Marchand
2022-06-14  5:58   ` [PATCH v2 2/3] eal: fix trace init fail with long file-prefix Chengwen Feng
2022-06-15 14:02     ` David Marchand
2022-06-15 18:11       ` Jerin Jacob
2022-06-14  5:59   ` [PATCH v2 3/3] test: support trace-autotest when enable trace Chengwen Feng
2022-06-15 14:00     ` David Marchand
2022-06-17  2:42       ` fengchengwen
2022-06-21  9:06         ` David Marchand
2022-06-17  2:29 ` [PATCH v3 0/4] bugfix for trace Chengwen Feng
2022-06-17  2:29   ` [PATCH v3 1/4] eal: fix segment fault when exit trace Chengwen Feng
2022-06-17  2:29   ` [PATCH v3 2/4] eal: fix errno not set if strftime return zero Chengwen Feng
2022-06-21  9:05     ` David Marchand
2022-06-17  2:29   ` Chengwen Feng [this message]
2022-06-17  2:29   ` [PATCH v3 4/4] test: introduce trace-autotest with traces enabled Chengwen Feng
2022-06-21  9:07     ` David Marchand
2022-06-21  9:07   ` [PATCH v3 0/4] bugfix for trace 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=20220617022913.47564-4-fengchengwen@huawei.com \
    --to=fengchengwen@huawei.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=thomas@monjalon.net \
    /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.