mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-11-10 12:12:46 +00:00
Add 2 simple perf_evsel tests to test counters reading interface through
the struct evsel object.
Committer testing:
# make -C tools/perf/lib tests
make: Entering directory '/home/acme/git/perf/tools/perf/lib'
LINK test-cpumap-a
LINK test-threadmap-a
LINK test-evlist-a
LINK test-evsel-a
LINK test-cpumap-so
LINK test-threadmap-so
LINK test-evlist-so
LINK test-evsel-so
running static:
- running test-cpumap.c...OK
- running test-threadmap.c...OK
- running test-evlist.c...OK
- running test-evsel.c...OK
running dynamic:
- running test-cpumap.c...OK
- running test-threadmap.c...OK
- running test-evlist.c...OK
- running test-evsel.c...OK
make: Leaving directory '/home/acme/git/perf/tools/perf/lib'
#
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190721112506.12306-77-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
39 lines
895 B
Makefile
39 lines
895 B
Makefile
# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
|
|
|
TESTS = test-cpumap test-threadmap test-evlist test-evsel
|
|
|
|
TESTS_SO := $(addsuffix -so,$(TESTS))
|
|
TESTS_A := $(addsuffix -a,$(TESTS))
|
|
|
|
# Set compile option CFLAGS
|
|
ifdef EXTRA_CFLAGS
|
|
CFLAGS := $(EXTRA_CFLAGS)
|
|
else
|
|
CFLAGS := -g -Wall
|
|
endif
|
|
|
|
all:
|
|
|
|
include $(srctree)/tools/scripts/Makefile.include
|
|
|
|
INCLUDE = -I$(srctree)/tools/perf/lib/include -I$(srctree)/tools/include
|
|
|
|
$(TESTS_A): FORCE
|
|
$(QUIET_LINK)$(CC) $(INCLUDE) $(CFLAGS) -o $@ $(subst -a,.c,$@) ../libperf.a
|
|
|
|
$(TESTS_SO): FORCE
|
|
$(QUIET_LINK)$(CC) $(INCLUDE) $(CFLAGS) -L.. -o $@ $(subst -so,.c,$@) -lperf
|
|
|
|
all: $(TESTS_A) $(TESTS_SO)
|
|
|
|
run:
|
|
@echo "running static:"
|
|
@for i in $(TESTS_A); do ./$$i; done
|
|
@echo "running dynamic:"
|
|
@for i in $(TESTS_SO); do LD_LIBRARY_PATH=../ ./$$i; done
|
|
|
|
clean:
|
|
$(call QUIET_CLEAN, tests)$(RM) $(TESTS_A) $(TESTS_SO)
|
|
|
|
.PHONY: all clean FORCE
|