> > +static int
> > +measure_vals(struct resctrl_val_param *param, unsigned long
> > +*bw_resc_start) {
> > +   unsigned long bw_imc, bw_resc, bw_resc_end;
> > +   int ret;
> > +
> > +   /*
> > +    * Measure memory bandwidth from resctrl and from
> > +    * another source which is perf imc value or could
> > +    * be something else if perf imc event is not available.
> > +    * Compare the two values to validate resctrl value.
> > +    * It takes 1sec to measure the data.
> > +    */
> > +   bw_imc = get_mem_bw_imc(param->cpu_no, param->bw_report);
> > +   if (bw_imc < 0)
> 
> I think this condition should be "<=". If the value is zero, it should exit.

Yes, it should be changed. Will fix it in next version.

> 
> > +           return bw_imc;
> > +
> > +   bw_resc_end = get_mem_bw_resctrl();
> > +   if (bw_resc_end < 0)
> 
> I am not very sure about this. Please check if it should be "<=" 0.

This one should also be changed. Will fix it too.

> 
> > +           return bw_resc_end;
> > +
> > +   bw_resc = (bw_resc_end - *bw_resc_start) / MB;
> > +   ret = print_results_bw(param->filename, bm_pid, bw_imc, bw_resc);
> > +   if (ret)
> > +           return ret;
> > +
> > +   *bw_resc_start = bw_resc_end;
> > +
> > +   return 0;
> > +}

Thanks and Regards,
Arshiya

Reply via email to