Some ubuntu_kernel_selftests.powerpc/pmu tests are not executable

Bug #1951404 reported by Kleber Sacilotto de Souza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-kernel-tests
In Progress
Undecided
Po-Hsu Lin

Bug Description

count_instructions/l3_bank_test/per_event_excludes from ubuntu_kernel_selftests.powerpc/pmu are failing with bionic/linux 4.15.0-163.171:

selftests: per_event_excludes
========================================
selftests: Warning: file per_event_excludes is not executable, correct this.
not ok 1..1 selftests: per_event_excludes [FAIL]

These were not being run before, so I guess they are now after the recent changes for splitting the selftests.

tags: added: 4.1 sru-20211108 ubuntu-kernel-selftests
tags: added: 4.15 bionic
removed: 4.1
Po-Hsu Lin (cypressyew)
Changed in ubuntu-kernel-tests:
assignee: nobody → Po-Hsu Lin (cypressyew)
status: New → In Progress
Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

This is because of my experimental fix for bug 1950417

And one interesting fact is that this "per_event_excludes" was not executed in the past before the split. It looks like this got something with the upstream code as well. As this test is defined as:

TEST_GEN_PROGS := count_instructions l3_bank_test per_event_excludes

in powerpc/pmu/Makefile and is not being called by any other script inside this powerpc directory:
tools/testing/selftests/powerpc$ grep -r per_event_excludes *
pmu/Makefile:TEST_GEN_PROGS := count_instructions l3_bank_test per_event_excludes
pmu/Makefile:$(OUTPUT)/per_event_excludes: ../utils.c
pmu/.gitignore:per_event_excludes
pmu/per_event_excludes.c:static int per_event_excludes(void)
pmu/per_event_excludes.c: return test_harness(per_event_excludes, "per_event_excludes");
Binary file pmu/per_event_excludes matches

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

With a deeper investigation on B-4.15 with P8 node "gulpin"

Regardless of my changes to how we run it, the upstream code got some issue here. There is no way to run these tests in selftests/powerpc/pmu

It has something to do with the selftests/powerpc/pmu/Makefile, in which it will override the RUN_TEST function defined in selftests/lib.mk to:

DEFAULT_RUN_TESTS := $(RUN_TESTS)
override define RUN_TESTS
    $(DEFAULT_RUN_TESTS)
    TARGET=ebb; BUILD_TARGET=$$OUTPUT/$$TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests
endef

To my understanding, the goal of this is to keep the original RUN_TESTS function, and append an extra step to trigger the ebb test under the pmu directory.

However the $(1) variable which should pass the $TEST_GEN_PROGS is empty in this case, thus the for loop the execute these tests were skipped.

I guess there is something wrong with the $(1) expansion when it's being assigned to DEFAULT_RUN_TESTS, investigation is still WIP

.ONESHELL:
define RUN_TESTS
        @export KSFT_TAP_LEVEL=`echo 1`; \
        test_num=`echo 0`; \
        skip=`echo 4`; \
        echo "TAP version 13"; \
        for TEST in $(1); do \
                BASENAME_TEST=`basename $$TEST`; \
                test_num=`echo $$test_num+1 | bc`; \

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

The last code snippet in comment #2 is the RUN_TESTS fucntion from selftests/lib.mk

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.