summaryrefslogtreecommitdiff
path: root/tools/lib/perf/threadmap.c
diff options
context:
space:
mode:
authorTzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>2022-02-21 12:26:12 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-02-23 14:39:29 -0300
commit41415b8a974a311c42d48064722540e691010edc (patch)
tree05b9c02df10b5844c9453dfb6589135c8da06939 /tools/lib/perf/threadmap.c
parent521f2688c5af8442ace095815702f08c1aabcb45 (diff)
libperf: Rename arguments of perf_thread_map APIs
The "int thread" input arguments of some perf_thead_map APIs are index of the thread in the thread map. In order to avoid confusion and to make the APIs consistent with perf_cpu_map APIs, those arguments are renamed to "int idx". Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org> Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20220221102612.43879-1-tz.stoyanov@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/perf/threadmap.c')
-rw-r--r--tools/lib/perf/threadmap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/lib/perf/threadmap.c b/tools/lib/perf/threadmap.c
index e92c368b0a6c..84fa07c79d00 100644
--- a/tools/lib/perf/threadmap.c
+++ b/tools/lib/perf/threadmap.c
@@ -32,14 +32,14 @@ struct perf_thread_map *perf_thread_map__realloc(struct perf_thread_map *map, in
#define thread_map__alloc(__nr) perf_thread_map__realloc(NULL, __nr)
-void perf_thread_map__set_pid(struct perf_thread_map *map, int thread, pid_t pid)
+void perf_thread_map__set_pid(struct perf_thread_map *map, int idx, pid_t pid)
{
- map->map[thread].pid = pid;
+ map->map[idx].pid = pid;
}
-char *perf_thread_map__comm(struct perf_thread_map *map, int thread)
+char *perf_thread_map__comm(struct perf_thread_map *map, int idx)
{
- return map->map[thread].comm;
+ return map->map[idx].comm;
}
struct perf_thread_map *perf_thread_map__new_dummy(void)
@@ -85,7 +85,7 @@ int perf_thread_map__nr(struct perf_thread_map *threads)
return threads ? threads->nr : 1;
}
-pid_t perf_thread_map__pid(struct perf_thread_map *map, int thread)
+pid_t perf_thread_map__pid(struct perf_thread_map *map, int idx)
{
- return map->map[thread].pid;
+ return map->map[idx].pid;
}