mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge branch 'perf-tools-next' of https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git
This commit is contained in:
@@ -20,9 +20,6 @@ HOST_OVERRIDES := AR="$(HOSTAR)" CC="$(HOSTCC)" LD="$(HOSTLD)" ARCH="$(HOSTARCH)
|
||||
CROSS_COMPILE="" CLANG_CROSS_FLAGS="" EXTRA_CFLAGS="$(HOSTCFLAGS)"
|
||||
|
||||
RM ?= rm
|
||||
HOSTCC ?= gcc
|
||||
HOSTLD ?= ld
|
||||
HOSTAR ?= ar
|
||||
HOSTPKG_CONFIG ?= pkg-config
|
||||
CROSS_COMPILE =
|
||||
|
||||
|
||||
@@ -9,10 +9,6 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
|
||||
#$(info Determined 'srctree' to be $(srctree))
|
||||
endif
|
||||
|
||||
CC ?= $(CROSS_COMPILE)gcc
|
||||
AR ?= $(CROSS_COMPILE)ar
|
||||
LD ?= $(CROSS_COMPILE)ld
|
||||
|
||||
MAKEFLAGS += --no-print-directory
|
||||
|
||||
INSTALL = install
|
||||
|
||||
@@ -31,7 +31,8 @@ int fdarray__grow(struct fdarray *fda, int nr)
|
||||
|
||||
priv = realloc(fda->priv, psize);
|
||||
if (priv == NULL) {
|
||||
free(entries);
|
||||
/* this will be freed by fdarray__exit() */
|
||||
fda->entries = entries;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
@@ -50,7 +51,7 @@ struct fdarray *fdarray__new(int nr_alloc, int nr_autogrow)
|
||||
|
||||
if (fda != NULL) {
|
||||
if (fdarray__grow(fda, nr_alloc)) {
|
||||
free(fda);
|
||||
fdarray__delete(fda);
|
||||
fda = NULL;
|
||||
} else {
|
||||
fda->nr_autogrow = nr_autogrow;
|
||||
@@ -115,6 +116,9 @@ int fdarray__filter(struct fdarray *fda, short revents,
|
||||
return 0;
|
||||
|
||||
for (fd = 0; fd < fda->nr; ++fd) {
|
||||
if (fda->priv[fd].flags & fdarray_flag__nonfilterable)
|
||||
continue;
|
||||
|
||||
if (!fda->entries[fd].events)
|
||||
continue;
|
||||
|
||||
@@ -122,12 +126,17 @@ int fdarray__filter(struct fdarray *fda, short revents,
|
||||
if (entry_destructor)
|
||||
entry_destructor(fda, fd, arg);
|
||||
|
||||
/*
|
||||
* Set fd to -1 so poll() ignores this entry; otherwise
|
||||
* POLLHUP/POLLERR are still reported for events=0 fds
|
||||
* (POSIX: always checked), causing a poll storm.
|
||||
*/
|
||||
fda->entries[fd].fd = -1;
|
||||
fda->entries[fd].revents = fda->entries[fd].events = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!(fda->priv[fd].flags & fdarray_flag__nonfilterable))
|
||||
++nr;
|
||||
++nr;
|
||||
}
|
||||
|
||||
return nr;
|
||||
|
||||
@@ -115,12 +115,12 @@ PC_FILE := $(addprefix $(OUTPUT),$(PC_FILE))
|
||||
|
||||
TAGS_PROG := $(if $(shell which etags 2>/dev/null),etags,ctags)
|
||||
|
||||
GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \
|
||||
GLOBAL_SYM_COUNT = $(shell $(HOSTREADELF) -s --wide $(BPF_IN_SHARED) | \
|
||||
cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
|
||||
sed 's/\[.*\]//' | \
|
||||
awk '/GLOBAL/ && /DEFAULT/ && !/UND|ABS/ {print $$NF}' | \
|
||||
sort -u | wc -l)
|
||||
VERSIONED_SYM_COUNT = $(shell readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \
|
||||
VERSIONED_SYM_COUNT = $(shell $(HOSTREADELF) --dyn-syms --wide $(OUTPUT)libbpf.so | \
|
||||
sed 's/\[.*\]//' | \
|
||||
awk '/GLOBAL/ && /DEFAULT/ && !/UND|ABS/ {print $$NF}' | \
|
||||
grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | sort -u | wc -l)
|
||||
@@ -183,12 +183,12 @@ check_abi: $(OUTPUT)libbpf.so $(VERSION_SCRIPT)
|
||||
"versioned symbols in $^ ($(VERSIONED_SYM_COUNT))." \
|
||||
"Please make sure all LIBBPF_API symbols are" \
|
||||
"versioned in $(VERSION_SCRIPT)." >&2; \
|
||||
readelf -s --wide $(BPF_IN_SHARED) | \
|
||||
$(HOSTREADELF) -s --wide $(BPF_IN_SHARED) | \
|
||||
cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \
|
||||
sed 's/\[.*\]//' | \
|
||||
awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \
|
||||
sort -u > $(OUTPUT)libbpf_global_syms.tmp; \
|
||||
readelf --dyn-syms --wide $(OUTPUT)libbpf.so | \
|
||||
$(HOSTREADELF) --dyn-syms --wide $(OUTPUT)libbpf.so | \
|
||||
sed 's/\[.*\]//' | \
|
||||
awk '/GLOBAL/ && /DEFAULT/ && !/UND|ABS/ {print $$NF}'| \
|
||||
grep -Eo '[^ ]+@LIBBPF_' | cut -d@ -f1 | \
|
||||
|
||||
@@ -9,10 +9,6 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
|
||||
#$(info Determined 'srctree' to be $(srctree))
|
||||
endif
|
||||
|
||||
CC ?= $(CROSS_COMPILE)gcc
|
||||
LD ?= $(CROSS_COMPILE)ld
|
||||
AR ?= $(CROSS_COMPILE)ar
|
||||
|
||||
RM = rm -f
|
||||
|
||||
MAKEFLAGS += --no-print-directory
|
||||
|
||||
@@ -9,10 +9,6 @@ srctree := $(patsubst %/,%,$(dir $(srctree)))
|
||||
#$(info Determined 'srctree' to be $(srctree))
|
||||
endif
|
||||
|
||||
CC ?= $(CROSS_COMPILE)gcc
|
||||
AR ?= $(CROSS_COMPILE)ar
|
||||
LD ?= $(CROSS_COMPILE)ld
|
||||
|
||||
MAKEFLAGS += --no-print-directory
|
||||
|
||||
INSTALL = install
|
||||
|
||||
@@ -2,15 +2,18 @@ BasedOnStyle: InheritParentConfig
|
||||
SortIncludes: true
|
||||
IncludeBlocks: Regroup
|
||||
IncludeCategories:
|
||||
# Python.h must be first
|
||||
- Regex: '^<Python\.h>'
|
||||
Priority: -1
|
||||
# Implicitly the corresponding header for the C file has Priority 0
|
||||
# C Standard Library Headers
|
||||
- Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>'
|
||||
- Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdarg|stdatomic|stdbit|stdbool|stdckdint|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h>'
|
||||
Priority: 1
|
||||
# OS/System-Specific Headers (directories)
|
||||
- Regex: '^<(sys|linux|asm|arpa|net|netinet|x86_64|machine)/.*>'
|
||||
- Regex: '^<(arpa|asm|asm-generic|linux|machine|net|netinet|sys|uapi|x86_64)/.*>'
|
||||
Priority: 2
|
||||
# OS/System-Specific Headers (POSIX/System flat headers)
|
||||
- Regex: '^<(unistd|pthread|fcntl|dirent|dlfcn|poll|sched|semaphore|spawn|syslog|termios|pwd|grp|netdb|sysexits|err|paths|pty|utmp|resolv|ifaddrs|elf|libelf|gelf)\.h>'
|
||||
- Regex: '^<(aio|byteswap|dirent|dlfcn|elf|endian|err|execinfo|fcntl|features|fnmatch|ftw|gelf|getopt|grp|ifaddrs|libelf|libgen|malloc|memory|mntent|netdb|numa|numaif|paths|poll|pthread|pty|pwd|regex|resolv|sched|semaphore|spawn|strings|syscall|sysexits|syslog|termios|unistd|utmp|x86intrin)\.h>'
|
||||
Priority: 2
|
||||
# Third-Party Library Headers
|
||||
- Regex: '^<.*>'
|
||||
|
||||
@@ -162,6 +162,9 @@ null run - Don't start any counters.
|
||||
This can be useful to measure just elapsed wall-clock time - or to assess the
|
||||
raw overhead of perf stat itself, without running any counters.
|
||||
|
||||
--hide-zero-events::
|
||||
Do not show events with a zero count.
|
||||
|
||||
-v::
|
||||
--verbose::
|
||||
be more verbose (show counter open errors, etc)
|
||||
|
||||
@@ -57,7 +57,8 @@ OPTIONS
|
||||
--workload=::
|
||||
Run a built-in workload, to list them use '--list-workloads', current
|
||||
ones include: noploop, thloop, leafloop, sqrtloop, brstack, datasym,
|
||||
context_switch_loop, deterministic, named_threads and landlock.
|
||||
context_switch_loop, deterministic, named_threads, landlock and
|
||||
callchain.
|
||||
|
||||
Used with the shell script regression tests.
|
||||
|
||||
@@ -69,7 +70,8 @@ OPTIONS
|
||||
'named_threads' accepts the number of threads and the number of loops to
|
||||
do in each thread.
|
||||
|
||||
The datasym, landlock and deterministic workloads don't accept any.
|
||||
The datasym, landlock, deterministic and callchain workloads don't accept
|
||||
any.
|
||||
|
||||
--list-workloads::
|
||||
List the available workloads to use with -w/--workload.
|
||||
|
||||
@@ -247,6 +247,10 @@ the thread executes on the designated CPUs. Default is to monitor all CPUs.
|
||||
pretty-printing serves as a fallback to hand-crafted pretty printers, as the latter can
|
||||
better pretty-print integer flags and struct pointers.
|
||||
|
||||
--bitmask-list::
|
||||
Show bitmasks as a human-readable, condensed list (e.g. "0,2-5,7")
|
||||
instead of the default hexadecimal representation.
|
||||
|
||||
--bpf-summary::
|
||||
Collect system call statistics in BPF. This is only for live mode and
|
||||
works well with -s/--summary option where no argument information is
|
||||
|
||||
@@ -87,7 +87,7 @@ if (slots_fd < 0)
|
||||
|
||||
/* Memory mapping the fd permits _rdpmc calls from userspace */
|
||||
void *slots_p = mmap(0, getpagesize(), PROT_READ, MAP_SHARED, slots_fd, 0);
|
||||
if (!slot_p)
|
||||
if (slots_p == MAP_FAILED)
|
||||
.... error ...
|
||||
|
||||
/*
|
||||
@@ -107,7 +107,7 @@ if (metrics_fd < 0)
|
||||
|
||||
/* Memory mapping the fd permits _rdpmc calls from userspace */
|
||||
void *metrics_p = mmap(0, getpagesize(), PROT_READ, MAP_SHARED, metrics_fd, 0);
|
||||
if (!metrics_p)
|
||||
if (metrics_p == MAP_FAILED)
|
||||
... error ...
|
||||
|
||||
Note: the file descriptors returned by the perf_event_open calls must be memory
|
||||
|
||||
@@ -174,11 +174,6 @@ endef
|
||||
|
||||
LD += $(EXTRA_LDFLAGS)
|
||||
|
||||
HOSTCC ?= gcc
|
||||
HOSTLD ?= ld
|
||||
HOSTAR ?= ar
|
||||
CLANG ?= clang
|
||||
|
||||
# Some distros provide the command $(CROSS_COMPILE)pkg-config for
|
||||
# searching packges installed with Multiarch. Use it for cross
|
||||
# compilation if it is existed.
|
||||
@@ -213,9 +208,7 @@ FIND = find
|
||||
INSTALL = install
|
||||
FLEX ?= flex
|
||||
BISON ?= bison
|
||||
STRIP = strip
|
||||
AWK = awk
|
||||
READELF ?= readelf
|
||||
|
||||
# include Makefile.config by default and rule out
|
||||
# non-config cases
|
||||
@@ -517,12 +510,15 @@ all: shell_compatibility_test $(ALL_PROGRAMS) $(LANG_BINDINGS) $(OTHER_PROGRAMS)
|
||||
# Create python binding output directory if not already present
|
||||
$(shell [ -d '$(OUTPUT)python' ] || mkdir -p '$(OUTPUT)python')
|
||||
|
||||
$(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX): util/python.c util/setup.py $(PERFLIBS_PY)
|
||||
$(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX): util/python.c util/setup.py python/perf.pyi $(PERFLIBS_PY)
|
||||
$(QUIET_GEN)LDSHARED="$(CC) -pthread -shared" \
|
||||
CFLAGS='$(CFLAGS)' LDFLAGS='$(LDFLAGS) $(LIBS_PY)' \
|
||||
$(PYTHON_WORD) util/setup.py \
|
||||
$(python_setup_quiet) build_ext; \
|
||||
cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/
|
||||
cp $(PYTHON_EXTBUILD_LIB)perf*.so $(OUTPUT)python/; \
|
||||
if [ "$(abspath python/perf.pyi)" != "$(abspath $(OUTPUT)python/perf.pyi)" ]; then \
|
||||
cp python/perf.pyi $(OUTPUT)python/; \
|
||||
fi
|
||||
|
||||
python_perf_target:
|
||||
@echo "Target is: $(OUTPUT)python/perf$(PYTHON_EXTENSION_SUFFIX)"
|
||||
@@ -677,7 +673,7 @@ $(OUTPUT)dlfilters/%.o: dlfilters/%.c include/perf/perf_dlfilter.h
|
||||
.SECONDARY: $(DLFILTERS:.so=.o)
|
||||
|
||||
$(OUTPUT)dlfilters/%.so: $(OUTPUT)dlfilters/%.o
|
||||
$(QUIET_LINK)$(CC) $(EXTRA_CFLAGS) -shared -o $@ $<
|
||||
$(QUIET_LINK)$(CC) $(filter-out -static,$(LDFLAGS)) $(EXTRA_CFLAGS) -shared -o $@ $<
|
||||
|
||||
ifndef NO_JVMTI
|
||||
LIBJVMTI_IN := $(OUTPUT)jvmti/jvmti-in.o
|
||||
|
||||
@@ -201,7 +201,7 @@ static int cs_etm_validate_config(struct perf_pmu *cs_etm_pmu,
|
||||
{
|
||||
unsigned int idx;
|
||||
int err = 0;
|
||||
struct perf_cpu_map *event_cpus = evsel->evlist->core.user_requested_cpus;
|
||||
struct perf_cpu_map *event_cpus = evlist__core(evsel->evlist)->user_requested_cpus;
|
||||
struct perf_cpu_map *intersect_cpus;
|
||||
struct perf_cpu cpu;
|
||||
|
||||
@@ -325,7 +325,7 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,
|
||||
container_of(itr, struct cs_etm_recording, itr);
|
||||
struct perf_pmu *cs_etm_pmu = ptr->cs_etm_pmu;
|
||||
struct evsel *evsel, *cs_etm_evsel = NULL;
|
||||
struct perf_cpu_map *cpus = evlist->core.user_requested_cpus;
|
||||
struct perf_cpu_map *cpus = evlist__core(evlist)->user_requested_cpus;
|
||||
bool privileged = perf_event_paranoid_check(-1);
|
||||
int err = 0;
|
||||
|
||||
@@ -551,7 +551,7 @@ cs_etm_info_priv_size(struct auxtrace_record *itr,
|
||||
{
|
||||
unsigned int idx;
|
||||
int etmv3 = 0, etmv4 = 0, ete = 0;
|
||||
struct perf_cpu_map *event_cpus = evlist->core.user_requested_cpus;
|
||||
struct perf_cpu_map *event_cpus = evlist__core(evlist)->user_requested_cpus;
|
||||
struct perf_cpu_map *intersect_cpus;
|
||||
struct perf_cpu cpu;
|
||||
struct perf_pmu *cs_etm_pmu = cs_etm_get_pmu(itr);
|
||||
@@ -790,7 +790,7 @@ static int cs_etm_info_fill(struct auxtrace_record *itr,
|
||||
u32 offset;
|
||||
u64 nr_cpu, type;
|
||||
struct perf_cpu_map *cpu_map;
|
||||
struct perf_cpu_map *event_cpus = session->evlist->core.user_requested_cpus;
|
||||
struct perf_cpu_map *event_cpus = evlist__core(session->evlist)->user_requested_cpus;
|
||||
struct perf_cpu_map *online_cpus = perf_cpu_map__new_online_cpus();
|
||||
struct cs_etm_recording *ptr =
|
||||
container_of(itr, struct cs_etm_recording, itr);
|
||||
@@ -800,7 +800,7 @@ static int cs_etm_info_fill(struct auxtrace_record *itr,
|
||||
if (priv_size != cs_etm_info_priv_size(itr, session->evlist))
|
||||
return -EINVAL;
|
||||
|
||||
if (!session->evlist->core.nr_mmaps)
|
||||
if (!evlist__core(session->evlist)->nr_mmaps)
|
||||
return -EINVAL;
|
||||
|
||||
/* If the cpu_map has the "any" CPU all online CPUs are involved */
|
||||
|
||||
@@ -60,7 +60,7 @@ static bool arm_spe_is_set_freq(struct evsel *evsel)
|
||||
*/
|
||||
static struct perf_cpu_map *arm_spe_find_cpus(struct evlist *evlist)
|
||||
{
|
||||
struct perf_cpu_map *event_cpus = evlist->core.user_requested_cpus;
|
||||
struct perf_cpu_map *event_cpus = evlist__core(evlist)->user_requested_cpus;
|
||||
struct perf_cpu_map *online_cpus = perf_cpu_map__new_online_cpus();
|
||||
struct perf_cpu_map *intersect_cpus;
|
||||
|
||||
@@ -157,7 +157,7 @@ static int arm_spe_info_fill(struct auxtrace_record *itr,
|
||||
if (priv_size != arm_spe_info_priv_size(itr, session->evlist))
|
||||
return -EINVAL;
|
||||
|
||||
if (!session->evlist->core.nr_mmaps)
|
||||
if (!evlist__core(session->evlist)->nr_mmaps)
|
||||
return -EINVAL;
|
||||
|
||||
cpu_map = arm_spe_find_cpus(session->evlist);
|
||||
@@ -363,7 +363,7 @@ static int arm_spe_setup_tracking_event(struct evlist *evlist,
|
||||
{
|
||||
int err;
|
||||
struct evsel *tracking_evsel;
|
||||
struct perf_cpu_map *cpus = evlist->core.user_requested_cpus;
|
||||
struct perf_cpu_map *cpus = evlist__core(evlist)->user_requested_cpus;
|
||||
|
||||
/* Add dummy event to keep tracking */
|
||||
err = parse_event(evlist, "dummy:u");
|
||||
@@ -396,7 +396,7 @@ static int arm_spe_recording_options(struct auxtrace_record *itr,
|
||||
struct arm_spe_recording *sper =
|
||||
container_of(itr, struct arm_spe_recording, itr);
|
||||
struct evsel *evsel, *tmp;
|
||||
struct perf_cpu_map *cpus = evlist->core.user_requested_cpus;
|
||||
struct perf_cpu_map *cpus = evlist__core(evlist)->user_requested_cpus;
|
||||
bool discard = false;
|
||||
int err;
|
||||
u64 discard_bit;
|
||||
|
||||
@@ -53,7 +53,7 @@ static int hisi_ptt_info_fill(struct auxtrace_record *itr,
|
||||
if (priv_size != HISI_PTT_AUXTRACE_PRIV_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
if (!session->evlist->core.nr_mmaps)
|
||||
if (!evlist__core(session->evlist)->nr_mmaps)
|
||||
return -EINVAL;
|
||||
|
||||
auxtrace_info->type = PERF_AUXTRACE_HISI_PTT;
|
||||
|
||||
@@ -46,7 +46,6 @@ static int dummy_workload_1(unsigned long count)
|
||||
{
|
||||
int (*func)(void);
|
||||
int ret = 0;
|
||||
char *p;
|
||||
char insn1[] = {
|
||||
0xb8, 0x01, 0x00, 0x00, 0x00, /* mov 1,%eax */
|
||||
0xc3, /* ret */
|
||||
@@ -59,18 +58,11 @@ static int dummy_workload_1(unsigned long count)
|
||||
0xcc, /* int 3 */
|
||||
};
|
||||
|
||||
p = calloc(2, page_size);
|
||||
if (!p) {
|
||||
printf("malloc() failed. %m");
|
||||
return 1;
|
||||
}
|
||||
|
||||
func = (void *)((unsigned long)(p + page_size - 1) & ~(page_size - 1));
|
||||
|
||||
ret = mprotect(func, page_size, PROT_READ | PROT_WRITE | PROT_EXEC);
|
||||
if (ret) {
|
||||
printf("mprotect() failed. %m");
|
||||
goto out;
|
||||
func = mmap(NULL, page_size, PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (func == MAP_FAILED) {
|
||||
pr_debug("mmap() failed. %m\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (count < 100000)
|
||||
@@ -93,7 +85,7 @@ static int dummy_workload_1(unsigned long count)
|
||||
}
|
||||
|
||||
out:
|
||||
free(p);
|
||||
munmap(func, page_size);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ static int test__hybrid_hw_event_with_pmu(struct evlist *evlist)
|
||||
{
|
||||
struct evsel *evsel = evlist__first(evlist);
|
||||
|
||||
TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 1 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW));
|
||||
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
|
||||
@@ -38,7 +38,7 @@ static int test__hybrid_hw_group_event(struct evlist *evlist)
|
||||
struct evsel *evsel, *leader;
|
||||
|
||||
evsel = leader = evlist__first(evlist);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW));
|
||||
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
|
||||
@@ -57,7 +57,7 @@ static int test__hybrid_sw_hw_group_event(struct evlist *evlist)
|
||||
struct evsel *evsel, *leader;
|
||||
|
||||
evsel = leader = evlist__first(evlist);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_SOFTWARE == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong leader", evsel__has_leader(evsel, leader));
|
||||
|
||||
@@ -74,7 +74,7 @@ static int test__hybrid_hw_sw_group_event(struct evlist *evlist)
|
||||
struct evsel *evsel, *leader;
|
||||
|
||||
evsel = leader = evlist__first(evlist);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW));
|
||||
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
|
||||
@@ -91,7 +91,7 @@ static int test__hybrid_group_modifier1(struct evlist *evlist)
|
||||
struct evsel *evsel, *leader;
|
||||
|
||||
evsel = leader = evlist__first(evlist);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW));
|
||||
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
|
||||
@@ -113,7 +113,7 @@ static int test__hybrid_raw1(struct evlist *evlist)
|
||||
{
|
||||
struct perf_evsel *evsel;
|
||||
|
||||
perf_evlist__for_each_evsel(&evlist->core, evsel) {
|
||||
perf_evlist__for_each_evsel(evlist__core(evlist), evsel) {
|
||||
struct perf_pmu *pmu = perf_pmus__find_by_type(evsel->attr.type);
|
||||
|
||||
TEST_ASSERT_VAL("missing pmu", pmu);
|
||||
@@ -127,7 +127,7 @@ static int test__hybrid_raw2(struct evlist *evlist)
|
||||
{
|
||||
struct evsel *evsel = evlist__first(evlist);
|
||||
|
||||
TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 1 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong config", test_config(evsel, 0x1a));
|
||||
return TEST_OK;
|
||||
@@ -137,7 +137,7 @@ static int test__hybrid_cache_event(struct evlist *evlist)
|
||||
{
|
||||
struct evsel *evsel = evlist__first(evlist);
|
||||
|
||||
TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 1 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_HW_CACHE == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong config", 0x2 == (evsel->core.attr.config & 0xffffffff));
|
||||
return TEST_OK;
|
||||
@@ -148,7 +148,7 @@ static int test__checkevent_pmu(struct evlist *evlist)
|
||||
|
||||
struct evsel *evsel = evlist__first(evlist);
|
||||
|
||||
TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 1 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_RAW == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong config", 10 == evsel->core.attr.config);
|
||||
TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1);
|
||||
@@ -168,7 +168,7 @@ static int test__hybrid_hw_group_event_2(struct evlist *evlist)
|
||||
struct evsel *evsel, *leader;
|
||||
|
||||
evsel = leader = evlist__first(evlist);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries);
|
||||
TEST_ASSERT_VAL("wrong number of entries", 2 == evlist__nr_entries(evlist));
|
||||
TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type);
|
||||
TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW));
|
||||
TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES));
|
||||
@@ -268,7 +268,7 @@ static int test_event(const struct evlist_test *e)
|
||||
ret = e->check(evlist);
|
||||
}
|
||||
parse_events_error__exit(&err);
|
||||
evlist__delete(evlist);
|
||||
evlist__put(evlist);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ static int event_cb(void *state, struct pmu_event_info *info)
|
||||
*ret = TEST_FAIL;
|
||||
}
|
||||
}
|
||||
evlist__delete(evlist);
|
||||
evlist__put(evlist);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ static int test_sort(const char *str, int expected_slots_group_size,
|
||||
CHECK_COND(slots_seen, "slots seen");
|
||||
ret = TEST_OK;
|
||||
out_err:
|
||||
evlist__delete(evlist);
|
||||
evlist__put(evlist);
|
||||
parse_events_error__exit(&err);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ struct auxtrace_record *auxtrace_record__init(struct evlist *evlist,
|
||||
int *err)
|
||||
{
|
||||
char buffer[64];
|
||||
struct perf_cpu cpu = perf_cpu_map__min(evlist->core.all_cpus);
|
||||
struct perf_cpu cpu = perf_cpu_map__min(evlist__core(evlist)->all_cpus);
|
||||
int ret;
|
||||
|
||||
*err = 0;
|
||||
|
||||
@@ -79,10 +79,10 @@ static int intel_bts_info_fill(struct auxtrace_record *itr,
|
||||
if (priv_size != INTEL_BTS_AUXTRACE_PRIV_SIZE)
|
||||
return -EINVAL;
|
||||
|
||||
if (!session->evlist->core.nr_mmaps)
|
||||
if (!evlist__core(session->evlist)->nr_mmaps)
|
||||
return -EINVAL;
|
||||
|
||||
pc = session->evlist->mmap[0].core.base;
|
||||
pc = evlist__mmap(session->evlist)[0].core.base;
|
||||
if (pc) {
|
||||
err = perf_read_tsc_conversion(pc, &tc);
|
||||
if (err) {
|
||||
@@ -114,7 +114,7 @@ static int intel_bts_recording_options(struct auxtrace_record *itr,
|
||||
container_of(itr, struct intel_bts_recording, itr);
|
||||
struct perf_pmu *intel_bts_pmu = btsr->intel_bts_pmu;
|
||||
struct evsel *evsel, *intel_bts_evsel = NULL;
|
||||
const struct perf_cpu_map *cpus = evlist->core.user_requested_cpus;
|
||||
const struct perf_cpu_map *cpus = evlist__core(evlist)->user_requested_cpus;
|
||||
bool privileged = perf_event_paranoid_check(-1);
|
||||
|
||||
if (opts->auxtrace_sample_mode) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user