The previous commit introduced the use of CLONE_NEWTIME without including
<sched.h> which contains its definition.
Add an explicit include of <sched.h> to ensure that CLONE_NEWTIME
is correctly defined before it is used.
Fixes: 2aec90036dcd ("selftests: vDSO: ensure vgetrandom works in a time namespace")
Signed-off-by: Yu Liao <liaoyu15(a)huawei.com>
---
Changes in v2:
- Include <sched.h> instead of <linux/sched.h>
v1: https://lore.kernel.org/all/20240919111841.20226-1-liaoyu15@huawei.com/
tools/testing/selftests/vDSO/vdso_test_getrandom.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/vDSO/vdso_test_getrandom.c b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
index 72a1d9b43a84..ddf37e3ab18b 100644
--- a/tools/testing/selftests/vDSO/vdso_test_getrandom.c
+++ b/tools/testing/selftests/vDSO/vdso_test_getrandom.c
@@ -11,6 +11,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
+#include <sched.h>
#include <signal.h>
#include <sys/auxv.h>
#include <sys/mman.h>
--
2.33.0
Hi Shuah,
I've now read your email several times trying to figure out what you
meant and what your objections are. This series is my best attempt at
trying to satisfy that. But my understanding still has a lot of question
marks, so I may have missed your point here. Nonetheless, maybe this
moves things forward a bit.
Jason
Cc: Shuah Khan <skhan(a)linuxfoundation.org>
Cc: Greg KH <greg(a)kroah.com>
Jason A. Donenfeld (3):
selftests: vDSO: condition chacha build on chacha implementation
selftests: vDSO: unconditionally build getrandom test
selftests: vDSO: improve getrandom and chacha error messages
tools/testing/selftests/vDSO/Makefile | 4 +-
.../testing/selftests/vDSO/vdso_test_chacha.c | 27 ++++---
.../selftests/vDSO/vdso_test_getrandom.c | 75 ++++++++-----------
3 files changed, 52 insertions(+), 54 deletions(-)
--
2.46.0
Changes in v4
- Removed unnecessary forking from selftest.
- Style changes in rstat.c (fallthrough & indents)
- Fixed a selftest bug that raised false negatives, caused by
cputime_adjust sometimes adjusting utime below ntime.
- Reworded cover letter for clarity & motivation
Changes in v3
- Signed-off-by & renamed subject for clarity.
Changes in v2
- Edited commit messages for clarity.
Niced CPU usage is a metric reported in host-level /proc/stat, but is
not currently reported in cgroup-level statistics. Thus, even if one
can observe that a fracion of the host's CPU time is spent on (non-)nice
tasks, the distribution of the CPU usage across cgroups is not readily
available to the user.
This patch introduces cgroup-level niced CPU utilization to cpu.stat.
Exposing this metric will allow users to accurately probe the niced CPU
metric for each workload, and make more informed decisions when
directing higher priority tasks. For instance, service routers will be
able to probe cgroups in the host to determine CPU time spent on niced
processes in each cgroup, and direct more traffic to cgroups with lower
non-nice CPU utilization.
Signed-off-by Joshua Hahn <joshua.hahnjy(a)gmail.com>
Joshua Hahn (2):
Tracking cgroup-level niced CPU time
Selftests for niced CPU statistics
include/linux/cgroup-defs.h | 1 +
kernel/cgroup/rstat.c | 19 ++++--
tools/testing/selftests/cgroup/test_cpu.c | 75 +++++++++++++++++++++++
3 files changed, 90 insertions(+), 5 deletions(-)
--
2.43.5
Including the network_helpers.h header in tests can lead to the following
build error:
./network_helpers.h: In function ‘csum_tcpudp_magic’:
./network_helpers.h:116:14: error: implicit declaration of function \
‘htons’ [-Werror=implicit-function-declaration]
116 | s += htons(proto + len);
The error is avoided in many cases thanks to some other headers included
earlier and bringing in arpa/inet.h (ie: test_progs.h).
Make sure that test_progs build success does not depend on header ordering
by adding the missing header include in network_helpers.h
Fixes: f6642de0c3e9 ("selftests/bpf: Add csum helpers")
Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore(a)bootlin.com>
---
tools/testing/selftests/bpf/network_helpers.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/bpf/network_helpers.h b/tools/testing/selftests/bpf/network_helpers.h
index c72c16e1aff825439896b38e59962ffafe92dc71..5764155b6d25188ed38e828e1e4a8a08f8a83934 100644
--- a/tools/testing/selftests/bpf/network_helpers.h
+++ b/tools/testing/selftests/bpf/network_helpers.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NETWORK_HELPERS_H
#define __NETWORK_HELPERS_H
+#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <linux/types.h>
---
base-commit: 67a7c7b656cfc10a7280f71641fb9e88726e8a5d
change-id: 20241008-network_helpers_fix-bbb7d1589930
Best regards,
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
This series is a cherry-pick on top of v6.12-rc1 from the one I sent
for selftests with other patches that were not net-related:
https://lore.kernel.org/all/20240925-selftests-gitignore-v3-0-9db896474170@…
The patches have not been modified, and the Reviewed-by tags have
been kept.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
---
Changes in v2:
- rebase to net/main and solve conflicts in rds/Makefile
- Tag series for net.
- Link to v1: https://lore.kernel.org/r/20240930-net-selftests-gitignore-v1-0-65225a85594…
---
Javier Carrasco (3):
selftests: net: add msg_oob to gitignore
selftests: net: rds: add include.sh to EXTRA_CLEAN
selftests: net: rds: add gitignore file for include.sh
tools/testing/selftests/net/.gitignore | 1 +
tools/testing/selftests/net/rds/.gitignore | 1 +
tools/testing/selftests/net/rds/Makefile | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
---
base-commit: 9234a2549cb6ac038bec36cc7c084218e9575513
change-id: 20240930-net-selftests-gitignore-18b844f29391
Best regards,
--
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
Check the total number of elements in both resultant lists are correct
within list_cut_position*(). Previously, only the first list's size was
checked. wo additional elements in the second list would not have been
caught.
Signed-off-by: I Hsin Cheng <richard120310(a)gmail.com>
---
change in v4:
Amend the description of commit message, make it less confusing
and focus on the correct check which is performed now.
lib/list-test.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/list-test.c b/lib/list-test.c
index 37cbc33e9fdb..b4b3810c71d0 100644
--- a/lib/list-test.c
+++ b/lib/list-test.c
@@ -408,6 +408,8 @@ static void list_test_list_cut_position(struct kunit *test)
KUNIT_EXPECT_PTR_EQ(test, cur, &entries[i]);
i++;
}
+
+ KUNIT_EXPECT_EQ(test, i, 3);
}
static void list_test_list_cut_before(struct kunit *test)
@@ -436,6 +438,8 @@ static void list_test_list_cut_before(struct kunit *test)
KUNIT_EXPECT_PTR_EQ(test, cur, &entries[i]);
i++;
}
+
+ KUNIT_EXPECT_EQ(test, i, 3);
}
static void list_test_list_splice(struct kunit *test)
--
2.43.0