Re: [PATCH v2 4/5] KVM: selftests: Add an interface to read the data of named vcpu stat

2024-05-20 Thread Manali Shukla
On 5/2/2024 6:44 PM, Andrew Jones wrote: > On Wed, May 01, 2024 at 02:54:32PM GMT, Manali Shukla wrote: >> From: Manali Shukla >> >> The interface is used to read the data values of a specified vcpu stat >> from the currenly available binary stats interface. >> >> Signed-off-by: Manali Shukla >>

[PATCH] selftests/openat2: Fix build warnings on ppc64

2024-05-20 Thread Michael Ellerman
Fix warnings like: openat2_test.c: In function ‘test_openat2_flags’: openat2_test.c:303:73: warning: format ‘%llX’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=] By switching to unsigned long long for u64 for ppc64

[PATCH] selftests/mm: Fix build warnings on ppc64

2024-05-20 Thread Michael Ellerman
Fix warnings like: In file included from uffd-unit-tests.c:8: uffd-unit-tests.c: In function ‘uffd_poison_handle_fault’: uffd-common.h:45:33: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=] B

[PATCH] selftests: cachestat: Fix build warnings on ppc64

2024-05-20 Thread Michael Ellerman
Fix warnings like: test_cachestat.c: In function ‘print_cachestat’: test_cachestat.c:30:38: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=] By switching to unsigned long long for u64 for ppc64 b

[PATCH] selftests/overlayfs: Fix build error on ppc64

2024-05-20 Thread Michael Ellerman
Fix build error on ppc64: dev_in_maps.c: In function ‘get_file_dev_and_inode’: dev_in_maps.c:60:59: error: format ‘%llu’ expects argument of type ‘long long unsigned int *’, but argument 7 has type ‘__u64 *’ {aka ‘long unsigned int *’} [-Werror=format=] By switching to unsigned long long f

Re: [PATCH] tracing/selftests: Fix kprobe event name test for .isra. functions

2024-05-20 Thread Steven Rostedt
On Tue, 21 May 2024 10:49:19 +0900 Masami Hiramatsu (Google) wrote: > > It is listed twice. This causes the attached kprobe to it to fail which in > > turn fails the test. Instead of just picking the function function that is > > found in available_filter_functions, pick the first one that is lis

Re: [PATCH] tracing/selftests: Fix kprobe event name test for .isra. functions

2024-05-20 Thread Google
On Mon, 20 May 2024 20:57:37 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (Google)" > > The kprobe_eventname.tc test checks if a function with .isra. can have a > kprobe attached to it. It loops through the kallsyms file for all the > functions that have the .isra. name, and checks if it

[PATCH] tracing/selftests: Fix kprobe event name test for .isra. functions

2024-05-20 Thread Steven Rostedt
From: "Steven Rostedt (Google)" The kprobe_eventname.tc test checks if a function with .isra. can have a kprobe attached to it. It loops through the kallsyms file for all the functions that have the .isra. name, and checks if it exists in the available_filter_functions file, and if it does, it us

[PATCH 2/2] selftests/ftrace: Update required config

2024-05-20 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) Update required config options for running all tests. This also sorts the config entries alphabetically. Signed-off-by: Masami Hiramatsu (Google) --- tools/testing/selftests/ftrace/config | 26 +++--- 1 file changed, 19 insertions(+), 7 del

[PATCH 1/2] selftests/ftrace: Fix to check required event file

2024-05-20 Thread Masami Hiramatsu (Google)
From: Masami Hiramatsu (Google) The dynevent/test_duplicates.tc test case uses `syscalls/sys_enter_openat` event for defining eprobe on it. Since this `syscalls` events depend on CONFIG_FTRACE_SYSCALLS=y, if it is not set, the test will fail. Add the event file to `required` line so that the tes

[PATCH 0/2] selftests/ftrace: Fix config related issues

2024-05-20 Thread Masami Hiramatsu (Google)
Here is a couple of patches to fix some issues related to kconfig. I found these issues when I built the kernel with tools/testing/selftests/ftrace/config. Thank you, --- Masami Hiramatsu (Google) (2): selftests/ftrace: Fix to check required event file selftests/ftrace: Update require

[PATCH net] testing: net-drv: use stats64 for testing

