[PATCH 5/6] selftests/mm: Print some details when uffd-stress gets bad params

Brendan Jackman posted 6 patches 9 months, 4 weeks ago
There is a newer version of this series
[PATCH 5/6] selftests/mm: Print some details when uffd-stress gets bad params
Posted by Brendan Jackman 9 months, 4 weeks ago
So this can be debugged more easily.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
 tools/testing/selftests/mm/uffd-stress.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c
index db5366b4766e5bfa2d1150d2f3c2d32469a6e28b..1facfb79e09aa4113e344d7d90dec06a37264058 100644
--- a/tools/testing/selftests/mm/uffd-stress.c
+++ b/tools/testing/selftests/mm/uffd-stress.c
@@ -456,7 +456,8 @@ int main(int argc, char **argv)
 
 	nr_pages_per_cpu = bytes / page_size / nr_cpus;
 	if (!nr_pages_per_cpu) {
-		_err("invalid MiB");
+		_err("invalid MiB %lu (%lu / %lu / %lu)",
+			nr_pages_per_cpu, bytes, page_size, nr_cpus);
 		usage();
 	}
 

-- 
2.48.1.601.g30ceb7b040-goog
Re: [PATCH 5/6] selftests/mm: Print some details when uffd-stress gets bad params
Posted by Brendan Jackman 9 months, 4 weeks ago
On Thu, 20 Feb 2025 at 16:03, Brendan Jackman <jackmanb@google.com> wrote:
>         nr_pages_per_cpu = bytes / page_size / nr_cpus;
>         if (!nr_pages_per_cpu) {
> -               _err("invalid MiB");
> +               _err("invalid MiB %lu (%lu / %lu / %lu)",
> +                       nr_pages_per_cpu, bytes, page_size, nr_cpus);

Oh this is actually wrong - the number it's printing isn't MiB.

Assuming there's a v2 I'll fix that up. Otherwise honestly this patch
could just be dropped, it's not important.