Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752099AbdG1OVm (ORCPT ); Fri, 28 Jul 2017 10:21:42 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:58583 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbdG1OVl (ORCPT ); Fri, 28 Jul 2017 10:21:41 -0400 Date: Fri, 28 Jul 2017 16:21:30 +0200 From: Peter Zijlstra To: Jiri Olsa Cc: Ingo Molnar , Josh Poimboeuf , Andres Freund , x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, Linus Torvalds , Andy Lutomirski , Jiri Slaby , "H. Peter Anvin" , Mike Galbraith , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin Subject: Re: [RFC] perf: Delayed userspace unwind (Was: [PATCH v3 00/10] x86: ORC unwinder) Message-ID: <20170728142130.ceifp63lcmp2wce2@hirez.programming.kicks-ass.net> References: <20170712214920.5droainfqjmq7sgu@alap3.anarazel.de> <20170712223225.zkq7tdb7pzgb3wy7@treble> <20170713071253.a3slz3j5tcgy3rkk@hirez.programming.kicks-ass.net> <20170713085015.yjjv5ig2znplx5jl@hirez.programming.kicks-ass.net> <20170713085114.h4vjgg7jjbl6dohb@hirez.programming.kicks-ass.net> <20170713091911.aj7e7dvrbqcyxh7l@gmail.com> <20170725115512.k3wk62fdnxdd6enu@hirez.programming.kicks-ass.net> <20170728141325.GA20961@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170728141325.GA20961@krava> 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: 1625 Lines: 52 On Fri, Jul 28, 2017 at 04:13:25PM +0200, Jiri Olsa wrote: > On Tue, Jul 25, 2017 at 01:55:12PM +0200, Peter Zijlstra wrote: > > SNIP > > > > > diff --git a/kernel/events/callchain.c b/kernel/events/callchain.c > > index 1b2be63c8528..c98a12f3592c 100644 > > --- a/kernel/events/callchain.c > > +++ b/kernel/events/callchain.c > > @@ -12,6 +12,7 @@ > > #include > > #include > > #include > > +#include > > > > #include "internal.h" > > > > @@ -178,19 +179,94 @@ put_callchain_entry(int rctx) > > put_recursion_context(this_cpu_ptr(callchain_recursion), rctx); > > } > > > > +static struct perf_callchain_entry __empty = { .nr = 0, }; > > + > > +static void perf_callchain_work(struct callback_head *work) > > +{ > > + struct perf_event *event = container_of(work, struct perf_event, pending_callchain); > > + struct perf_output_handle handle; > > + struct perf_sample_data sample; > > + size_t size; > > + int ret; > > + > > + struct { > > + struct perf_event_header header; > > + } callchain_event = { > > + .header = { > > + .type = PERF_RECORD_CALLCHAIN, > > + .misc = 0, > > + .size = sizeof(callchain_event), > > + }, > > + }; > > how about we make this generic for all user space sample_type? > > I think we could certainly use it for PERF_SAMPLE_STACK_USER, > maybe PERF_SAMPLE_REGS_USER would also help.. just a little ;-) > > I'll check on that Right, so I put all the magic in the callchain code itself, which would make that a wee bit harder. But yes, putting all the USER stuff in there makes sense.