diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-01-22 18:15:47 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-01-22 18:58:40 +0000 |
commit | 23f39950e824b8a8f31cfb26fc9b37ab1aca656f (patch) | |
tree | 4faa23b37e4583293fd307aeb46c14f915d9a7bc /lib/igt_aux.c | |
parent | 96f3a1b876e0dd24706b85fb872f12031a436e84 (diff) |
lib: Include the size in the error message for mlock
Knowing how much we tried to allocate would be useful if one should need
to debug why it failed.
References: https://bugs.freedesktop.org/show_bug.cgi?id=109439
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r-- | lib/igt_aux.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c index 1250d5c5..2e2d552b 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -1080,14 +1080,14 @@ void igt_lock_mem(size_t size) locked_mem = malloc(locked_size); igt_require_f(locked_mem, - "Could not allocate enough memory to lock.\n"); + "Could not malloc %zdMiB for locking.\n", size); /* write into each page to ensure it is allocated */ for (i = 0; i < locked_size; i += pagesize) locked_mem[i] = i; ret = mlock(locked_mem, locked_size); - igt_assert_f(ret == 0, "Could not lock memory into RAM.\n"); + igt_assert_f(ret == 0, "Could not mlock %zdMiB.\n", size); } /** |