lkml.org 
[lkml]   [2022]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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@google.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

\
 
 \ /
  Last update: 2022-04-05 00:27    [W:0.155 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site