From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AE52C433EF for ; Fri, 22 Oct 2021 16:17:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C5F7604D2 for ; Fri, 22 Oct 2021 16:17:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4C5F7604D2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WkOAlZb8+Yt8/WynhzaoSqZlSIyYlFfIYFyLtVKvBlI=; b=zPdcOkbcLN/uop nYKiP4LzilTF8/8ddjPytp1C1gG8ffqnBu5/YRnsrPAJEculSMA08XgMys5HMKVp5oxGdtlRtcMRJ ya5A1059FKXsPX0N2sQ9Gt4uYI0twVEt3E/o6q2QTFZBRPBYkaGpVMJz2vWZS+sw0zZbSTcdJZe0I 2bIJC8mv2rSXjYiWaK9IfntyYKdNAunfuRlHgAG/qgZiD2Ue4kUeZ9MkNst6N3bEh+vZWS4gpYCVB enT2nasQBTzC88sF4u3L1g1FEYWuMlSOPiz51GlAM0r1mgDaynTu+pGObySzyEsoHv16J5FXDM8GY W9v+5gFgkwGoByF1NA1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdxCp-00BVJN-P1; Fri, 22 Oct 2021 16:15:43 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdxCm-00BVId-43 for linux-arm-kernel@lists.infradead.org; Fri, 22 Oct 2021 16:15:41 +0000 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C6F406112F; Fri, 22 Oct 2021 16:15:38 +0000 (UTC) Date: Fri, 22 Oct 2021 12:15:37 -0400 From: Steven Rostedt To: Masami Hiramatsu Cc: "Naveen N . Rao" , Ananth N Mavinakayanahalli , Ingo Molnar , linux-kernel@vger.kernel.org, Sven Schnelle , Catalin Marinas , Will Deacon , Russell King , Nathan Chancellor , Nick Desaulniers , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 2/9] kprobes: Add a test case for stacktrace from kretprobe handler Message-ID: <20211022121537.32821979@gandalf.local.home> In-Reply-To: <163477767243.264901.10894979830215919916.stgit@devnote2> References: <163477765570.264901.3851692300287671122.stgit@devnote2> <163477767243.264901.10894979830215919916.stgit@devnote2> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211022_091540_226938_D7F49275 X-CRM114-Status: GOOD ( 21.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 21 Oct 2021 09:54:32 +0900 Masami Hiramatsu wrote: > Add a test case for stacktrace from kretprobe handler and > nested kretprobe handlers. > > This test checks both of stack trace inside kretprobe handler > and stack trace from pt_regs. Those stack trace must include > actual function return address instead of kretprobe trampoline. > The nested kretprobe stacktrace test checks whether the unwinder > can correctly unwind the call frame on the stack which has been > modified by the kretprobe. > > Since the stacktrace on kretprobe is correctly fixed only on x86, > this introduces a meta kconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE > which tells user that the stacktrace on kretprobe is correct or not. > > The test results will be shown like below; > > TAP version 14 > 1..1 > # Subtest: kprobes_test > 1..6 > ok 1 - test_kprobe > ok 2 - test_kprobes > ok 3 - test_kretprobe > ok 4 - test_kretprobes > ok 5 - test_stacktrace_on_kretprobe > ok 6 - test_stacktrace_on_nested_kretprobe > # kprobes_test: pass:6 fail:0 skip:0 total:6 > # Totals: pass:6 fail:0 skip:0 total:6 > ok 1 - kprobes_test So my allmodconfig test failed on this: ERROR: modpost: "stack_trace_save_regs" [kernel/test_kprobes.ko] undefined! > + /* > + * Test stacktrace from pt_regs at the return address. Thus the stack > + * trace must start from the target return address. > + */ > + ret = stack_trace_save_regs(regs, stack_buf, STACK_BUF_SIZE, 0); > + KUNIT_EXPECT_NE(current_test, ret, 0); > + KUNIT_EXPECT_EQ(current_test, stack_buf[0], target_return_address[1]); > + > + return 0; > +} It appears that that "stack_trace_save_regs" is not exported. And this code can be compiled as a module. I'm going to continue testing my code, as I have over 40 patches that need to go into next. I'll just rebase removing this commit only (hopefully nothing else breaks), and if everything then passes, I'll push to next. -- Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel