[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 4 Apr 2022 16:13:47 -0500
From: Daniel Latypov <dlatypov@...gle.com>
To: David Gow <davidgow@...gle.com>
Cc: Brendan Higgins <brendanhiggins@...gle.com>,
Kees Cook <keescook@...omium.org>,
Shuah Khan <skhan@...uxfoundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
kunit-dev@...glegroups.com, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] kunit: expose ftrace-based API for stubbing out
functions during tests
On Thu, Mar 17, 2022 at 9:13 PM David Gow <davidgow@...gle.com> wrote:
> +
> +/** KUNIT_STUBBABLE - marks a function as stubbable when stubbing support is
> + * enabled.
> + *
> + * Stubbing uses ftrace internally, so we can only stub out functions when they
> + * are not inlined. This macro eavlautes to noinline when stubbing support is
Just noting a couple typos lest they be forgotten:
*evaluates
> + * enabled to thus make it safe.
> + *
<snip>
> + *
> + * void replacement_func(int n)
> + * {
> + * pr_info("replacement_func() called with %d", n);
> + * return 42;
> + * }
> + *
> + * void example_test(struct kunit *test)
> + * {
> + * kunit_active_ftrace_stub(test, real_func, replacement_func);
*activate
Powered by blists - more mailing lists