perf tools: Add fprintf methods for thread_map and cpu_map classes
For helping with debugging. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-m06n4rp7pwr6dlzwoq89cl69@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
@@ -62,3 +62,14 @@ void thread_map__delete(struct thread_map *threads)
|
||||
{
|
||||
free(threads);
|
||||
}
|
||||
|
||||
size_t thread_map__fprintf(struct thread_map *threads, FILE *fp)
|
||||
{
|
||||
int i;
|
||||
size_t printed = fprintf(fp, "%d thread%s: ",
|
||||
threads->nr, threads->nr > 1 ? "s" : "");
|
||||
for (i = 0; i < threads->nr; ++i)
|
||||
printed += fprintf(fp, "%s%d", i ? ", " : "", threads->map[i]);
|
||||
|
||||
return printed + fprintf(fp, "\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user