Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1442634

Re: [PATCH net-next 1/3] perf, events: add non-linear data support for raw records

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 1/3] perf, events: add non-linear data support for raw records
Date 2016-07-13 18:50 +0200
Message-ID <rUvwe-5D5-37@gated-at.bofh.it> (permalink)
References <rUevn-2IR-7@gated-at.bofh.it> <rUevo-2IR-41@gated-at.bofh.it> <rUsI1-3Kr-11@gated-at.bofh.it> <rUt1o-47M-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jul 13, 2016 at 04:08:55PM +0200, Daniel Borkmann wrote:
> Hi Peter,
> 
> On 07/13/2016 03:42 PM, Peter Zijlstra wrote:
> >
> >Ok so the nonlinear thing was it doing _two_ copies, one the regular
> >__output_copy() on raw->data and second the optional fragment thingy
> >using __output_custom().
> >
> >Would something like this work instead?
> >
> >It does the nonlinear thing and the custom copy function thing but
> >allows more than 2 fragments and allows each fragment to have a custom
> >copy.
> >
> >It doesn't look obviously more expensive; it has the one ->copy branch
> >extra, but then it doesn't recompute the sizes.
> 
> Yes, that would work as well on a quick glance with diff just a bit
> bigger, but more generic this way. Do you want me to adapt this into
> the first patch?

Please.

> One question below:
> 

> >-			u64 zero = 0;

> >-			if (real_size - raw_size)
> >-				__output_copy(handle, &zero, real_size - raw_size);

> 
> We still need the zero padding here from above with the computed
> raw->size, right?

Ah, yes, we need some __output*() in order to advance the handle offset.
We don't _need_ to copy the 0s, but I doubt __output_skip() is much
cheaper for these 1-3 bytes worth of data; we've already touched that
line anyway.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/3] BPF event output helper improvements Daniel Borkmann <daniel@iogearbox.net> - 2016-07-13 00:40 +0200
  [PATCH net-next 3/3] bpf: avoid stack copy and use skb ctx for event output Daniel Borkmann <daniel@iogearbox.net> - 2016-07-13 00:40 +0200
  [PATCH net-next 1/3] perf, events: add non-linear data support for raw records Daniel Borkmann <daniel@iogearbox.net> - 2016-07-13 00:40 +0200
    Re: [PATCH net-next 1/3] perf, events: add non-linear data support  for raw records Peter Zijlstra <peterz@infradead.org> - 2016-07-13 10:00 +0200
      Re: [PATCH net-next 1/3] perf, events: add non-linear data support  for raw records Daniel Borkmann <daniel@iogearbox.net> - 2016-07-13 11:30 +0200
        Re: [PATCH net-next 1/3] perf, events: add non-linear data support  for raw records Peter Zijlstra <peterz@infradead.org> - 2016-07-13 14:20 +0200
          Re: [PATCH net-next 1/3] perf, events: add non-linear data support  for raw records Daniel Borkmann <daniel@iogearbox.net> - 2016-07-13 15:20 +0200
    Re: [PATCH net-next 1/3] perf, events: add non-linear data support  for raw records Peter Zijlstra <peterz@infradead.org> - 2016-07-13 15:50 +0200
      Re: [PATCH net-next 1/3] perf, events: add non-linear data support  for raw records Daniel Borkmann <daniel@iogearbox.net> - 2016-07-13 16:10 +0200
        Re: [PATCH net-next 1/3] perf, events: add non-linear data support  for raw records Peter Zijlstra <peterz@infradead.org> - 2016-07-13 18:50 +0200
          Re: [PATCH net-next 1/3] perf, events: add non-linear data support  for raw records Daniel Borkmann <daniel@iogearbox.net> - 2016-07-13 19:00 +0200
  [PATCH net-next 2/3] bpf, perf: split bpf_perf_event_output Daniel Borkmann <daniel@iogearbox.net> - 2016-07-13 00:40 +0200

csiph-web