On Sat, Mar 26, 2022 at 8:16 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > On Sat, 26 Mar 2022 11:07:03 +0000 > John Keeping <john@xxxxxxxxxxxx> wrote: > > > > > > + print_time(cpu_tasks[i]->runtime, '_'); > > > > > + printf(" (%%%lld)\n", (task->runtime * 100) / total_time); > > > > > > > > Is there a reason for using the CPU-specific runtime for the value and > > > > the total runtime for the percentage? > > > > > > > > I expected the percentage to be the percentage of this CPU's time spend > > > > running the task. > > > > > > We modify it so that each CPU has the same run time, unless there's missed > > > events at the start (later patches), and then we change total_time to be > > > the total time of the events on the CPU and not the entire trace. > > > > I think we're talking about different things here, I probably wasn't > > entirely clear about this. It's the numerator of this division that I'm > > concerned about and I wonder if this should be: > > > > (cpu_tasks[i]->runtime * 100) / total_time > > Ah, I did misunderstand you. Yes, that's a typo. Thanks for pointing > that out. I'll go fix it. > > > > > + if (idle_task) { > > > > > + printf("idle:\t"); > > > > > + print_time(idle_task->runtime, '_'); > > > > > + printf(" (%%%lld)\n", (idle_task->runtime * 100) / total_time); IIUC the idle_task->runtime works out the same as the per-cpu runtime. But for consistency I think we should use idle_cpu_task->runtime here as well Thanks, Kalesh > > -- Steve > >