summaryrefslogtreecommitdiff
path: root/tools/perf/util/thread_map.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-24 16:17:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-24 16:17:26 +0200
commitb62ed4c93ad71374b54d2c3a72cbc67b506f580c (patch)
tree6ca6ab974bbce902fc9de300fea6aa056170850f /tools/perf/util/thread_map.c
parent5895db67c12464003afd16c08049b73aa09e58ea (diff)
parent221fc2f4d0eda59d02af2e751a9282fa013a8e97 (diff)
Merge v6.18.40linux-rolling-lts
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/util/thread_map.c')
-rw-r--r--tools/perf/util/thread_map.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index ca193c1374ed..48c70f149e92 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -164,19 +164,16 @@ static struct perf_thread_map *thread_map__new_by_pid_str(const char *pid_str)
struct dirent **namelist = NULL;
int i, j = 0;
pid_t pid, prev_pid = INT_MAX;
- char *end_ptr;
struct str_node *pos;
- struct strlist_config slist_config = { .dont_dupstr = true, };
- struct strlist *slist = strlist__new(pid_str, &slist_config);
+ struct strlist *slist = strlist__new(pid_str, NULL);
if (!slist)
return NULL;
strlist__for_each_entry(pos, slist) {
- pid = strtol(pos->s, &end_ptr, 10);
+ pid = strtol(pos->s, NULL, 10);
- if (pid == INT_MIN || pid == INT_MAX ||
- (*end_ptr != '\0' && *end_ptr != ','))
+ if (pid == INT_MIN || pid == INT_MAX)
goto out_free_threads;
if (pid == prev_pid)
@@ -223,24 +220,21 @@ struct perf_thread_map *thread_map__new_by_tid_str(const char *tid_str)
struct perf_thread_map *threads = NULL, *nt;
int ntasks = 0;
pid_t tid, prev_tid = INT_MAX;
- char *end_ptr;
struct str_node *pos;
- struct strlist_config slist_config = { .dont_dupstr = true, };
struct strlist *slist;
/* perf-stat expects threads to be generated even if tid not given */
if (!tid_str)
return perf_thread_map__new_dummy();
- slist = strlist__new(tid_str, &slist_config);
+ slist = strlist__new(tid_str, NULL);
if (!slist)
return NULL;
strlist__for_each_entry(pos, slist) {
- tid = strtol(pos->s, &end_ptr, 10);
+ tid = strtol(pos->s, NULL, 10);
- if (tid == INT_MIN || tid == INT_MAX ||
- (*end_ptr != '\0' && *end_ptr != ','))
+ if (tid == INT_MIN || tid == INT_MAX)
goto out_free_threads;
if (tid == prev_tid)