mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Li Hua <hucool.lihua@huawei.com>
Cc: <rostedt@goodmis.org>, <akpm@linux-foundation.org>,
	<nathan@kernel.org>, <ananth@in.ibm.com>,
	<linux-kernel@vger.kernel.org>, <weiyongjun1@huawei.com>,
	<yusongping@huawei.com>
Subject: Re: [PATCH] test_kprobes: Fix implicit declaration error of test_kprobes
Date: Tue, 22 Nov 2022 13:51:19 +0900	[thread overview]
Message-ID: <20221122135119.2755825442e46e81be72e592@kernel.org> (raw)
In-Reply-To: <20221121030620.63181-1-hucool.lihua@huawei.com>

On Mon, 21 Nov 2022 11:06:20 +0800
Li Hua <hucool.lihua@huawei.com> wrote:

> If KPROBES_SANITY_TEST and ARCH_CORRECT_STACKTRACE_ON_KRETPROBE is enabled, but
> STACKTRACE is not set. Build failed as below:
> 
> lib/test_kprobes.c: In function ‘stacktrace_return_handler’:
> lib/test_kprobes.c:228:8: error: implicit declaration of function ‘stack_trace_save’; did you mean ‘stacktrace_driver’? [-Werror=implicit-function-declaration]
>   ret = stack_trace_save(stack_buf, STACK_BUF_SIZE, 0);
>         ^~~~~~~~~~~~~~~~
>         stacktrace_driver
> cc1: all warnings being treated as errors
> scripts/Makefile.build:250: recipe for target 'lib/test_kprobes.o' failed
> make[2]: *** [lib/test_kprobes.o] Error 1
> 
> To fix this error, Select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE is enabled.

Good catch!

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thanks!

> 
> Fixes: 1f6d3a8f5e39 ("kprobes: Add a test case for stacktrace from kretprobe handler")
> Signed-off-by: Li Hua <hucool.lihua@huawei.com>
> ---
>  lib/Kconfig.debug | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index c3c0b077ade3..a1005415f0f4 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -2107,6 +2107,7 @@ config KPROBES_SANITY_TEST
>  	depends on DEBUG_KERNEL
>  	depends on KPROBES
>  	depends on KUNIT
> +	select STACKTRACE if ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
>  	default KUNIT_ALL_TESTS
>  	help
>  	  This option provides for testing basic kprobes functionality on
> -- 
> 2.17.1
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      reply	other threads:[~2022-11-22  4:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  3:06 Li Hua
2022-11-22  4:51 ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221122135119.2755825442e46e81be72e592@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=ananth@in.ibm.com \
    --cc=hucool.lihua@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=weiyongjun1@huawei.com \
    --cc=yusongping@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®