Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147152
b: refs/heads/master
c: 9b51f66
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Dec 14, 2008
1 parent 29c9da5 commit 80bd1c5
Show file tree
Hide file tree
Showing 4 changed files with 229 additions and 52 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: ee06094f8279e1312fc0a31591320cc7b6f0ab1e
refs/heads/master: 9b51f66dcb09ac5eb6bc68fc111d5c7a1e0131d6
24 changes: 18 additions & 6 deletions trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ struct perf_counter_hw_event {
u64 irq_period;
u32 record_type;

u32 disabled : 1, /* off by default */
nmi : 1, /* NMI sampling */
raw : 1, /* raw event type */
__reserved_1 : 29;
u32 disabled : 1, /* off by default */
nmi : 1, /* NMI sampling */
raw : 1, /* raw event type */
inherit : 1, /* children inherit it */
__reserved_1 : 28;

u64 __reserved_2;
};
Expand Down Expand Up @@ -138,6 +139,8 @@ enum perf_counter_active_state {
PERF_COUNTER_STATE_ACTIVE = 1,
};

struct file;

/**
* struct perf_counter - performance counter kernel representation:
*/
Expand All @@ -156,7 +159,10 @@ struct perf_counter {

struct perf_counter_context *ctx;
struct task_struct *task;
struct file *filp;

unsigned int nr_inherited;
struct perf_counter *parent;
/*
* Protect attach/detach:
*/
Expand Down Expand Up @@ -210,13 +216,16 @@ struct perf_cpu_context {
extern int perf_max_counters;

#ifdef CONFIG_PERF_COUNTERS
extern void
perf_counter_show(struct perf_counter *counter, char *str, int trace);
extern const struct hw_perf_counter_ops *
hw_perf_counter_init(struct perf_counter *counter);

extern void perf_counter_task_sched_in(struct task_struct *task, int cpu);
extern void perf_counter_task_sched_out(struct task_struct *task, int cpu);
extern void perf_counter_task_tick(struct task_struct *task, int cpu);
extern void perf_counter_init_task(struct task_struct *task);
extern void perf_counter_init_task(struct task_struct *child);
extern void perf_counter_exit_task(struct task_struct *child);
extern void perf_counter_notify(struct pt_regs *regs);
extern void perf_counter_print_debug(void);
extern u64 hw_perf_save_disable(void);
Expand All @@ -226,12 +235,15 @@ extern int perf_counter_task_enable(void);

#else
static inline void
perf_counter_show(struct perf_counter *counter, char *str, int trace) { }
static inline void
perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
static inline void
perf_counter_task_sched_out(struct task_struct *task, int cpu) { }
static inline void
perf_counter_task_tick(struct task_struct *task, int cpu) { }
static inline void perf_counter_init_task(struct task_struct *task) { }
static inline void perf_counter_init_task(struct task_struct *child) { }
static inline void perf_counter_exit_task(struct task_struct *child) { }
static inline void perf_counter_notify(struct pt_regs *regs) { }
static inline void perf_counter_print_debug(void) { }
static inline void hw_perf_restore(u64 ctrl) { }
Expand Down
7 changes: 4 additions & 3 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1093,11 +1093,12 @@ NORET_TYPE void do_exit(long code)
mpol_put(tsk->mempolicy);
tsk->mempolicy = NULL;
#endif
#ifdef CONFIG_FUTEX
/*
* This must happen late, after the PID is not
* hashed anymore:
* These must happen late, after the PID is not
* hashed anymore, but still at a point that may sleep:
*/
perf_counter_exit_task(tsk);
#ifdef CONFIG_FUTEX
if (unlikely(!list_empty(&tsk->pi_state_list)))
exit_pi_state_list(tsk);
if (unlikely(current->pi_state_cache))
Expand Down
Loading

0 comments on commit 80bd1c5

Please sign in to comment.