diff options
author | Ingo Molnar <mingo@elte.hu> | 2012-01-26 12:11:41 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-01-26 12:11:41 +0100 |
commit | 939ddcfa60dabfaed390987bf0103a6654c0fe30 (patch) | |
tree | baa9b89a2b268d99496805f761ab9a00c272c0dc /tools/perf/util/cpumap.c | |
parent | 96070c83b295b31912ad92d3ffb66baec2b86d50 (diff) | |
parent | f8f4b2872295dca88339ec0c403b2217b1197353 (diff) |
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull in the latest perf/core improvements and fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/cpumap.c')
-rw-r--r-- | tools/perf/util/cpumap.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index 6893eec693a..adc72f09914 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -166,6 +166,17 @@ out: return cpus; } +size_t cpu_map__fprintf(struct cpu_map *map, FILE *fp) +{ + int i; + size_t printed = fprintf(fp, "%d cpu%s: ", + map->nr, map->nr > 1 ? "s" : ""); + for (i = 0; i < map->nr; ++i) + printed += fprintf(fp, "%s%d", i ? ", " : "", map->map[i]); + + return printed + fprintf(fp, "\n"); +} + struct cpu_map *cpu_map__dummy_new(void) { struct cpu_map *cpus = malloc(sizeof(*cpus) + sizeof(int)); |