xref: /linux/tools/testing/selftests/powerpc/pmu/ebb/Makefile (revision 37496845c812db2a470d51088a59ee38156e8058)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2b61442dfSMasahiro Yamadainclude ../../../../../build/Build.include
30695f8bcSHarish
43752e453SMichael Ellermannoarg:
53752e453SMichael Ellerman	$(MAKE) -C ../../
63752e453SMichael Ellerman
788baa78dSbamvor.zhangjian@huawei.comTEST_GEN_PROGS := reg_access_test event_attributes_test cycles_test	\
83752e453SMichael Ellerman	 cycles_with_freeze_test pmc56_overflow_test		\
93752e453SMichael Ellerman	 ebb_vs_cpu_event_test cpu_event_vs_ebb_test		\
103752e453SMichael Ellerman	 cpu_event_pinned_vs_ebb_test task_event_vs_ebb_test	\
113752e453SMichael Ellerman	 task_event_pinned_vs_ebb_test multi_ebb_procs_test	\
123752e453SMichael Ellerman	 multi_counter_test pmae_handling_test			\
133752e453SMichael Ellerman	 close_clears_pmcc_test instruction_count_test		\
143752e453SMichael Ellerman	 fork_cleanup_test ebb_on_child_test			\
153752e453SMichael Ellerman	 ebb_on_willing_child_test back_to_back_ebbs_test	\
16985ac68eSMichael Ellerman	 lost_exception_test no_handler_test			\
17d81090edSAthira Rajeev	 cycles_with_mmcr2_test regs_access_pmccext_test
183752e453SMichael Ellerman
197e0cf1c9SMichael Ellermantop_srcdir = ../../../../../..
2088baa78dSbamvor.zhangjian@huawei.cominclude ../../../lib.mk
213752e453SMichael Ellerman
22*37496845SMadhavan Srinivasan# The EBB handler is 64-bit code and everything links against it
23*37496845SMadhavan SrinivasanCFLAGS += -m64
24*37496845SMadhavan Srinivasan
25*37496845SMadhavan SrinivasanTMPOUT = $(OUTPUT)/TMPDIR/
26*37496845SMadhavan Srinivasan# Toolchains may build PIE by default which breaks the assembly
27*37496845SMadhavan Srinivasanno-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
28*37496845SMadhavan Srinivasan        $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
29*37496845SMadhavan Srinivasan
30*37496845SMadhavan SrinivasanLDFLAGS += $(no-pie-option)
31*37496845SMadhavan Srinivasan
3288baa78dSbamvor.zhangjian@huawei.com$(TEST_GEN_PROGS): ../../harness.c ../../utils.c ../event.c ../lib.c \
33fcb45ec0SMichael Ellerman	       ebb.c ebb_handler.S trace.c busy_loop.S
343752e453SMichael Ellerman
35a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/instruction_count_test: ../loop.S
363752e453SMichael Ellerman
37a8ba798bSbamvor.zhangjian@huawei.com$(OUTPUT)/lost_exception_test: ../lib.c
38