aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/cachestat/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2023-08-16selftests: cachestat: properly link in librtAndre Przywara1-1/+1
Libraries should be listed last on the compiler's command line, so that the linker can look for and find still unresolved symbols. The librt library, required for the shm_* functions, was announced using CFLAGS, which puts the library *before* the source files, and fails compilation on my system: ====================== gcc -isystem /src/linux-selftests/usr/include -Wall -lrt test_cachestat.c -o /src/linux-selftests/kselftest/cachestat/test_cachestat /usr/bin/ld: /tmp/cceQWO3u.o: in function `test_cachestat_shmem': test_cachestat.c:(.text+0x890): undefined reference to `shm_open' /usr/bin/ld: test_cachestat.c:(.text+0x99c): undefined reference to `shm_unlink' collect2: error: ld returned 1 exit status make[4]: *** [../lib.mk:181: /src/linux-selftests/kselftest/cachestat/test_cachestat] Error 1 ====================== Announce the library using the LDLIBS variable, which ensures the proper ordering on the command line. Signed-off-by: Andre Przywara <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
2023-06-09selftests: add selftests for cachestatNhat Pham1-0/+8
Test cachestat on a newly created file, /dev/ files, /proc/ files and a directory. Also test on a shmem file (which can also be tested with huge pages since tmpfs supports huge pages). [[email protected]: fix spelling mistake "trucate" -> "truncate"] Link: https://lkml.kernel.org/r/[email protected] [[email protected]: avoid excessive stack allocation] Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Nhat Pham <[email protected]> Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Acked-by: Johannes Weiner <[email protected]> Cc: Brian Foster <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Colin Ian King <[email protected]> Cc: Michael Ellerman <[email protected]> Signed-off-by: Andrew Morton <[email protected]>