2024-05-20 Thread Joe Damato
Testing a network device that has large numbers of bytes/packets may overflow. Using stats64 when comparing fixes this problem. I tripped on this while iterating on a qstats patch for mlx5. See below for confirmation without my added code that this is a bug. Before this patch (with added debuggin

Re: [GIT PULL] Kselftest fixes for Linux 6.10-rc1

2024-05-20 Thread pr-tracker-bot
The pull request you sent on Mon, 20 May 2024 11:34:03 -0600: > git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest > tags/linux_kselftest-next-6.10-rc1-fixes has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/70ec81c2e2b4005465ad0d042e90b36087c36104 Than

Re: [PATCH v5] kunit: Cover 'assert.c' with tests

2024-05-20 Thread Rae Moar
On Thu, May 16, 2024 at 11:17 PM Ivan Orlov wrote: > > There are multiple assertion formatting functions in the `assert.c` > file, which are not covered with tests yet. Implement the KUnit test > for these functions. > > The test consists of 11 test cases for the following functions: > > 1) 'is_li

[PATCH] selftests: mm: check return values

2024-05-20 Thread Muhammad Usama Anjum
Check return value and return error/skip the tests. Fixes: 46fd75d4a3c9 ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Muhammad Usama Anjum --- tools/testing/selftests/mm/pagemap_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/

kselftest/next kselftest-lkdtm: 2 runs, 1 regressions (linux_kselftest-next-6.10-rc1-fixes)

2024-05-20 Thread kernelci.org bot
kselftest/next kselftest-lkdtm: 2 runs, 1 regressions (linux_kselftest-next-6.10-rc1-fixes) This legacy KernelCI providing this report will shutdown sometime soon in favor of our new KernelCI infra. Not all tests are being migrated. If you are still using this report and want us to prioritize you

kselftest/next kselftest-livepatch: 1 runs, 1 regressions (linux_kselftest-next-6.10-rc1-fixes)

2024-05-20 Thread kernelci.org bot
kselftest/next kselftest-livepatch: 1 runs, 1 regressions (linux_kselftest-next-6.10-rc1-fixes) This legacy KernelCI providing this report will shutdown sometime soon in favor of our new KernelCI infra. Not all tests are being migrated. If you are still using this report and want us to prioritize

[PATCH RESEND 6.6.y] kselftest: Add a ksft_perror() helper

2024-05-20 Thread Edward Liaw
From: Mark Brown [ Upstream commit 907f33028871fa7c9a3db1efd467b78ef82cce20 ] The standard library perror() function provides a convenient way to print an error message based on the current errno but this doesn't play nicely with KTAP output. Provide a helper which does an equivalent thing in a

kselftest/next build: 4 builds: 0 failed, 4 passed, 1 warning (linux_kselftest-next-6.10-rc1-fixes)

2024-05-20 Thread kernelci.org bot
kselftest/next build: 4 builds: 0 failed, 4 passed, 1 warning (linux_kselftest-next-6.10-rc1-fixes) This legacy KernelCI providing this report will shutdown sometime soon in favor of our new KernelCI infra. Not all tests are being migrated. If you are still using this report and want us to priori

[PATCH] selftests: firmware: conform test to TAP

2024-05-20 Thread Muhammad Usama Anjum
Conform the layout, informational and status messages to TAP. No functional change is intended other than the layout of output messages. Without using TAP messages, the passed/failed/skip test names cannot be found. This is a prepartory patch, more patches will be sent to comform the test completel

[GIT PULL] Kselftest fixes for Linux 6.10-rc1

2024-05-20 Thread Shuah Khan
Hi Linus, Please pull this urgent kselftest fixes update for Linux 6.10-rc1. This kselftest fixes update for Linux 6.10-rc1 consists of reverts framework change to add D_GNU_SOURCE to KHDR_INCLUDES to Makefile, lib.mk, and kselftest_harness.h and follow-on changes to cgroup and sgx test as they

First Contributions for KUnit

2024-05-20 Thread Artur A C de Barros
Hi all, We are students from the State University of Campinas with an interest in contributing to the kernel. We are part of LKCAMP, a student group that focuses on researching and contributing to open source software. Our group has organized kernel hackathons in the past [1] that resulted in s

Re: [PATCH] kselftest/alsa: Ensure _GNU_SOURCE is defined

2024-05-20 Thread Shuah Khan
On 5/17/24 02:35, Takashi Iwai wrote: On Thu, 16 May 2024 17:27:33 +0200, Mark Brown wrote: The pcmtest driver tests use the kselftest harness which requires that _GNU_SOURCE is defined but nothing causes it to be defined. Since the KHDR_INCLUDES Makefile variable has had the required define a

