lkml.org 
[lkml]   [2021]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V6 11/20] rtla/osnoise: Add the hist mode
On Thu, 28 Oct 2021 02:11:24 +0800
Tao Zhou <tao.zhou@linux.dev> wrote:

> > + /* one histogram for IRQ and one for thread, per cpu */
> > + for (cpu = 0; cpu < nr_cpus; cpu++) {
> > + data->hist[cpu].samples = calloc(1, sizeof(*data->hist) * (entries + 1));
>
> @samples is a pointer to int and used for int array. The "sizeof(*data->hist)"
> should be "sizeof(int)" or am I totally wrong.

Or standard approach is:

data->hist[cpu].samples = calloc(1, sizeof(*data->hist->samples) * (entries + 1));

-- Steve

\
 
 \ /
  Last update: 2021-10-27 20:30    [W:0.115 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site