From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363AbcGMHwc (ORCPT ); Wed, 13 Jul 2016 03:52:32 -0400 Received: from merlin.infradead.org ([205.233.59.134]:43255 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbcGMHw0 (ORCPT ); Wed, 13 Jul 2016 03:52:26 -0400 Date: Wed, 13 Jul 2016 09:52:09 +0200 From: Peter Zijlstra To: Daniel Borkmann Cc: davem@davemloft.net, alexei.starovoitov@gmail.com, tgraf@suug.ch, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/3] perf, events: add non-linear data support for raw records Message-ID: <20160713075209.GQ30154@twins.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2016 at 12:36:17AM +0200, Daniel Borkmann wrote: > This patch adds support for non-linear data on raw records. It means > that for such data, the newly introduced __output_custom() helper will > be used instead of __output_copy(). __output_custom() will invoke > whatever custom callback is passed in via struct perf_raw_record_frag > to extract the data into the ring buffer slot. > > To keep changes in perf_prepare_sample() and in perf_output_sample() > minimal, size/size_head split was added to perf_raw_record that call > sites fill out, so that two extra tests in fast-path can be avoided. > > The few users of raw records are adapted to initialize their size_head > and frag data; no change in behavior for them. Later patch will extend > BPF side with a first user and callback for this facility, future users > could be things like XDP BPF programs (that work on different context > though and would thus have a different callback), etc. Why? What problem are we solving?