[PATCH v4 16/16] selftests/resctrl: Remove test name comparing from write_bm_pid_to_resctrl()

2024-05-20 Thread Ilpo Järvinen
write_bm_pid_to_resctrl() uses resctrl_val to check test name which is not a good interface generic resctrl FS functions should provide. Only MBM and CMT tests define mongrp so the test name check in write_bm_pid_to_resctrl() can be changed to depend simply on mongrp being non-NULL. With last use

[PATCH v4 15/16] selftests/resctrl: Remove mongrp from CMT test

2024-05-20 Thread Ilpo Järvinen
The CMT selftest instanciates a monitor group to read LLC occupancy. Since the test also creates a control group, it is unnecessary to create another one for monitoring because control groups already provide monitoring too. Remove the unnecessary monitor group from the CMT selftest. Suggested-by:

[PATCH v4 14/16] selftests/resctrl: Remove mongrp from MBA test

2024-05-20 Thread Ilpo Järvinen
Nothing during MBA test uses mongrp even if it has been defined ever since the introduction of the MBA test in the commit 01fee6b4d1f9 ("selftests/resctrl: Add MBA test"). Remove the mongrp from MBA test. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/mba_test.c | 1 - 1 file

[PATCH v4 13/16] selftests/resctrl: Convert ctrlgrp & mongrp to pointers

2024-05-20 Thread Ilpo Järvinen
The struct resctrl_val_param has control and monitor groups as char arrays but they are not supposed to be mutated within resctrl_val(). Convert the ctrlgrp and mongrp char array within resctrl_val_param to plain const char pointers and adjust the strlen() based checks to check NULL instead. Conv

[PATCH v4 12/16] selftests/resctrl: Make some strings passed to resctrlfs functions const

2024-05-20 Thread Ilpo Järvinen
Control group, monitor group and resctrl_val are not mutated and should not be mutated within resctrlfs.c functions. Mark this by using const char * for the arguments. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl.h | 7 --- tools/testing/selftests/resctrl/resct

[PATCH v4 11/16] selftests/resctrl: Simplify bandwidth report type handling

2024-05-20 Thread Ilpo Järvinen
bw_report is only needed for selecting the correct value from the values IMC measured. It is a member in the resctrl_val_param struct and is always set to "reads". The value is then checked in resctrl_val() using validate_bw_report_request() that besides validating the input, assumes it can mutate

[PATCH v4 10/16] selftests/resctrl: Add ->init() callback into resctrl_val_param

2024-05-20 Thread Ilpo Järvinen
The struct resctrl_val_param is there to customize behavior inside resctrl_val() which is currently not used to full extent and there are number of strcmp()s for test name in resctrl_val done by resctrl_val(). Create ->init() hook into the struct resctrl_val_param to cleanly do per test initializa

[PATCH v4 09/16] selftests/resctrl: Add ->measure() callback to resctrl_val_param

2024-05-20 Thread Ilpo Järvinen
The measurement done in resctrl_val() varies depending on test type. The decision for how to measure is decided based on the string compare to test name which is quite inflexible. Add ->measure() callback into the struct resctrl_val_param to allow each test to provide necessary code as a function

[PATCH v4 08/16] selftests/resctrl: Simplify mem bandwidth file code for MBA & MBM tests

2024-05-20 Thread Ilpo Järvinen
initialize_mem_bw_resctrl() and set_mbm_path() contain complicated set of conditions, each yielding different file to be opened to measure memory bandwidth through resctrl FS. In practice, only two of them are used. For MBA test, ctrlgrp is always provided, and for MBM test both ctrlgrp and mongrp

[PATCH v4 07/16] selftests/resctrl: Rename measure_vals() to measure_mem_bw_vals() & document

2024-05-20 Thread Ilpo Järvinen
measure_val() is awfully generic name so rename it to measure_mem_bw() to describe better what it does and document the function parameters. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/resctrl_val.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --g

[PATCH v4 06/16] selftests/resctrl: Cleanup bm_pid and ppid usage & limit scope

2024-05-20 Thread Ilpo Järvinen
'bm_pid' and 'ppid' are global variables. As they are used by different processes and in signal handler, they cannot be entirely converted into local variables. The scope of those variables can still be reduced into resctrl_val.c only. As PARENT_EXIT() macro is using 'ppid', make it a function in

