public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: duchangbin <changbin.du@huawei.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	"linux-perf-users@vger.kernel.org"
	<linux-perf-users@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] perf: Add layout support for --symfs option
Date: Mon, 9 Mar 2026 17:29:03 -0700	[thread overview]
Message-ID: <aa9lz9M9zTnXnAku@google.com> (raw)
In-Reply-To: <2f617208b9fd42b682380a3306c2603b@huawei.com>

On Mon, Mar 09, 2026 at 08:47:59AM +0000, duchangbin wrote:
> On Thu, Mar 05, 2026 at 05:02:17PM +0800, duchangbin wrote:
> > On Wed, Mar 04, 2026 at 10:48:00PM -0800, Namhyung Kim wrote:
> > > Hello,
> > > 
> > > > @@ -2491,16 +2492,36 @@ int symbol__config_symfs(const struct option *opt __maybe_unused,
> > > >  			 const char *dir, int unset __maybe_unused)
> > > >  {
> > > >  	char *bf = NULL;
> > > > +	char *layout_str;
> > > >  	int ret;
> > > >  
> > > > -	symbol_conf.symfs = strdup(dir);
> > > > -	if (symbol_conf.symfs == NULL)
> > > > -		return -ENOMEM;
> > > > +	layout_str = strrchr(dir, ',');
> > > > +	if (layout_str &&
> > > > +	    (!strcmp(layout_str + 1, "flat") || !strcmp(layout_str + 1, "hierarchy"))) {
> > > 
> > > I think it's better to fail with a message if unknown layout is given.
> > >
> > Agreed. The current issue is that if we use ',' as the delimiter (to maintain a
> > consistent style with other options), and the path itself contains a comma, it
> > would result in the following ambiguity:
> >  - /path,flat → symfs=/path, layout=flat
> >  - /path,hierarchy → symfs=/path, layout=hierarchy
> >  - /some,path/ → symfs=/some, layout=path/
> > 
> > Do you have better suggestions? Using a different delimiter (e.g., : or ;)?
> > 
> Finally, I've decided to go with the simplest implementation. The result is: if
> the path contains a comma, the layout must be specified, otherwise an error will
> be raised (the part after the comma would be incorrectly recognized as the
> layout option).
> 
> - /path → symfs=/path, layout=hierarchy
> - /path,flat → symfs=/path, layout=flat
> - /some,path/ → error
> - /some,path/,flat → symfs=/some,path/, layout=flat

LGTM.

Thanks,
Namhyung


      reply	other threads:[~2026-03-10  0:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-01 19:24 [PATCH v3] perf: Add layout support for --symfs option Changbin Du
2026-03-05  6:48 ` Namhyung Kim
2026-03-05  9:02   ` duchangbin
2026-03-09  8:47     ` duchangbin
2026-03-10  0:29       ` Namhyung Kim [this message]

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=aa9lz9M9zTnXnAku@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=changbin.du@huawei.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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