Re: [PATCH v2] perfcounters: record time running and time enabledfor each counter

From: Ingo Molnar
Date: Sat Mar 21 2009 - 11:55:21 EST



* Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> > @@ -243,6 +259,8 @@ struct perf_counter {
> >
> > struct perf_counter *parent;
> > struct list_head child_list;
> > + atomic64_t child_time_enabled;
> > + atomic64_t child_time_running;
>
> These read like booleans, but why are they atomic64_t's?

for inherited counters these values get collected back into a
'parent counter' in a lockless way - hence to not lose statistics on
SMP they need to be atomic64_t.

> > @@ -290,6 +308,8 @@ struct perf_counter_context {
> > int nr_active;
> > int is_active;
> > struct task_struct *task;
> > + u64 time_now;
> > + u64 time_lost;
> > #endif
> > };
>
> I don't have a copy of this header file handy, but from the
> snippet I see here, it doesn't look as though it is as clear and
> as understadable as we can possibly make it?

i'll post the latest perfcounters tree - it's time for that anyway.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/