linux-stable/lib/kunit
Daniel Latypov 6419abb80e kunit: remove va_format from kunit_assert
The concern is that having a lot of redundant fields in kunit_assert can
blow up stack usage if the compiler doesn't optimize them away [1].

The comment on this field implies that it was meant to be initialized
when the expect/assert was declared, but this only happens when we run
kunit_do_failed_assertion().

We don't need to access it outside of that function, so move it out of
the struct and make it a local variable there.

This change also takes the chance to reduce the number of macros by
inlining the now simplified KUNIT_INIT_ASSERT_STRUCT() macro.

[1] https://groups.google.com/g/kunit-dev/c/i3fZXgvBrfA/m/VULQg1z6BAAJ

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-01-31 11:55:27 -07:00
..
.kunitconfig kunit: tool: make --kunitconfig accept dirs, add lib/kunit fragment 2021-04-02 14:14:36 -06:00
assert.c kunit: remove va_format from kunit_assert 2022-01-31 11:55:27 -07:00
debugfs.c kunit: Support skipped tests 2021-06-25 11:31:03 -06:00
debugfs.h
executor.c kunit: add 'kunit.action' param to allow listing out tests 2021-10-19 14:18:50 -06:00
executor_test.c kunit: fix too small allocation when using suite-only kunit.filter_glob 2021-10-19 14:18:49 -06:00
Kconfig
kunit-example-test.c kunit: add example test case showing off all the expect macros 2022-01-25 12:49:20 -07:00
kunit-test.c kunit: drop assumption in kunit-log-test about current suite 2021-10-19 14:18:49 -06:00
Makefile
string-stream-test.c
string-stream.c
string-stream.h isystem: ship and use stdarg.h 2021-08-19 09:02:55 +09:00
test.c kunit: remove va_format from kunit_assert 2022-01-31 11:55:27 -07:00
try-catch-impl.h
try-catch.c exit: Rename complete_and_exit to kthread_complete_and_exit 2021-12-13 12:04:45 -06:00