| c96b1402 | 13-Jan-2025 |
Athira Rajeev <atrajeev@linux.vnet.ibm.com> |
selftests/powerpc/pmu: Update comment with details to understand auxv_generic_compat_pmu() utility function
auxv_generic_compat_pmu() utility function is to detect whether the system is having gener
selftests/powerpc/pmu: Update comment with details to understand auxv_generic_compat_pmu() utility function
auxv_generic_compat_pmu() utility function is to detect whether the system is having generic compat PMU. The check is based on base platform value from /proc/self/auxv. Update the comment with details on how auxv is used to detect the platform.
Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250113075858.45137-5-atrajeev@linux.vnet.ibm.com
show more ...
|
| 9785def2 | 13-Jan-2025 |
Kajol Jain <kjain@linux.ibm.com> |
selftests/powerpc/pmu: Add interface test for extended reg support
The testcase uses check_extended_regs_support and perf_get_platform_reg_mask function to check if the platform has extended reg sup
selftests/powerpc/pmu: Add interface test for extended reg support
The testcase uses check_extended_regs_support and perf_get_platform_reg_mask function to check if the platform has extended reg support. This will help to check if sampling pmu selftest is enabled or not for a given platform.
Signed-off-by: Kajol Jain <kjain@linux.ibm.com> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250113075858.45137-4-atrajeev@linux.vnet.ibm.com
show more ...
|
| dda32e37 | 22-Apr-2024 |
Michael Ellerman <mpe@ellerman.id.au> |
selftests/powerpc: Install tests in sub-directories
The sources for the powerpc selftests are arranged into sub-directories. However when the tests are built and installed, the sub-directories are s
selftests/powerpc: Install tests in sub-directories
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: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240422133453.1793988-2-mpe@ellerman.id.au
show more ...
|
| 5553a793 | 29-Feb-2024 |
Madhavan Srinivasan <maddy@linux.ibm.com> |
selftests/powerpc: Add flags.mk to support pmu buildable
When running `make -C powerpc/pmu run_tests` from top level selftests directory, currently this error is being reported:
make: Entering di
selftests/powerpc: Add flags.mk to support pmu buildable
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: Sachin Sant <sachinp@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Tested-by: Sachin Sant <sachinp@linux.ibm.com> [mpe: Fixup ifeq, make GIT_VERSION simply expanded to avoid re-executing git describe] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20240229093711.581230-2-maddy@linux.ibm.com
show more ...
|
| 6ff4dc25 | 06-Apr-2023 |
Benjamin Gray <bgray@linux.ibm.com> |
selftests/powerpc: Allow bind_to_cpu() to automatically pick CPU
All current users of bind_to_cpu() don't care _which_ CPU they get, just that they are bound to a single free one. So alter the inter
selftests/powerpc: Allow bind_to_cpu() to automatically pick CPU
All current users of bind_to_cpu() don't care _which_ CPU they get, just that they are bound to a single free one. So alter the interface to
1. Accept a BIND_CPU_ANY value that tells it to automatically pick a CPU 2. Return the picked CPU
And convert all these users to bind_to_cpu(BIND_CPU_ANY).
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230406043320.125138-4-bgray@linux.ibm.com
show more ...
|
| 4ecd0868 | 28-Feb-2023 |
Benjamin Gray <bgray@linux.ibm.com> |
selftests/powerpc: Pass make context to children
Make supports passing the 'jobserver' (parallel make support) to child invocations of make when either 1. The target command uses $(MAKE) directly
selftests/powerpc: Pass make context to children
Make supports passing the 'jobserver' (parallel make support) to child invocations of make when either 1. The target command uses $(MAKE) directly 2. The command starts with '+'
This context is not passed through expansions that result in $(MAKE), so the macros used in several places fail to pass on the jobserver context. Warnings are also raised by the child mentioning this.
Prepend macros lines that invoke $(MAKE) with '+' to allow passing the jobserver context to these children.
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230228000709.124727-3-bgray@linux.ibm.com
show more ...
|
| 5c20de57 | 03-Feb-2023 |
Benjamin Gray <bgray@linux.ibm.com> |
selftests/powerpc: Add {read,write}_{long,ulong}
Add helper functions to read and write (unsigned) long values directly from/to files. One of the kernel interfaces uses hex strings, so we need to al
selftests/powerpc: Add {read,write}_{long,ulong}
Add helper functions to read and write (unsigned) long values directly from/to files. One of the kernel interfaces uses hex strings, so we need to allow passing a base too.
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20230203003947.38033-5-bgray@linux.ibm.com
show more ...
|
| d1bc05b7 | 03-Feb-2023 |
Benjamin Gray <bgray@linux.ibm.com> |
selftests/powerpc: Parse long/unsigned long value safely
Often a file is expected to hold an integral value. Existing functions will use a C stdlib function like atoi or strtol to parse the file. Th
selftests/powerpc: Parse long/unsigned long value safely
Often a file is expected to hold an integral value. Existing functions will use a C stdlib function like atoi or strtol to parse the file. These operations are error prone, with complicated error conditions (atoi returns 0 if not a number, and is undefined behaviour if not in range. strtol returns 0 if not a number, and LONG_MIN/MAX if not in range + sets errno to ERANGE).
Signed-off-by: Benjamin Gray <bgray@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20230203003947.38033-4-bgray@linux.ibm.com
show more ...
|