Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751135AbdGMHNH (ORCPT ); Thu, 13 Jul 2017 03:13:07 -0400 Received: from merlin.infradead.org ([205.233.59.134]:40214 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750831AbdGMHNF (ORCPT ); Thu, 13 Jul 2017 03:13:05 -0400 Date: Thu, 13 Jul 2017 09:12:53 +0200 From: Peter Zijlstra To: Josh Poimboeuf Cc: Andres Freund , x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Jiri Slaby , Ingo Molnar , "H. Peter Anvin" , Mike Galbraith Subject: Re: [PATCH v3 00/10] x86: ORC unwinder (previously undwarf) Message-ID: <20170713071253.a3slz3j5tcgy3rkk@hirez.programming.kicks-ass.net> References: <20170712214920.5droainfqjmq7sgu@alap3.anarazel.de> <20170712223225.zkq7tdb7pzgb3wy7@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170712223225.zkq7tdb7pzgb3wy7@treble> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1178 Lines: 26 On Wed, Jul 12, 2017 at 05:32:25PM -0500, Josh Poimboeuf wrote: > If you want perf to be able to use ORC instead of DWARF for user space > binaries, that's not currently possible, though I don't see any > technical blockers for doing so. Perf would need to be taught to read > ORC data. So the problem with userspace stuff is that the unwind data isn't readily available from NMI context. So the kernel unwinder will trigger a fault and abort. The very best we can hope for is using the EH [*] stuff that all binaries actually have _and_ map. The only problem is that most programs don't actually use the EH stuff much so while its mapped, its not actually paged in, so we're still stuck. [*] C++ ABI requires EH bits for stack unwinding for exception handling and the like, and because C++ can unwind through C code, C ABI also mandates EH bits be present. ORC doesn't much change this. What is currently an option is for perf to simply copy out the top n-Kb of the stack for each sample (talk about expensive) and then have userspace unwind it. And for userspace unwinding in userspace, libunwind and the like are fine, I see absolutely no reason to use ORC bits here.