Re: [PATCH V6 11/20] rtla/osnoise: Add the hist mode

From
Steven Rostedt <rostedt@goodmis.org>
Date
2021-10-27 18:29:25
Also in
lkml
Reply to
Tao Zhou, 2021-10-27
On Thu, 28 Oct 2021 02:11:24 +0800
Tao Zhou [off-list ref] wrote:
quoted
+	/* 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
Thread (34 messages) 34 messages, 3 authors, last reply 2021-10-29
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help