|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4 |
|
| #
8245a70e |
| 10-Jun-2024 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Use correct type for pids
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.
Before pr
selftests/resctrl: Use correct type for pids
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.
Before printing PID, match the type to %d by casting to int which is enough for Linux (standard would allow using a longer integer type but generalizing for that would complicate the code unnecessarily, the selftest code does not need to be portable).
Signed-off-by: Ilpo Järvinen <[email protected]> Tested-by: Babu Moger <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
|
Revision tags: v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6 |
|
| #
2892731e |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Open perf fd before start & add error handling
Perf fd (pe_fd) is opened, reset, and enabled during every test the CAT selftest runs. Also, ioctl(pe_fd, ...) calls are not error c
selftests/resctrl: Open perf fd before start & add error handling
Perf fd (pe_fd) is opened, reset, and enabled during every test the CAT selftest runs. Also, ioctl(pe_fd, ...) calls are not error checked even if ioctl() could return an error.
Open perf fd only once before the tests and only reset and enable the counter within the test loop. Add error checking to pe_fd ioctl() calls.
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
433f437b |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Move cat_val() to cat_test.c and rename to cat_test()
The main CAT test function is called cat_val() and resides in cache.c which is illogical.
Rename the function to cat_test()
selftests/resctrl: Move cat_val() to cat_test.c and rename to cat_test()
The main CAT test function is called cat_val() and resides in cache.c which is illogical.
Rename the function to cat_test() and move it into cat_test.c.
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
3cdad0a5 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Convert perf related globals to locals
Perf related variables pea_llc_miss, pe_read, and pe_fd are globals in cache.c.
Convert them to locals for better scoping and make pea_llc_
selftests/resctrl: Convert perf related globals to locals
Perf related variables pea_llc_miss, pe_read, and pe_fd are globals in cache.c.
Convert them to locals for better scoping and make pea_llc_miss simpler by renaming it to pea. Make close(pe_fd) handling easier to understand by doing it inside cat_val().
Make also sizeof()s use safer way to determine the right struct.
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
038ce802 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Improve perf init
struct perf_event_attr initialization is spread into perf_event_initialize() and perf_event_attr_initialize() and setting ->config is hardcoded by the deepest le
selftests/resctrl: Improve perf init
struct perf_event_attr initialization is spread into perf_event_initialize() and perf_event_attr_initialize() and setting ->config is hardcoded by the deepest level.
perf_event_attr init belongs to perf_event_attr_initialize() so move it entirely there. Rename the other function perf_event_initialized_read_format().
Call each init function directly from the test as they will take different parameters (especially true after the perf related global variables are moved to local variables).
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
b6e6a582 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Consolidate naming of perf event related things
Naming for perf event related functions, types, and variables is inconsistent.
Make struct read_format and all functions related t
selftests/resctrl: Consolidate naming of perf event related things
Naming for perf event related functions, types, and variables is inconsistent.
Make struct read_format and all functions related to perf events start with "perf_". Adjust variable names towards the same direction but use shorter names for variables where appropriate (pe prefix).
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
3c6bfc9c |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Remove nested calls in perf event handling
Perf event handling has functions that are the sole caller of another perf event handling related function: - reset_enable_llc_perf()
selftests/resctrl: Remove nested calls in perf event handling
Perf event handling has functions that are the sole caller of another perf event handling related function: - reset_enable_llc_perf() calls perf_event_open_llc_miss() - perf_event_measure() calls get_llc_perf()
Remove the extra layer of calls to make the code easier to follow by moving the code into the calling function.
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
33403bc7 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Remove unnecessary __u64 -> unsigned long conversion
Perf counters are __u64 but the code converts them to unsigned long before printing them out.
Remove unnecessary type convers
selftests/resctrl: Remove unnecessary __u64 -> unsigned long conversion
Perf counters are __u64 but the code converts them to unsigned long before printing them out.
Remove unnecessary type conversion and retain the perf originating value as __u64.
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
5caf1b64 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Split show_cache_info() to test specific and generic parts
show_cache_info() calculates results and provides generic cache information. This makes it hard to alter pass/fail condi
selftests/resctrl: Split show_cache_info() to test specific and generic parts
show_cache_info() calculates results and provides generic cache information. This makes it hard to alter pass/fail conditions.
Separate the test specific checks into CAT and CMT test files and leave only the generic information part into show_cache_info().
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
a575c973 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Split measure_cache_vals()
measure_cache_vals() does a different thing depending on the test case that called it: - For CAT, it measures LLC misses through perf. - For CMT, it
selftests/resctrl: Split measure_cache_vals()
measure_cache_vals() does a different thing depending on the test case that called it: - For CAT, it measures LLC misses through perf. - For CMT, it measures LLC occupancy through resctrl.
Split these two functionalities into own functions the CAT and CMT tests can call directly. Replace passing the struct resctrl_val_param parameter with the filename because it's more generic and all those functions need out of resctrl_val.
Co-developed-by: Fenghua Yu <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
34813938 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Change function comments to say < 0 on error
A number function comments state the function return non-zero on failure but in reality they can only return 0 on success and < 0 on e
selftests/resctrl: Change function comments to say < 0 on error
A number function comments state the function return non-zero on failure but in reality they can only return 0 on success and < 0 on error.
Update the comments to say < 0 on error to match the behavior.
While at it, improve cat_val() comment to state that 0 means the test was run (either pass or fail).
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
bcd8a929 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Don't use ctrlc_handler() outside signal handling
perf_event_open_llc_miss() calls ctrlc_handler() to cleanup if perf_event_open() returns an error. Those cleanups, however, are n
selftests/resctrl: Don't use ctrlc_handler() outside signal handling
perf_event_open_llc_miss() calls ctrlc_handler() to cleanup if perf_event_open() returns an error. Those cleanups, however, are not the responsibility of perf_event_open_llc_miss() and it thus interferes unnecessarily with the usual cleanup pattern. Worse yet, ctrlc_handler() calls exit() in the end preventing the ordinary cleanup done in the calling function from executing.
ctrlc_handler() should only be used as a signal handler, not during normal error handling.
Remove call to ctrlc_handler() from perf_event_open_llc_miss(). As unmounting resctrlfs and test cleanup are already handled properly by error rollbacks in the calling functions, no other changes are necessary.
Suggested-by: Reinette Chatre <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
c90fba60 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Return -1 instead of errno on error
A number of functions in the resctrl selftests return errno. It is problematic because errno is positive which is often counterintuitive. Also,
selftests/resctrl: Return -1 instead of errno on error
A number of functions in the resctrl selftests return errno. It is problematic because errno is positive which is often counterintuitive. Also, every site returning errno prints the error message already with ksft_perror() so there is not much added value in returning the precise error code.
Simply convert all places returning errno to return -1 that is typical userspace error code in case of failures.
While at it, improve resctrl_val() comment to state that 0 means the test was run (either pass or fail).
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
cc8ff7f5 |
| 15-Dec-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Convert perror() to ksft_perror() or ksft_print_msg()
The resctrl selftest code contains a number of perror() calls. Some of them come with hash character and some don't. The ksel
selftests/resctrl: Convert perror() to ksft_perror() or ksft_print_msg()
The resctrl selftest code contains a number of perror() calls. Some of them come with hash character and some don't. The kselftest framework provides ksft_perror() that is compatible with test output formatting so it should be used instead of adding custom hash signs.
Some perror() calls are too far away from anything that sets error. For those call sites, ksft_print_msg() must be used instead.
Convert perror() to ksft_perror() or ksft_print_msg().
Other related changes: - Remove hash signs - Remove trailing stops & newlines from ksft_perror() - Add terminating newlines for converted ksft_print_msg() - Use consistent capitalization - Small fixes/tweaks to typos & grammar of the messages - Extract error printing out of PARENT_EXIT() to be able to differentiate
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1 |
|
| #
b1a901e0 |
| 04-Sep-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Simplify span lifetime
struct resctrl_val_param contains span member. resctrl_val(), however, never uses it because the value of span is embedded into the default benchmark comman
selftests/resctrl: Simplify span lifetime
struct resctrl_val_param contains span member. resctrl_val(), however, never uses it because the value of span is embedded into the default benchmark command and parsed from it by run_benchmark().
Remove span from resctrl_val_param. Provide DEFAULT_SPAN for the code that needs it. CMT and CAT tests communicate span that is different from the DEFAULT_SPAN between their internal functions which is converted into passing it directly as a parameter.
Signed-off-by: Ilpo Järvinen <[email protected]> Tested-by: Shaopeng Tan <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Reviewed-by: Shaopeng Tan <[email protected]> Reviewed-by: "Wieczor-Retman, Maciej" <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
27c734f4 |
| 13-Oct-2023 |
Maciej Wieczor-Retman <[email protected]> |
selftests/resctrl: Fix wrong format specifier
Compiling resctrl selftest after adding a __printf() attribute to ksft_print_msg() exposes -Wformat warning in show_cache_info(). The format specifier u
selftests/resctrl: Fix wrong format specifier
Compiling resctrl selftest after adding a __printf() attribute to ksft_print_msg() exposes -Wformat warning in show_cache_info(). The format specifier used expects a variable of type int but a long unsigned int variable is passed instead.
Change the format specifier to match the passed variable.
Signed-off-by: Maciej Wieczor-Retman <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
|
Revision tags: v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3 |
|
| #
bf68c717 |
| 17-Jul-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Remove test type checks from cat_val()
cat_val() is only used during CAT test but it checks for test type.
Remove test type checks and the unused else branch from cat_val().
Sig
selftests/resctrl: Remove test type checks from cat_val()
cat_val() is only used during CAT test but it checks for test type.
Remove test type checks and the unused else branch from cat_val().
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
3dad011b |
| 17-Jul-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Pass the real number of tests to show_cache_info()
Results include warm-up test which is discarded before passing the sum to show_cache_info(). show_cache_info() handles this by s
selftests/resctrl: Pass the real number of tests to show_cache_info()
Results include warm-up test which is discarded before passing the sum to show_cache_info(). show_cache_info() handles this by subtracting one from the number of tests in divisor. It is a trappy construct to have sum and number of tests parameters to disagree like this.
A more logical place for subtracting the skipped tests is where the sum is calculated so move it there. Pass the correct number of tests to show_cache_info() so it can be used directly as the divisor for calculating the average.
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
8ee592a6 |
| 17-Jul-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Don't use variable argument list for ->setup()
struct resctrl_val_param has ->setup() function that accepts variable argument list. All test cases use only 1 argument as input and
selftests/resctrl: Don't use variable argument list for ->setup()
struct resctrl_val_param has ->setup() function that accepts variable argument list. All test cases use only 1 argument as input and it's the struct resctrl_val_param pointer.
Instead of variable argument list, directly pass struct resctrl_val_param pointer as the only parameter to ->setup().
Co-developed-by: Fenghua Yu <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
7f3c980c |
| 17-Jul-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Don't pass test name to fill_buf
Test name is passed to fill_buf functions so that they can loop around buffer only once. This is required for CAT test case.
To loop around buffe
selftests/resctrl: Don't pass test name to fill_buf
Test name is passed to fill_buf functions so that they can loop around buffer only once. This is required for CAT test case.
To loop around buffer only once, caller doesn't need to let fill_buf know which test case it is. Instead, pass a boolean argument 'once' which makes fill_buf more generic.
As run_benchmark() no longer needs to pass the test name to run_fill_buf(), a few test running functions can be simplified to not write the test name into the default benchmark_cmd. The has_ben argument can also be removed now from those test running functions.
Co-developed-by: Fenghua Yu <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
326baed2 |
| 17-Jul-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Remove "malloc_and_init_memory" param from run_fill_buf()
run_fill_buf()'s malloc_and_init_memory parameter is always 1. There's also duplicated memory init code for malloc_and_in
selftests/resctrl: Remove "malloc_and_init_memory" param from run_fill_buf()
run_fill_buf()'s malloc_and_init_memory parameter is always 1. There's also duplicated memory init code for malloc_and_init_memory == 0 case in fill_buf() which is unused.
Remove the malloc_and_init_memory parameter and the duplicated mem init code.
While at it, fix also a typo in run_fill_buf() prototype's argument.
Co-developed-by: Fenghua Yu <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
67a86643 |
| 17-Jul-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Convert span to size_t
Span is defined either as unsigned long or int.
Consistently use size_t everywhere for span as it refers to size of the memory block.
Co-developed-by: Fen
selftests/resctrl: Convert span to size_t
Span is defined either as unsigned long or int.
Consistently use size_t everywhere for span as it refers to size of the memory block.
Co-developed-by: Fenghua Yu <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
51a0c3b7 |
| 17-Jul-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Close perf value read fd on errors
Perf event fd (fd_lm) is not closed when run_fill_buf() returns error.
Close fd_lm only in cat_val() to make it easier to track it is always cl
selftests/resctrl: Close perf value read fd on errors
Perf event fd (fd_lm) is not closed when run_fill_buf() returns error.
Close fd_lm only in cat_val() to make it easier to track it is always closed.
Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest") Signed-off-by: Ilpo Järvinen <[email protected]> Tested-by: Babu Moger <[email protected]> Tested-by: Shaopeng Tan (Fujitsu) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
|
Revision tags: v6.5-rc2, v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3, v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7, v6.3-rc6, v6.3-rc5, v6.3-rc4, v6.3-rc3, v6.3-rc2, v6.3-rc1, v6.2 |
|
| #
5874a6a1 |
| 15-Feb-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Correct get_llc_perf() param in function comment
get_llc_perf() function comment refers to cpu_no parameter that does not exist.
Correct get_llc_perf() the comment to document ll
selftests/resctrl: Correct get_llc_perf() param in function comment
get_llc_perf() function comment refers to cpu_no parameter that does not exist.
Correct get_llc_perf() the comment to document llc_perf_miss instead.
Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|
| #
9ce29d23 |
| 15-Feb-2023 |
Ilpo Järvinen <[email protected]> |
selftests/resctrl: Change initialize_llc_perf() return type to void
initialize_llc_perf() unconditionally returns 0.
initialize_llc_perf() performs only memory initialization, none of which can fai
selftests/resctrl: Change initialize_llc_perf() return type to void
initialize_llc_perf() unconditionally returns 0.
initialize_llc_perf() performs only memory initialization, none of which can fail.
Change the return type from int to void to accurately reflect that its return value doesn't need to be checked. Remove the error checking from the only callsite.
Co-developed-by: Fenghua Yu <[email protected]> Signed-off-by: Fenghua Yu <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]> Reviewed-by: Reinette Chatre <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
show more ...
|