Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3664783rwb; Sun, 20 Nov 2022 19:25:36 -0800 (PST) X-Google-Smtp-Source: AA0mqf6vLHr2/9GeVXTZZmjiQI1z6uXFqQhzdHHp1fPi5TDZKnNkGH6WxvMfL//3g95uaf90VfpY X-Received: by 2002:a05:6a00:2a8:b0:56c:db44:7b1f with SMTP id q8-20020a056a0002a800b0056cdb447b1fmr18642461pfs.54.1669001136081; Sun, 20 Nov 2022 19:25:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669001136; cv=none; d=google.com; s=arc-20160816; b=sukIPtk6cbQusmTmj7WvEa2h2M843nrdmHRC1YmQFNQLL2rjwTKkcJvJFO7Ws0tfFZ zopTlTfm+nFuLneUX4nEnsWUXq4RD0AHtnTqABp57WVlgC2L7dK3nbswBBLkrvaRHiRp 861SOEEO+j8r11ek0Pijt9nTKdEAe60HfSbWQW+z+yFADQx0CHR6rFgHbdo26v2s+WHx ANUZ3GnXEx7dbdsSTM033ljiOJJR5J2FCGP0o8vTOq65MUmds4XcfSuwryfET/NIL7uo yTMca0zp640FtcIOZmTHykJHe4lX77vLAZQyIcMyiP3XltlR2Y/f+seuKwIlTLLWR1ft LaxA== 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 :message-id:date:subject:cc:to:from; bh=INXBuve3u8OAzKVB4oWamGKbQD21zfO0eyNJZ8piExU=; b=DY5utzJVGfir/DEKQQcKuV3h+3ydRdve/MtldjnjKWRI0mlIVbKyoQzcTTQNrerW6L 0jO+KFJMab84VVO7QiITFnavtxTzR7EsgyguDG8eEZd82QUGQEm8BFCMyOyAAYYNrSxJ /voiILTU3jkY/GXHmPT86w4XeItW99k0CQweQBcOXhY6FZ2sfm1hjnYkESodEiQvvGoi EcacNKjufCNRlUqn7q4KFBLgdOI6on8+uQ6gPpTXgrSWVcpfTwqkFXrw042xJ4yPYEBp fNcoBFq5aZL4vP7nsk/ja+x9y3Tb2zhHqMN/Q4mQVVagMogboi8yuu1S+T9kI/zG1cpS HSDw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pv11-20020a17090b3c8b00b0021871478f6esi10111594pjb.85.2022.11.20.19.25.23; Sun, 20 Nov 2022 19:25:36 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229766AbiKUChl (ORCPT + 90 others); Sun, 20 Nov 2022 21:37:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbiKUChj (ORCPT ); Sun, 20 Nov 2022 21:37:39 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23006766B for ; Sun, 20 Nov 2022 18:37:37 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NFs3l5C8Dz15Mld; Mon, 21 Nov 2022 10:37:07 +0800 (CST) Received: from huawei.com (10.67.174.191) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 10:37:35 +0800 From: Li Hua To: , , CC: , , , , , Subject: [PATCH] test_kprobes: Fix implicit declaration error of test_kprobes Date: Mon, 21 Nov 2022 11:06:20 +0800 Message-ID: <20221121030620.63181-1-hucool.lihua@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.174.191] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 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. 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