<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/powerpc/pmu/Makefile, branch linux-rolling-stable</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-rolling-stable'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-04-29T13:54:43Z</updated>
<entry>
<title>selftests/powerpc: Install tests in sub-directories</title>
<updated>2024-04-29T13:54:43Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2024-04-22T13:34:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=dda32e37d397f5937cc24a6e98b71d3645f51afa'/>
<id>urn:sha1:dda32e37d397f5937cc24a6e98b71d3645f51afa</id>
<content type='text'>
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 &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20240422133453.1793988-2-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>selftests/powerpc: Convert pmu Makefile to for loop style</title>
<updated>2024-04-29T13:54:43Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2024-04-22T13:34:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=822a04957cc5e675570645f506270797a1cf2865'/>
<id>urn:sha1:822a04957cc5e675570645f506270797a1cf2865</id>
<content type='text'>
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: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20240422133453.1793988-1-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>selftests/powerpc: Add flags.mk to support pmu buildable</title>
<updated>2024-04-29T13:53:01Z</updated>
<author>
<name>Madhavan Srinivasan</name>
<email>maddy@linux.ibm.com</email>
</author>
<published>2024-02-29T09:37:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=5553a79387e92ffd812a49fdcf679f392281f6a9'/>
<id>urn:sha1:5553a79387e92ffd812a49fdcf679f392281f6a9</id>
<content type='text'>
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 &lt;sachinp@linux.ibm.com&gt;
Signed-off-by: Madhavan Srinivasan &lt;maddy@linux.ibm.com&gt;
Tested-by: Sachin Sant &lt;sachinp@linux.ibm.com&gt;
[mpe: Fixup ifeq, make GIT_VERSION simply expanded to avoid re-executing git describe]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20240229093711.581230-2-maddy@linux.ibm.com
</content>
</entry>
<entry>
<title>selftests/powerpc: Fix emit_tests to work with run_kselftest.sh</title>
<updated>2023-09-22T10:29:48Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2023-09-21T07:26:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=58b33e78a31782ffe25d404d5eba9a45fe636e27'/>
<id>urn:sha1:58b33e78a31782ffe25d404d5eba9a45fe636e27</id>
<content type='text'>
In order to use run_kselftest.sh the list of tests must be emitted to
populate kselftest-list.txt.

