You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
perf tools: Use an accessor to read thread comm
As the thread comm is going to be implemented by way of a more complicated data structure than just a pointer to a string from the thread struct, convert the readers of comm to use an accessor instead of accessing it directly. The accessor will be later overriden to support an enhanced comm implementation. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Tested-by: Jiri Olsa <jolsa@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-wr683zwy94hmj4ibogmnv9ce@git.kernel.org [ Rename thread__comm_curr() to thread__comm_str() ] Signed-off-by: Namhyung Kim <namhyung@kernel.org> [ Fixed up some minor const pointer issues ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
committed by
Arnaldo Carvalho de Melo
parent
6e6dc401d5
commit
b9c5143a01
@@ -45,6 +45,11 @@ int thread__set_comm(struct thread *thread, const char *comm)
|
||||
return err;
|
||||
}
|
||||
|
||||
const char *thread__comm_str(const struct thread *thread)
|
||||
{
|
||||
return thread->comm;
|
||||
}
|
||||
|
||||
int thread__comm_len(struct thread *thread)
|
||||
{
|
||||
if (!thread->comm_len) {
|
||||
@@ -58,7 +63,7 @@ int thread__comm_len(struct thread *thread)
|
||||
|
||||
size_t thread__fprintf(struct thread *thread, FILE *fp)
|
||||
{
|
||||
return fprintf(fp, "Thread %d %s\n", thread->tid, thread->comm) +
|
||||
return fprintf(fp, "Thread %d %s\n", thread->tid, thread__comm_str(thread)) +
|
||||
map_groups__fprintf(&thread->mg, verbose, fp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user