[PATCH v4 05/16] selftests/resctrl: Use correct type for pids

2024-05-20 Thread Ilpo Järvinen
A few functions receive PIDs through int arguments. PIDs variables should be of type pid_t, not int. Convert pid arguments from int to pid_t. Signed-off-by: Ilpo Järvinen --- tools/testing/selftests/resctrl/cache.c | 6 +++--- tools/testing/selftests/resctrl/resctrl.h | 4 ++-- tools/

[PATCH v4 04/16] selftests/resctrl: Consolidate get_domain_id() into resctrl_val()

2024-05-20 Thread Ilpo Järvinen
Both initialize_mem_bw_resctrl() and initialize_llc_occu_resctrl() that are called from resctrl_val() need to determine domain ID to construct resctrl fs related paths. Both functions do it by taking CPU ID which neither needs for any other purpose than determining the domain ID. Consolidate deter

[PATCH v4 03/16] selftests/resctrl: Make "bandwidth" consistent in comments & prints

2024-05-20 Thread Ilpo Järvinen
Resctrl selftests refer to "bandwidth" currently in two other forms in the code ("B/W" and "band width"). Use "bandwidth" consistently everywhere. While at it, fix also one "over flow" -> "overflow" on a line that is touched by the change. Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvin

[PATCH v4 02/16] selftests/resctrl: Calculate resctrl FS derived mem bw over sleep(1) only

2024-05-20 Thread Ilpo Järvinen
For MBM/MBA tests, measure_vals() calls get_mem_bw_imc() that performs the measurement over a duration of sleep(1) call. The memory bandwidth numbers from IMC are derived over this duration. The resctrl FS derived memory bandwidth, however, is calculated inside measure_vals() and only takes delta b

[PATCH v4 01/16] selftests/resctrl: Fix closing IMC fds on error and open-code R+W instead of loops

2024-05-20 Thread Ilpo Järvinen
The imc perf fd close() calls are missing from all error paths. In addition, get_mem_bw_imc() handles fds in a for loop but close() is based on two fixed indexes READ and WRITE. Open code inner for loops to READ+WRITE entries for clarity and add a function to close() IMC fds properly in all cases.

[PATCH v4 00/16] selftests/resctrl: resctrl_val() related cleanups & improvements

2024-05-20 Thread Ilpo Järvinen
Hi all, This series does a number of cleanups into resctrl_val() and generalizes it by removing test name specific handling from the function. One of the changes improves MBA/MBM measurement by narrowing down the period the resctrl FS derived memory bandwidth numbers are measured over. My feel is

[PATCH v4 00/16] selftests/resctrl: resctrl_val() related cleanups & improvements

2024-05-20 Thread Ilpo Järvinen
Hi all, This series does a number of cleanups into resctrl_val() and generalizes it by removing test name specific handling from the function. One of the changes improves MBA/MBM measurement by narrowing down the period the resctrl FS derived memory bandwidth numbers are measured over. My feel is

Re: [PATCH net v3] selftests: net: kill smcrouted in the cleanup logic in amt.sh

2024-05-20 Thread patchwork-bot+netdevbpf
Hello: This patch was applied to netdev/net.git (main) by David S. Miller : On Sat, 18 May 2024 13:20:52 + you wrote: > The amt.sh requires smcrouted for multicasting routing. > So, it starts smcrouted before forwarding tests. > It must be stopped after all tests, but it isn't. > > To fix th

Re: [PATCH net v3] selftests: net: kill smcrouted in the cleanup logic in amt.sh

2024-05-20 Thread Simon Horman
On Sat, May 18, 2024 at 01:20:52PM +, Taehee Yoo wrote: > The amt.sh requires smcrouted for multicasting routing. > So, it starts smcrouted before forwarding tests. > It must be stopped after all tests, but it isn't. > > To fix this issue, it kills smcrouted in the cleanup logic. > > Fixes: c

Re: [PATCH 1/2] kunit: test: Add vm_mmap() allocation resource manager

2024-05-20 Thread Mark Rutland
On Sun, May 19, 2024 at 12:12:52PM -0700, Kees Cook wrote: > For tests that need to allocate using vm_mmap() (e.g. usercopy and > execve), provide the interface to have the allocation tracked by KUnit > itself. This requires bringing up a placeholder userspace mm. > > This combines my earlier atte