Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156257
b: refs/heads/master
c: e53c099
h: refs/heads/master
i:
  156255: 38a3f6c
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Aug 2, 2009
1 parent acbf295 commit 8dd20c2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 470a1396c25c27b4aff08b14d5c9cd9b3da15e09
refs/heads/master: e53c0994709166b111fbe9162d1a16ece7dfc45b
14 changes: 13 additions & 1 deletion trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,18 @@ static int perf_release(struct inode *inode, struct file *file)
return 0;
}

static u64 perf_counter_read_tree(struct perf_counter *counter)
{
struct perf_counter *child;
u64 total = 0;

total += perf_counter_read(counter);
list_for_each_entry(child, &counter->child_list, child_list)
total += perf_counter_read(child);

return total;
}

/*
* Read the performance counter - simple non blocking version for now
*/
Expand All @@ -1707,7 +1719,7 @@ perf_read_hw(struct perf_counter *counter, char __user *buf, size_t count)

WARN_ON_ONCE(counter->ctx->parent_ctx);
mutex_lock(&counter->child_mutex);
values[0] = perf_counter_read(counter);
values[0] = perf_counter_read_tree(counter);
n = 1;
if (counter->attr.read_format & PERF_FORMAT_TOTAL_TIME_ENABLED)
values[n++] = counter->total_time_enabled +
Expand Down

0 comments on commit 8dd20c2

Please sign in to comment.