lkml.org 
[lkml]   [2019]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 04/10] perf: Add per perf_cpu_context min_heap storage
On Thu, Nov 14, 2019 at 1:51 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Nov 13, 2019 at 04:30:36PM -0800, Ian Rogers wrote:
> > + if (cpuctx) {
> > + event_heap = (struct min_max_heap){
> > + .data = cpuctx->itr_storage,
> > + .size = 0,
>
> C guarantees that unnamed fields get to be 0

Agreed, this is kept here to aid readability. Do you feel strongly
about not having this? It appears to be kept elsewhere for clarity
too:
$ grep -r "\..*= 0," arch/ kernel/ tools/|wc -l
2528

> > + .cap = cpuctx->itr_storage_cap,
> > + };
> > + } else {
> > + event_heap = (struct min_max_heap){
> > + .data = itrs,
> > + .size = 0,
>
> idem.
>
> > + .cap = ARRAY_SIZE(itrs),
> > + };
> > + /* Events not within a CPU context may be on any CPU. */
> > + __heap_add(&event_heap, perf_event_groups_first(groups, -1));
> > +
>
> suprious whitespace

Done.



> > + }
> > + evt = event_heap.data;
> > +
> > __heap_add(&event_heap, perf_event_groups_first(groups, cpu));

\
 
 \ /
  Last update: 2019-11-16 02:20    [W:0.456 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site