diff options
author | Wang Nan <wangnan0@huawei.com> | 2015-11-04 11:20:04 +0000 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-11-05 12:47:02 -0300 |
commit | 59f41af980f95cbd556a6dc2e064b412abc439cf (patch) | |
tree | 275d7385bf1a1e5d0ca91aa4e2295568aeff5874 /tools/perf/bench | |
parent | 98916392a0bdfd71668b711fd93915791f45df02 (diff) |
perf llvm: Pass number of configured CPUs to clang compiler
This patch introduces a new macro "__NR_CPUS__" to perf's embedded clang
compiler, which represent the number of configured CPUs in this system.
BPF programs can use this macro to create a map with the same number of
system CPUs. For example:
struct bpf_map_def SEC("maps") pmu_map = {
.type = BPF_MAP_TYPE_PERF_EVENT_ARRAY,
.key_size = sizeof(int),
.value_size = sizeof(u32),
.max_entries = __NR_CPUS__,
};
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1446636007-239722-2-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/bench')
0 files changed, 0 insertions, 0 deletions