1. 07 May, 2024 16 commits
  2. 06 May, 2024 11 commits
  3. 03 May, 2024 4 commits
  4. 01 May, 2024 2 commits
  5. 30 Apr, 2024 2 commits
  6. 29 Apr, 2024 5 commits
    • Michael Ellerman's avatar
      selftests/powerpc: Install tests in sub-directories · dda32e37
      Michael Ellerman authored
      The sources for the powerpc selftests are arranged into sub-directories.
      However when the tests are built and installed, the sub-directories are
      squashed, losing the structure.
      
      For example, with the current code the result of installing the selftests is:
      
        $ tree tools/testing/selftests/kselftest_install
        tools/testing/selftests/kselftest_install
        ├── kselftest
        │   ├── ktap_helpers.sh
        │   ├── module.sh
        │   ├── prefix.pl
        │   └── runner.sh
        ├── kselftest-list.txt
        ├── powerpc
        │   ├── alignment_handler
        │   ├── attr_test
        │   ├── back_to_back_ebbs_test
        │   ├── bad_accesses
        │   ├── bhrb_filter_map_test
        │   ├── bhrb_no_crash_wo_pmu_test
        │   ├── blacklisted_events_test
        │   ├── cache_shape
        │   ├── close_clears_pmcc_test
        │   ├── context_switch
        │   ├── copy_first_unaligned
        ...
        │   ├── settings
        ...
        │   └── wild_bctr
        └── run_kselftest.sh
      
      All the powerpc tests are squashed into the single powerpc directory. In
      particular, note that there is a single `settings` file, even though
      there are multiple settings files in the powerpc selftest sources. One
      of the settings files ends up installed, depending on install order,
      even if they have different contents.
      
      Similarly if there were two tests with the same name in different
      sub-directories they would clobber each other.
      
      Fix it by replicating the directory structure of the source tree into
      the install directory. The result being for example:
      
        $ tree tools/testing/selftests/kselftest_install
        tools/testing/selftests/kselftest_install
        ├── kselftest
        │   ├── ktap_helpers.sh
        │   ├── module.sh
        │   ├── prefix.pl
        │   └── runner.sh
        ├── kselftest-list.txt
        ├── powerpc
        │   ├── alignment
        │   │   ├── alignment_handler
        │   │   └── copy_first_unaligned
        │   ├── benchmarks
        │   │   ├── context_switch
        │   │   ├── exec_target
        │   │   ├── fork
        │   │   ├── futex_bench
        │   │   ├── gettimeofday
        │   │   ├── mmap_bench
        │   │   ├── null_syscall
        │   │   └── settings
        ...
        │   ├── eeh
        │   │   ├── eeh-basic.sh
        │   │   ├── eeh-functions.sh
        │   │   └── settings
        ...
        │   └── vphn
        │       └── test-vphn
        └── run_kselftest.sh
      
      Note multiple settings files in different sub-directories.
      
      This change also has the effect of changing the names of the tests from
      the point of view of the kselftest runner. Before the tests are named
      eg:
      
        powerpc:copy_first_unaligned
        powerpc:cache_shape
        powerpc:reg_access_test
      
      After, the test collection names include the sub-directory:
      
        powerpc/alignment:copy_first_unaligned
        powerpc/cache_shape:cache_shape
        powerpc/pmu/ebb:reg_access_test
      
      That means whereas previously all powerpc tests could be run with:
      
        $ ./run_kselftest.sh -c powerpc
      
      After the change it's necessary to pass a regex that matches all powerpc
      entries, eg:
      
        $ ./run_kselftest.sh -c "powerpc.*"
      
      The latter form also works before and after the change.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20240422133453.1793988-2-mpe@ellerman.id.au
      dda32e37
    • Michael Ellerman's avatar
      selftests/powerpc: Convert pmu Makefile to for loop style · 822a0495
      Michael Ellerman authored
      The pmu Makefile has grown more sub directories over the years. Rather
      than open coding the rules for each subdir, use for loops.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20240422133453.1793988-1-mpe@ellerman.id.au
      822a0495
    • Madhavan Srinivasan's avatar
      selftests/powerpc: make sub-folders buildable on their own · 108e5e68
      Madhavan Srinivasan authored
      Build breaks when executing make with run_tests for sub-folders
      under powerpc. This is because, CFLAGS and GIT_VERSION macros are
      defined in Makefile of toplevel powerpc folder.
      
        make: Entering directory '/home/maddy/linux/tools/testing/selftests/powerpc/mm'
        gcc     hugetlb_vs_thp_test.c ../harness.c ../utils.c  -o /home/maddy/selftest_output//hugetlb_vs_thp_test
        hugetlb_vs_thp_test.c:6:10: fatal error: utils.h: No such file or directory
            6 | #include "utils.h"
              |          ^~~~~~~~~
        compilation terminated.
      
      Fix this by adding the flags.mk in each sub-folder Makefile. Also remove
      the CFLAGS and GIT_VERSION macros from powerpc/ folder Makefile since
      the same is definied in flags.mk
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20240229093711.581230-3-maddy@linux.ibm.com
      108e5e68
    • Madhavan Srinivasan's avatar
      selftests/powerpc: Add flags.mk to support pmu buildable · 5553a793
      Madhavan Srinivasan authored
      When running `make -C powerpc/pmu run_tests` from top level selftests
      directory, currently this error is being reported:
      
        make: Entering directory '/home/maddy/linux/tools/testing/selftests/powerpc/pmu'
        Makefile:40: warning: overriding recipe for target 'emit_tests'
        ../../lib.mk:111: warning: ignoring old recipe for target 'emit_tests'
        gcc -m64    count_instructions.c ../harness.c event.c lib.c ../utils.c loop.S  -o /home/maddy/selftest_output//count_instructions
        In file included from count_instructions.c:13:
        event.h:12:10: fatal error: utils.h: No such file or directory
        12 | #include "utils.h"
          |          ^~~~~~~~~
        compilation terminated.
      
      This is due to missing of include path in CFLAGS. That is, CFLAGS and
      GIT_VERSION macros are defined in the powerpc/ folder Makefile which
      in this case is not involved.
      
      To address the failure in case of executing specific sub-folder test
      directly, a new rule file has been addded by the patch called "flags.mk"
      under selftest/powerpc/ folder and is linked to all the Makefile of
      powerpc/pmu sub-folders.
      Reported-by: default avatarSachin Sant <sachinp@linux.ibm.com>
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
      Tested-by: default avatarSachin Sant <sachinp@linux.ibm.com>
      [mpe: Fixup ifeq, make GIT_VERSION simply expanded to avoid re-executing git describe]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20240229093711.581230-2-maddy@linux.ibm.com
      5553a793
    • Madhavan Srinivasan's avatar
      selftests/powerpc: Re-order *FLAGS to follow lib.mk · 37496845
      Madhavan Srinivasan authored
      In some powerpc/ sub-folder Makefiles, CFLAGS are defined before lib.mk
      include. Clean it up by re-ordering the flags to follow after the mk
      include. This is needed to support sub-folders in powerpc/ buildable on
      its own.
      Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20240229093711.581230-1-maddy@linux.ibm.com
      37496845