Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[PATCH 8/8][RFC] perf: be paranoid about child times?

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


a.p.zijlstra at chello

Nov 23, 2009, 2:37 AM

Post #1 of 2 (46 views)
Permalink
[PATCH 8/8][RFC] perf: be paranoid about child times?

Normally we flatten the inherited hierarchy by attaching all childs to
the top parent, therefore a child's child_total_time_* should never
get incremented, add it anyway?

Signed-off-by: Peter Zijlstra <a.p.zijlstra [at] chello>
---
kernel/perf_event.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6/kernel/perf_event.c
===================================================================
--- linux-2.6.orig/kernel/perf_event.c
+++ linux-2.6/kernel/perf_event.c
@@ -1780,8 +1780,10 @@ u64 perf_event_read_value(struct perf_ev

list_for_each_entry(child, &event->child_list, child_list) {
total += perf_event_read(child);
- *enabled += child->total_time_enabled;
- *running += child->total_time_running;
+ *enabled += child->total_time_enabled +
+ atomic64_read(&child->child_total_time_enabled);
+ *running += child->total_time_running +
+ atomic64_read(&child->child_total_time_running);
}
mutex_unlock(&event->child_mutex);


--

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


mingo at elte

Nov 23, 2009, 2:51 AM

Post #2 of 2 (46 views)
Permalink
Re: [PATCH 8/8][RFC] perf: be paranoid about child times? [In reply to]

* Peter Zijlstra <a.p.zijlstra [at] chello> wrote:

> Normally we flatten the inherited hierarchy by attaching all childs to
> the top parent, therefore a child's child_total_time_* should never
> get incremented, add it anyway?
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra [at] chello>
> ---
> kernel/perf_event.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> Index: linux-2.6/kernel/perf_event.c
> ===================================================================
> --- linux-2.6.orig/kernel/perf_event.c
> +++ linux-2.6/kernel/perf_event.c
> @@ -1780,8 +1780,10 @@ u64 perf_event_read_value(struct perf_ev
>
> list_for_each_entry(child, &event->child_list, child_list) {
> total += perf_event_read(child);
> - *enabled += child->total_time_enabled;
> - *running += child->total_time_running;
> + *enabled += child->total_time_enabled +
> + atomic64_read(&child->child_total_time_enabled);
> + *running += child->total_time_running +
> + atomic64_read(&child->child_total_time_running);

Stick in a WARN_ON_ONCE() instead?

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

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.