1919
2020struct timerlat_hist_params {
2121 char * cpus ;
22- char * monitored_cpus ;
22+ cpu_set_t monitored_cpus ;
2323 char * trace_output ;
2424 char * cgroup_name ;
2525 unsigned long long runtime ;
@@ -227,7 +227,7 @@ static void timerlat_hist_header(struct osnoise_tool *tool)
227227 trace_seq_printf (s , "Index" );
228228
229229 for (cpu = 0 ; cpu < data -> nr_cpus ; cpu ++ ) {
230- if (params -> cpus && !params -> monitored_cpus [ cpu ] )
230+ if (params -> cpus && !CPU_ISSET ( cpu , & params -> monitored_cpus ) )
231231 continue ;
232232
233233 if (!data -> hist [cpu ].irq_count && !data -> hist [cpu ].thread_count )
@@ -263,7 +263,7 @@ timerlat_print_summary(struct timerlat_hist_params *params,
263263 trace_seq_printf (trace -> seq , "count:" );
264264
265265 for (cpu = 0 ; cpu < data -> nr_cpus ; cpu ++ ) {
266- if (params -> cpus && !params -> monitored_cpus [ cpu ] )
266+ if (params -> cpus && !CPU_ISSET ( cpu , & params -> monitored_cpus ) )
267267 continue ;
268268
269269 if (!data -> hist [cpu ].irq_count && !data -> hist [cpu ].thread_count )
@@ -283,7 +283,7 @@ timerlat_print_summary(struct timerlat_hist_params *params,
283283 trace_seq_printf (trace -> seq , "min: " );
284284
285285 for (cpu = 0 ; cpu < data -> nr_cpus ; cpu ++ ) {
286- if (params -> cpus && !params -> monitored_cpus [ cpu ] )
286+ if (params -> cpus && !CPU_ISSET ( cpu , & params -> monitored_cpus ) )
287287 continue ;
288288
289289 if (!data -> hist [cpu ].irq_count && !data -> hist [cpu ].thread_count )
@@ -303,7 +303,7 @@ timerlat_print_summary(struct timerlat_hist_params *params,
303303 trace_seq_printf (trace -> seq , "avg: " );
304304
305305 for (cpu = 0 ; cpu < data -> nr_cpus ; cpu ++ ) {
306- if (params -> cpus && !params -> monitored_cpus [ cpu ] )
306+ if (params -> cpus && !CPU_ISSET ( cpu , & params -> monitored_cpus ) )
307307 continue ;
308308
309309 if (!data -> hist [cpu ].irq_count && !data -> hist [cpu ].thread_count )
@@ -331,7 +331,7 @@ timerlat_print_summary(struct timerlat_hist_params *params,
331331 trace_seq_printf (trace -> seq , "max: " );
332332
333333 for (cpu = 0 ; cpu < data -> nr_cpus ; cpu ++ ) {
334- if (params -> cpus && !params -> monitored_cpus [ cpu ] )
334+ if (params -> cpus && !CPU_ISSET ( cpu , & params -> monitored_cpus ) )
335335 continue ;
336336
337337 if (!data -> hist [cpu ].irq_count && !data -> hist [cpu ].thread_count )
@@ -371,7 +371,7 @@ timerlat_print_stats(struct timerlat_hist_params *params, struct osnoise_tool *t
371371 bucket * data -> bucket_size );
372372
373373 for (cpu = 0 ; cpu < data -> nr_cpus ; cpu ++ ) {
374- if (params -> cpus && !params -> monitored_cpus [ cpu ] )
374+ if (params -> cpus && !CPU_ISSET ( cpu , & params -> monitored_cpus ) )
375375 continue ;
376376
377377 if (!data -> hist [cpu ].irq_count && !data -> hist [cpu ].thread_count )
@@ -405,7 +405,7 @@ timerlat_print_stats(struct timerlat_hist_params *params, struct osnoise_tool *t
405405 trace_seq_printf (trace -> seq , "over: " );
406406
407407 for (cpu = 0 ; cpu < data -> nr_cpus ; cpu ++ ) {
408- if (params -> cpus && !params -> monitored_cpus [ cpu ] )
408+ if (params -> cpus && !CPU_ISSET ( cpu , & params -> monitored_cpus ) )
409409 continue ;
410410
411411 if (!data -> hist [cpu ].irq_count && !data -> hist [cpu ].thread_count )
@@ -565,7 +565,7 @@ static struct timerlat_hist_params
565565
566566 break ;
567567 case 'c' :
568- retval = parse_cpu_list (optarg , & params -> monitored_cpus );
568+ retval = parse_cpu_set (optarg , & params -> monitored_cpus );
569569 if (retval )
570570 timerlat_hist_usage ("\nInvalid -c cpu list\n" );
571571 params -> cpus = optarg ;
0 commit comments