diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-08-23 12:29:17 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-08-23 12:29:17 +0200 |
commit | 49c46457caadb8c170fd841bd8051e03062d9b8b (patch) | |
tree | e3ee50fdf080ed6fb1c48c835cff27aee85b9e03 /tools/perf/lib/include | |
parent | 4e92b18e5b0b61211f4511cdbc5803300eeead40 (diff) | |
parent | d9c5c083416500e95da098c01be092b937def7fa (diff) |
Merge tag 'perf-core-for-mingo-5.4-20190822' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
perf c2c:
Ravi Bangoria:
- Fix report with offline CPUs.
libperf:
Gerald BAEZA:
- Fix alignment trap with xyarray contents in 'perf stat', noticed on ARMv7.
Jiri Olsa:
- Move some more cpu_map and thread_map methods from tools/perf/util/ to libperf.
headers:
Arnaldo Carvalho de Melo:
- Do some house cleaning on the headers, removing needless includes in some places,
providing forward declarations when those are the only thing needed, and fixing
up the fallout from that for cases where we were using stuff and not adding the
necessary headers. Should speed up the build and avoid needless rebuilds when
something unrelated gets touched.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/lib/include')
-rw-r--r-- | tools/perf/lib/include/internal/cpumap.h | 2 | ||||
-rw-r--r-- | tools/perf/lib/include/internal/xyarray.h | 3 | ||||
-rw-r--r-- | tools/perf/lib/include/perf/cpumap.h | 2 | ||||
-rw-r--r-- | tools/perf/lib/include/perf/threadmap.h | 2 |
4 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/lib/include/internal/cpumap.h b/tools/perf/lib/include/internal/cpumap.h index 3306319f7df8..840d4032587b 100644 --- a/tools/perf/lib/include/internal/cpumap.h +++ b/tools/perf/lib/include/internal/cpumap.h @@ -14,4 +14,6 @@ struct perf_cpu_map { #define MAX_NR_CPUS 2048 #endif +int perf_cpu_map__idx(struct perf_cpu_map *cpus, int cpu); + #endif /* __LIBPERF_INTERNAL_CPUMAP_H */ diff --git a/tools/perf/lib/include/internal/xyarray.h b/tools/perf/lib/include/internal/xyarray.h index 3bf70e4d474c..51e35d6c8ec4 100644 --- a/tools/perf/lib/include/internal/xyarray.h +++ b/tools/perf/lib/include/internal/xyarray.h @@ -2,6 +2,7 @@ #ifndef __LIBPERF_INTERNAL_XYARRAY_H #define __LIBPERF_INTERNAL_XYARRAY_H +#include <linux/compiler.h> #include <sys/types.h> struct xyarray { @@ -10,7 +11,7 @@ struct xyarray { size_t entries; size_t max_x; size_t max_y; - char contents[]; + char contents[] __aligned(8); }; struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size); diff --git a/tools/perf/lib/include/perf/cpumap.h b/tools/perf/lib/include/perf/cpumap.h index 1b6e7db3fa2b..8aa995c59498 100644 --- a/tools/perf/lib/include/perf/cpumap.h +++ b/tools/perf/lib/include/perf/cpumap.h @@ -4,6 +4,7 @@ #include <perf/core.h> #include <stdio.h> +#include <stdbool.h> struct perf_cpu_map; @@ -14,6 +15,7 @@ LIBPERF_API struct perf_cpu_map *perf_cpu_map__get(struct perf_cpu_map *map); LIBPERF_API void perf_cpu_map__put(struct perf_cpu_map *map); LIBPERF_API int perf_cpu_map__cpu(const struct perf_cpu_map *cpus, int idx); LIBPERF_API int perf_cpu_map__nr(const struct perf_cpu_map *cpus); +LIBPERF_API bool perf_cpu_map__empty(const struct perf_cpu_map *map); #define perf_cpu_map__for_each_cpu(cpu, idx, cpus) \ for ((idx) = 0, (cpu) = perf_cpu_map__cpu(cpus, idx); \ diff --git a/tools/perf/lib/include/perf/threadmap.h b/tools/perf/lib/include/perf/threadmap.h index 456295273daa..a7c50de8d010 100644 --- a/tools/perf/lib/include/perf/threadmap.h +++ b/tools/perf/lib/include/perf/threadmap.h @@ -11,6 +11,8 @@ LIBPERF_API struct perf_thread_map *perf_thread_map__new_dummy(void); LIBPERF_API void perf_thread_map__set_pid(struct perf_thread_map *map, int thread, pid_t pid); LIBPERF_API char *perf_thread_map__comm(struct perf_thread_map *map, int thread); +LIBPERF_API int perf_thread_map__nr(struct perf_thread_map *threads); +LIBPERF_API pid_t perf_thread_map__pid(struct perf_thread_map *map, int thread); LIBPERF_API struct perf_thread_map *perf_thread_map__get(struct perf_thread_map *map); LIBPERF_API void perf_thread_map__put(struct perf_thread_map *map); |