Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147198
b: refs/heads/master
c: 3b6f9e5
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras committed Jan 14, 2009
1 parent 5707061 commit 1f75e43
Show file tree
Hide file tree
Showing 4 changed files with 170 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: 01d0287f068de2934109ba9b989d8807526cccc2
refs/heads/master: 3b6f9e5cb21964b7ce12bf81076f830885563ec8
10 changes: 1 addition & 9 deletions trunk/arch/powerpc/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ void perf_counter_print_debug(void)
{
}

/*
* Return 1 for a software counter, 0 for a hardware counter
*/
static inline int is_software_counter(struct perf_counter *counter)
{
return !counter->hw_event.raw && counter->hw_event.type < 0;
}

/*
* Read one performance monitor counter (PMC).
*/
Expand Down Expand Up @@ -443,6 +435,7 @@ int hw_perf_group_sched_in(struct perf_counter *group_leader,
*/
for (i = n0; i < n0 + n; ++i)
cpuhw->counter[i]->hw.config = cpuhw->events[i];
cpuctx->active_oncpu += n;
n = 1;
counter_sched_in(group_leader, cpu);
list_for_each_entry(sub, &group_leader->sibling_list, list_entry) {
Expand All @@ -451,7 +444,6 @@ int hw_perf_group_sched_in(struct perf_counter *group_leader,
++n;
}
}
cpuctx->active_oncpu += n;
ctx->nr_active += n;

return 1;
Expand Down
15 changes: 14 additions & 1 deletion trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ struct perf_counter_hw_event {
nmi : 1, /* NMI sampling */
raw : 1, /* raw event type */
inherit : 1, /* children inherit it */
__reserved_1 : 28;
pinned : 1, /* must always be on PMU */
exclusive : 1, /* only counter on PMU */

__reserved_1 : 26;

u64 __reserved_2;
};
Expand Down Expand Up @@ -141,6 +144,7 @@ struct hw_perf_counter_ops {
* enum perf_counter_active_state - the states of a counter
*/
enum perf_counter_active_state {
PERF_COUNTER_STATE_ERROR = -2,
PERF_COUNTER_STATE_OFF = -1,
PERF_COUNTER_STATE_INACTIVE = 0,
PERF_COUNTER_STATE_ACTIVE = 1,
Expand Down Expand Up @@ -214,6 +218,7 @@ struct perf_cpu_context {
struct perf_counter_context *task_ctx;
int active_oncpu;
int max_pertask;
int exclusive;
};

/*
Expand All @@ -240,6 +245,14 @@ extern int hw_perf_group_sched_in(struct perf_counter *group_leader,
struct perf_cpu_context *cpuctx,
struct perf_counter_context *ctx, int cpu);

/*
* Return 1 for a software counter, 0 for a hardware counter
*/
static inline int is_software_counter(struct perf_counter *counter)
{
return !counter->hw_event.raw && counter->hw_event.type < 0;
}

#else
static inline void
perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
Expand Down
Loading

0 comments on commit 1f75e43

Please sign in to comment.