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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5F607C3DA4A for ; Fri, 2 Aug 2024 11:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=C0f6zaBUcyynt6mE21QnYBPj0vbkgaV+m6pHO44i/nk=; b=pKlfwlC30/rGkforB/NEKNKNtk lA9yD8x0pKdWTRy/NQvhF9KQTo2cVt112jswalDef4P9HP3NCZS9Id+PHkDHLLo9f8ADIU7zFk5hI emCTtMYVePQdD/DrUqHQkrfJgpo8Zlch07hJg959TyR0ChFJcmkj5Twe4AJZYtvvxi5CdRuRNA9vV +eHkaUskoAYfyO4YR0mdYNwmF6dgew7Uhn21RBI1NkCHjqL3Rnvly0kxSot8/7bQHUPwutY6yL1SC P+pXsDQ/vGIZjT2Pf4erqk14F/vYD3xbwIz1vgzxTQgSWUBsxipkSs93rl0wOkjMuIoodGKwTAMav Y4o8HGEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZqmh-00000008j7k-3kTB; Fri, 02 Aug 2024 11:49:23 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZqmC-00000008j3a-1tc1 for linux-arm-kernel@lists.infradead.org; Fri, 02 Aug 2024 11:48:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=C0f6zaBUcyynt6mE21QnYBPj0vbkgaV+m6pHO44i/nk=; b=aItMhQlVxwVTBIVvetxVf2Nb6t LEFmNrkyUb605nYSbbJLQXSU5oLvAfvUPXlSTiS/Q3nU52ruCvrVvb9ZZ8ULeIl80cjp1zG3JIsV+ tTa5USLcUB4wi1feuwCHaUl34riumZoi1ZBVMV4PzpZv9ouh2C1P87iBXVS7gS2z74NfqsGP0Tqo4 M105kYItz+KzrcJaKYKRS/bcP9ueIJO2bCEEkCCUwzGSSEb2wlLuDvLYu3nRx0bnLWMF7r3TGy5Cg sFNpwMuB3qbAfktXt04AchzVftu7vBoybY7RVOJ+/LlcASt8Tbrnf8T45yY/6SuBCCT3R2NcM0Nld VD8wc5zg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:41882) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1sZqla-0006dk-2M; Fri, 02 Aug 2024 12:48:14 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1sZqlc-00080u-9P; Fri, 02 Aug 2024 12:48:16 +0100 Date: Fri, 2 Aug 2024 12:48:16 +0100 From: "Russell King (Oracle)" To: Jinjie Ruan Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, namhyung@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, kan.liang@linux.intel.com, will@kernel.org, arnd@arndb.de, afd@ti.com, linus.walleij@linaro.org, akpm@linux-foundation.org, masahiroy@kernel.org, eric.devolder@oracle.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Subject: Re: [PATCH v2] ARM: stacktrace: Add USER_STACKTRACE support Message-ID: References: <20240730021532.1752582-1-ruanjinjie@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240730021532.1752582-1-ruanjinjie@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240802_044852_505679_CD6910F4 X-CRM114-Status: GOOD ( 13.51 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 30, 2024 at 10:15:32AM +0800, Jinjie Ruan wrote: > Currently, userstacktrace is unsupported for ARM. So use the > perf_callchain_user() code as blueprint to implement the > arch_stack_walk_user() which add userstacktrace support on ARM. > Meanwhile, we can use arch_stack_walk_user() to simplify the implementation > of perf_callchain_user(). > > A ftrace test case is shown as below: > # cd /sys/kernel/debug/tracing > # echo 1 > options/userstacktrace > # echo 1 > options/sym-userobj > # echo 1 > events/sched/sched_process_fork/enable > # cat trace > > ...... > sh-100 [000] ..... 51.779261: sched_process_fork: comm=sh pid=100 child_comm=sh child_pid=108 > sh-100 [000] ..... 51.779285: > => /lib/libc.so.6[+0xb3c8c] > => /bin/busybox[+0xffb901f1] > > Also a simple perf test is ok as below: > # perf record -e cpu-clock --call-graph fp top > # perf report --call-graph > > ..... > [[31m 65.00%[[m 0.00% top [kernel.kallsyms] [k] __ret_fast_syscall > > | > ---__ret_fast_syscall > | > |--[[31m30.00%[[m--__se_sys_getdents64 > | iterate_dir > | | > | |--[[31m25.00%[[m--proc_pid_readdir > > Signed-off-by: Jinjie Ruan Do you have a use case for this feature? Given that userspace is free to do whatever it likes with stack frames, I think this is going to be hit and miss whether it works. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!