]> git.ipfire.org Git - thirdparty/linux.git/commit
perf strlist: Remove dont_dupstr logic, used only once
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 27 Jan 2026 15:43:43 +0000 (12:43 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 28 Jan 2026 00:19:24 +0000 (21:19 -0300)
commit612e4022c616eba66ed15e6b7a9924251e0298e8
treed32f49d8c5273cc4444b19b9f0d5d36117bcb625
parent68abacb0686651dd3f0bbce2fa94b438afeb2fc4
perf strlist: Remove dont_dupstr logic, used only once

Ian Rogers noticed that 678ed6b707e4b2db ("perf strlist: Don't write to
const memory") breaks the 'Remove thread map' 'perf test' entry, because
it keeps pointers to the temporary string introduced to avoid touching
the const memory.

This is because the thread_map__new_by_[pt]id_str() were the only
methods using the slist->dont_dupstr knob to keep pointers to the
original const string list, as it uses strtol to parse numbers and it
stops at the comma.

As this is the only case of dont_dupstr use, dupstr being the default,
and it gets in the way of getting rid of the last const-correctness,
remove this knob, with it:

  $ perf test 37
  37: Remove thread map   : Ok
  $

Fixes: 678ed6b707e4b2db ("perf strlist: Don't write to const memory")
Reported-by: Ian Rogers <irogers@google.com>
Tested-by: Ian Rogers <irogers@google.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/strlist.c
tools/perf/util/strlist.h
tools/perf/util/thread_map.c