From: Hui Su <sh_def@163.com>
To: Ian Rogers <irogers@google.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Jiri Olsa <jolsa@kernel.org>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] perf thread_map: Deduplicate numerically equivalent PID and TID strings
Date: Tue, 22 Sep 2026 02:42:14 +0900 [thread overview]
Message-ID: <45a1bcb861cbe6fbdf3c04831dca53ad.sh_def@163.com> (raw)
In-Reply-To: <CAP-5=fUxHz=mp=GOkZsAoXYuayYS60TKBgafTBpRjkMJU5goBg@mail.gmail.com>
> Why not parse the pid_str into the intlist and then remove duplicates?
Good point. I initially kept the strlist and used a separate intlist as a
seen-set to minimize the change.
One wrinkle is that intlist__new(pid_str) currently treats duplicate numeric
values as an error: intlist__parse_list() propagates -EEXIST from
intlist__add(). Thus, "123,0123" currently makes intlist__new() fail instead
of deduplicating the values.
I think the cleaner solution is to make intlist parsing fold duplicate values,
for example by using intlist__findnew(), and then iterate the intlist directly
in the PID/TID paths. That removes both the extra strlist and the separate
seen-set.
I'll check whether any existing intlist__new() users rely on duplicates being
rejected, and whether any thread_map callers rely on the current lexicographic
ordering from strlist, since intlist iteration is numeric.
I'll rework it that way for v3.
Thanks,
Hui
prev parent reply other threads:[~2026-09-21 17:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 3:11 [PATCH] " Hui Su
2026-09-12 5:17 ` [PATCH v2] " Hui Su
2026-09-14 1:19 ` Namhyung Kim
2026-09-21 16:10 ` Ian Rogers
2026-09-21 17:42 ` Hui Su [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=45a1bcb861cbe6fbdf3c04831dca53ad.sh_def@163.com \
--to=sh_def@163.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.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=namhyung@kernel.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
all inboxes | Powered by JetHome®