From: Bruce Richardson <bruce.richardson@intel.com>
To: Marat Khalili <marat.khalili@huawei.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
"stephen@networkplumber.org" <stephen@networkplumber.org>
Subject: Re: [PATCH] app/test: simplify getting the current file prefix
Date: Mon, 23 Feb 2026 16:56:00 +0000 [thread overview]
Message-ID: <aZyGoLDWXJn-pPu3@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <3ea36267a2594b27b017284d0eba2a30@huawei.com>
On Mon, Feb 23, 2026 at 11:21:30AM +0000, Marat Khalili wrote:
> > diff --git a/app/test/process.h b/app/test/process.h
> > index 402dc4f96f..1ab5671943 100644
> > --- a/app/test/process.h
> > +++ b/app/test/process.h
> > @@ -8,12 +8,11 @@
> > #include <errno.h> /* errno */
> > #include <limits.h> /* PATH_MAX */
> > #ifndef RTE_EXEC_ENV_WINDOWS
> > -#include <libgen.h> /* basename et al */
> > #include <sys/wait.h>
> > #endif
> > #include <stdlib.h> /* NULL */
> > #include <string.h> /* strerror */
> > -#include <unistd.h> /* readlink */
> > +#include <unistd.h>
>
> Can we delete it entirely? Compiles for me at least.
>
I believe there are still functions used from it, so I would keep it for
safety.
> > #include <dirent.h>
> >
> > #include <rte_string_fns.h> /* strlcpy */
> > @@ -239,17 +238,7 @@ file_prefix_arg(void)
> > static inline char *
> > get_current_prefix(char *prefix, int size)
> > {
> > - char buf[PATH_MAX];
> > -
> > - /* get file for config (fd is always 3) return NULL on error */
> > - if (readlink("/proc/self/fd/3", buf, sizeof(buf)) == -1)
> > - return NULL;
> > -
> > - /*
> > - * path should be something like "/var/run/dpdk/config"
> > - * which results in prefix of "dpdk"
> > - */
> > - rte_basename(dirname(buf), prefix, size);
> > + rte_basename(rte_eal_get_runtime_dir(), prefix, size);
> > return prefix;
>
> Do we even need it as a separate function anymore?
>
This function is used in test_eal_flags.c, which is why it's left here as
separate function.
> > }
> >
> > @@ -260,12 +249,8 @@ file_prefix_arg(void)
> > static char prefix[NAME_MAX + sizeof("--file-prefix=")];
> > char tmp[NAME_MAX];
> >
> > - if (get_current_prefix(tmp, sizeof(tmp)) == NULL) {
> > - fprintf(stderr, "Error - unable to get current prefix!\n");
> > - return NULL;
> > - }
> > -
> > - snprintf(prefix, sizeof(prefix), "--file-prefix=%s", tmp);
> > + snprintf(prefix, sizeof(prefix), "--file-prefix=%s",
> > + get_current_prefix(tmp, sizeof(tmp)));
> > return prefix;
> > #endif
> > }
> > --
> > 2.51.0
>
> With or without comments above addressed,
> Acked-by: Marat Khalili <marat.khalili@huawei.com>
>
> Tested-by: Marat Khalili <marat.khalili@huawei.com>
next prev parent reply other threads:[~2026-02-23 16:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 17:49 [PATCH] app/test: simplify getting the current file prefix Bruce Richardson
2026-02-23 11:21 ` Marat Khalili
2026-02-23 16:56 ` Bruce Richardson [this message]
2026-02-25 16:20 ` [PATCH v2 1/2] app/test: fix ifdefs in header for managing subprocesses Bruce Richardson
2026-02-25 16:20 ` [PATCH v2 2/2] app/test: simplify getting the current file prefix Bruce Richardson
2026-03-05 16:35 ` David Marchand
2026-02-26 17:04 ` [PATCH v2 1/2] app/test: fix ifdefs in header for managing subprocesses Marat Khalili
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=aZyGoLDWXJn-pPu3@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=marat.khalili@huawei.com \
--cc=stephen@networkplumber.org \
/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