Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147140
b: refs/heads/master
c: 04289bb
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Dec 11, 2008
1 parent f3eec38 commit 847517c
Show file tree
Hide file tree
Showing 4 changed files with 237 additions and 83 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: 9f66a3810fe0d4100972db84290f3ae4a4d77025
refs/heads/master: 04289bb9891882202d7e961c4c04d2376930e9f9
28 changes: 14 additions & 14 deletions trunk/arch/x86/kernel/cpu/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,22 @@ static void perf_save_and_restart(struct perf_counter *counter)
}

static void
perf_handle_group(struct perf_counter *leader, u64 *status, u64 *overflown)
perf_handle_group(struct perf_counter *sibling, u64 *status, u64 *overflown)
{
struct perf_counter_context *ctx = leader->ctx;
struct perf_counter *counter;
struct perf_counter *counter, *group_leader = sibling->group_leader;
int bit;

list_for_each_entry(counter, &ctx->counters, list) {
if (counter->hw_event.record_type != PERF_RECORD_SIMPLE ||
counter == leader)
continue;
/*
* Store the counter's own timestamp first:
*/
perf_store_irq_data(sibling, sibling->hw_event.type);
perf_store_irq_data(sibling, atomic64_counter_read(sibling));

if (counter->active) {
/*
* Then store sibling timestamps (if any):
*/
list_for_each_entry(counter, &group_leader->sibling_list, list_entry) {
if (!counter->active) {
/*
* When counter was not in the overflow mask, we have to
* read it from hardware. We read it as well, when it
Expand All @@ -371,8 +375,8 @@ perf_handle_group(struct perf_counter *leader, u64 *status, u64 *overflown)
perf_save_and_restart(counter);
}
}
perf_store_irq_data(leader, counter->hw_event.type);
perf_store_irq_data(leader, atomic64_counter_read(counter));
perf_store_irq_data(sibling, counter->hw_event.type);
perf_store_irq_data(sibling, atomic64_counter_read(counter));
}
}

Expand Down Expand Up @@ -416,10 +420,6 @@ static void __smp_perf_counter_interrupt(struct pt_regs *regs, int nmi)
perf_store_irq_data(counter, instruction_pointer(regs));
break;
case PERF_RECORD_GROUP:
perf_store_irq_data(counter,
counter->hw_event.type);
perf_store_irq_data(counter,
atomic64_counter_read(counter));
perf_handle_group(counter, &status, &ack);
break;
}
Expand Down
8 changes: 6 additions & 2 deletions trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ struct perf_data {
* struct perf_counter - performance counter kernel representation:
*/
struct perf_counter {
struct list_head list;
struct list_head list_entry;
struct list_head sibling_list;
struct perf_counter *group_leader;

int active;
#if BITS_PER_LONG == 64
atomic64_t count;
Expand Down Expand Up @@ -158,7 +161,8 @@ struct perf_counter_context {
* Protect the list of counters:
*/
spinlock_t lock;
struct list_head counters;

struct list_head counter_list;
int nr_counters;
int nr_active;
struct task_struct *task;
Expand Down
Loading

0 comments on commit 847517c

Please sign in to comment.