The powerpc Makefile is written to use EMIT_TESTS. But support for
EMIT_TESTS was dropped in commit d4e59a536f50 ("selftests: Use runner.sh
for emit targets"). Although prior to that commit a548de0fe8e1
("selftests: lib.mk: add test execute bit check to EMIT_TESTS") had
already broken run_kselftest.sh for powerpc due to the executable check
using the wrong path.

It can be fixed by replacing the EMIT_TESTS definitions with actual
emit_tests rules in the powerpc Makefiles. This makes run_kselftest.sh
able to run powerpc tests:

  $ cd linux
  $ export ARCH=powerpc
  $ export CROSS_COMPILE=powerpc64le-linux-gnu-
  $ make headers
  $ make -j -C tools/testing/selftests install
  $ grep -c "^powerpc" tools/testing/selftests/kselftest_install/kselftest-list.txt
  182

Fixes: d4e59a536f50 ("selftests: Use runner.sh for emit targets")
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230921072623.828772-1-mpe@ellerman.id.au

</content>
</entry>
<entry>
<title>selftests/powerpc: Pass make context to children</title>
<updated>2023-03-30T12:35:43Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-02-28T00:07:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=4ecd0868c5138238dec8a1549bb6ff8e5b48208b'/>
<id>urn:sha1:4ecd0868c5138238dec8a1549bb6ff8e5b48208b</id>
<content type='text'>
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 &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230228000709.124727-3-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc: Use CLEAN macro to fix make warning</title>
<updated>2023-03-30T12:35:43Z</updated>
<author>
<name>Benjamin Gray</name>
<email>bgray@linux.ibm.com</email>
</author>
<published>2023-02-28T00:07:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=69608683a65be5322ef44091eaeb9890472b2eea'/>
<id>urn:sha1:69608683a65be5322ef44091eaeb9890472b2eea</id>
<content type='text'>
The CLEAN macro was added in 337f1e36 to prevent the

    Makefile:50: warning: overriding recipe for target 'clean'
    ../../lib.mk:124: warning: ignoring old recipe for target 'clean'

style warnings. Expand it's use to fix another case of redefining a
target directly.

Signed-off-by: Benjamin Gray &lt;bgray@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://msgid.link/20230228000709.124727-2-bgray@linux.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/pmu: Add support for perf event code tests</title>
<updated>2022-06-28T22:57:42Z</updated>
<author>
<name>Athira Rajeev</name>
<email>atrajeev@linux.vnet.ibm.com</email>
</author>
<published>2022-06-10T13:40:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0a110a4b69dacc30ce4f6c10c0396bd2fd097831'/>
<id>urn:sha1:0a110a4b69dacc30ce4f6c10c0396bd2fd097831</id>
<content type='text'>
Add new folder for enabling perf event code tests which includes
checking for group constraints, valid/invalid events, also checks for
event excludes, alternatives so on. A new folder "event_code_tests", is
created under "selftests/powerpc/pmu".

Also updates the corresponding Makefiles in "selftests/powerpc" and
"event_code_tests" folder.

Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220610134113.62991-16-atrajeev@linux.vnet.ibm.com

</content>
</entry>
<entry>
<title>selftests/powerpc/pmu: Add support for perf sampling tests</title>
<updated>2022-03-01T12:37:49Z</updated>
<author>
<name>Athira Rajeev</name>
<email>atrajeev@linux.vnet.ibm.com</email>
</author>
<published>2022-01-27T07:19:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c315669e2fbd71bb9387066f60f0d91b0ceb28f3'/>
<id>urn:sha1:c315669e2fbd71bb9387066f60f0d91b0ceb28f3</id>
<content type='text'>
Add support functions for enabling perf sampling test in a new folder
"sampling_tests" under "selftests/powerpc/pmu". This includes support
functions for allocating and processing the mmap buffer. These functions
are added/defined in "sampling_tests/misc.*" files.

Also updates the corresponding Makefiles in "selftests/powerpc" and
"sampling_tests" folder.

Signed-off-by: Athira Rajeev &lt;atrajeev@linux.vnet.ibm.com&gt;
[mpe: Drop unneeded bits from the Makefile]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220127072012.662451-3-kjain@linux.ibm.com
</content>
</entry>
<entry>
<title>selftests/powerpc: Add a test of counting larx/stcx</title>
<updated>2020-05-15T01:58:55Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2020-04-26T11:44:10Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7481cad4747303442209bc5dba2f56c3afcea07d'/>
<id>urn:sha1:7481cad4747303442209bc5dba2f56c3afcea07d</id>
<content type='text'>
This is based on the count_instructions test.

However this one also counts the number of failed stcx's, and in
conjunction with knowing the size of the stcx loop, can calculate the
total number of instructions executed even in the face of
non-deterministic stcx failures.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20200426114410.3917383-1-mpe@ellerman.id.au
</content>
</entry>
<entry>
<title>selftests/powerpc: Fix Makefiles for headers_install change</title>
<updated>2018-09-28T05:07:45Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2018-09-28T04:53:18Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7e0cf1c983b5b24426d130fd949a055d520acc9a'/>
<id>urn:sha1:7e0cf1c983b5b24426d130fd949a055d520acc9a</id>
<content type='text'>
Commit b2d35fa5fc80 ("selftests: add headers_install to lib.mk")
introduced a requirement that Makefiles more than one level below the
selftests directory need to define top_srcdir, but it didn't update
any of the powerpc Makefiles.

This broke building all the powerpc selftests with eg:

  make[1]: Entering directory '/src/linux/tools/testing/selftests/powerpc'
  BUILD_TARGET=/src/linux/tools/testing/selftests/powerpc/alignment; mkdir -p $BUILD_TARGET; make OUTPUT=$BUILD_TARGET -k -C alignment all
  make[2]: Entering directory '/src/linux/tools/testing/selftests/powerpc/alignment'
  ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory
  make[2]: *** No rule to make target '../../../../scripts/subarch.include'.
  make[2]: Failed to remake makefile '../../../../scripts/subarch.include'.
  Makefile:38: recipe for target 'alignment' failed

Fix it by setting top_srcdir in the affected Makefiles.

Fixes: b2d35fa5fc80 ("selftests: add headers_install to lib.mk")
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
</feed>
