Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752105AbdG1ONd (ORCPT ); Fri, 28 Jul 2017 10:13:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2025 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751786AbdG1ONc (ORCPT ); Fri, 28 Jul 2017 10:13:32 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9ED2B883D8 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jolsa@redhat.com Date: Fri, 28 Jul 2017 16:13:25 +0200 From: Jiri Olsa To: Peter Zijlstra 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: <20170728141325.GA20961@krava> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170725115512.k3wk62fdnxdd6enu@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.8.3 (2017-05-23) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 28 Jul 2017 14:13:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 49 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 jirka