blob: 2f68a3b8c285dd80f6c21bc47f180e326528cc15 [file] [log] [blame]
Paul Mackerrasa12b51c2010-03-10 20:36:09 +11001#ifndef __PERF_CPUMAP_H
2#define __PERF_CPUMAP_H
3
Arnaldo Carvalho de Melo9ae7d332012-01-19 14:07:23 -02004#include <stdio.h>
Arnaldo Carvalho de Meloa14bb7a2012-09-26 12:41:14 -03005#include <stdbool.h>
Arnaldo Carvalho de Melo9ae7d332012-01-19 14:07:23 -02006
Arnaldo Carvalho de Melo60d567e2011-01-03 17:49:48 -02007struct cpu_map {
8 int nr;
9 int map[];
10};
11
12struct cpu_map *cpu_map__new(const char *cpu_list);
13struct cpu_map *cpu_map__dummy_new(void);
Arnaldo Carvalho de Melo915fce22011-01-14 16:19:12 -020014void cpu_map__delete(struct cpu_map *map);
Yan, Zheng7ae92e72012-09-10 15:53:50 +080015struct cpu_map *cpu_map__read(FILE *file);
Arnaldo Carvalho de Melo9ae7d332012-01-19 14:07:23 -020016size_t cpu_map__fprintf(struct cpu_map *map, FILE *fp);
17
Arnaldo Carvalho de Meloa14bb7a2012-09-26 12:41:14 -030018static inline int cpu_map__nr(const struct cpu_map *map)
19{
20 return map ? map->nr : 1;
21}
22
23static inline bool cpu_map__all(const struct cpu_map *map)
24{
25 return map ? map->map[0] == -1 : true;
26}
27
Paul Mackerrasa12b51c2010-03-10 20:36:09 +110028#endif /* __PERF_CPUMAP_H */