aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/kunit/executor.c
diff options
context:
space:
mode:
authorDavid Gow <davidgow@google.com>2022-11-25 16:43:04 +0800
committerShuah Khan <skhan@linuxfoundation.org>2022-12-12 14:13:47 -0700
commit908d0c177bbc7c34ab9129c6f2bcd87487115632 (patch)
tree80037e1544ea24f7f6d7e02dd6270fe0a9ba941d /lib/kunit/executor.c
parentkunit: tool: make --json do nothing if --raw_ouput is set (diff)
downloadwireguard-linux-908d0c177bbc7c34ab9129c6f2bcd87487115632.tar.xz
wireguard-linux-908d0c177bbc7c34ab9129c6f2bcd87487115632.zip
kunit: Provide a static key to check if KUnit is actively running tests
KUnit does a few expensive things when enabled. This hasn't been a problem because KUnit was only enabled on test kernels, but with a few people enabling (but not _using_) KUnit on production systems, we need a runtime way of handling this. Provide a 'kunit_running' static key (defaulting to false), which allows us to hide any KUnit code behind a static branch. This should reduce the performance impact (on other code) of having KUnit enabled to a single NOP when no tests are running. Note that, while it looks unintuitive, tests always run entirely within __kunit_test_suites_init(), so it's safe to decrement the static key at the end of this function, rather than in __kunit_test_suites_exit(), which is only there to clean up results in debugfs. Signed-off-by: David Gow <davidgow@google.com> Reviewed-by: Daniel Latypov <dlatypov@google.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'lib/kunit/executor.c')
0 files changed, 0 insertions, 0 deletions