Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5331322rwb; Mon, 21 Nov 2022 21:07:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Rgz9qGjnSHWstBUmhMp36CVwmE6UV3qEG+xdF88XLGkDfbcXGho/Zzcyr8be56vnh1apb X-Received: by 2002:a17:902:dad1:b0:188:5698:6b69 with SMTP id q17-20020a170902dad100b0018856986b69mr2182961plx.142.1669093648905; Mon, 21 Nov 2022 21:07:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669093648; cv=none; d=google.com; s=arc-20160816; b=UztbkRGMbxijEQyLgqSNAMwHrflNdSLm+ea+2bWY/SelN7aUCVFcrl3D3ObKCfYSQs wo5Kh9UYM6pcRLcXr9fGqsHmxy71jYEM4767x3IkFVXsZOgQDYceoWIXQBTdMvU5+Yi2 byyT4dEP27rsSEd4tTAcdpiidBXK5gcnBoQqruS6WUCmwh0PDVRJruoxIL62llhKxDKT ffrd/TBa0ZkCeLB5opqKH+tGDMhCHTRevA7fwuhOGjbDlqEzDQYA05YxqfUaWdyeBEhe 0xSBhvTdw1kGC5obo1sa3fQ0RYLwGyBamniuZv9KLQ3Hrq70gOhpaXu/z5fspsIRG/1L JlVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=HcX65UAP3z9JAZTyVKmtCuCNqFdEgSr4WpPOOCNkKgY=; b=ZGKne7qTA84M0rmTdo+K7rqdbKXWRR41/UPxXJuBLg3WuKAwg3IN+nr0GrA+h7YA4e 7gBGLg/NWVSt2916wd8N7pFDr8N+w6jifhmPPZKeyb3sYUMGyZc8DERidW6AUXL3kAhe FDm4eA+WVTLGQJpBFjI0dG1Zd/7Jy/96X1mx7a0QYszas+SeWvaEPVvzH1CKv2t8otnM +KMwMUHnkmS/bTG8W50L7vVscW2DqIYBulsC82eDABlxjykdKllkHHu8YLxHul30Du3X R4Sx5BdbvEdmiqaXJhMUxqJCKJls18ltbn3z3Oxze4PnGbZqJP5lqI42Pl3hL28Bcpvf dsyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MhKfDAy1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020a056a00084f00b005614fb190e4si14390329pfk.193.2022.11.21.21.07.12; Mon, 21 Nov 2022 21:07:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MhKfDAy1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231781AbiKVEv2 (ORCPT + 92 others); Mon, 21 Nov 2022 23:51:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229817AbiKVEv0 (ORCPT ); Mon, 21 Nov 2022 23:51:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9E9527B13 for ; Mon, 21 Nov 2022 20:51:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 83968B81964 for ; Tue, 22 Nov 2022 04:51:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAF99C433C1; Tue, 22 Nov 2022 04:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669092683; bh=izAiYpr0FJNO6aLxkL3dB9GN7oXjpy9Mg8r0NpTkbUc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MhKfDAy1039lotfhH6RGPl+KOIp6mP3E/izoIZwhea2Hl8b5A+vCrpmfP55jttBkf AmU5l8K97OChqZuWecQrp6qLdpDH8IH/xwtdwhddaZupiGr+Ced2sPymRyXIDTPb2e LBKlrLSAmeayWmJF53AU6XMTwZ518nADPGNFUNKCuNynz8gTntv71pNQiKBNec/s5d vDYELos/22rzSwtno4rt4Q2iPBOl+nSZlHNsVibm5aCVKW0np4wMabNDiMMKBGvRvt MbEP73GH/GLWQrX6rJ8pr1lC5BoF0DT72+zeMwyuieYJ2HnatAkhj2CvxHGpCHJnH3 1nWyweXZ0y98A== Date: Tue, 22 Nov 2022 13:51:19 +0900 From: Masami Hiramatsu (Google) To: Li Hua Cc: , , , , , , Subject: Re: [PATCH] test_kprobes: Fix implicit declaration error of test_kprobes Message-Id: <20221122135119.2755825442e46e81be72e592@kernel.org> In-Reply-To: <20221121030620.63181-1-hucool.lihua@huawei.com> References: <20221121030620.63181-1-hucool.lihua@huawei.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Nov 2022 11:06:20 +0800 Li Hua 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) Thanks! > > Fixes: 1f6d3a8f5e39 ("kprobes: Add a test case for stacktrace from kretprobe handler") > Signed-off-by: Li Hua > --- > 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)