Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147199
b: refs/heads/master
c: d859e29
h: refs/heads/master
i:
  147197: 5707061
  147195: 1e71299
  147191: a2f9167
  147183: c1d81c3
  147167: 7ddc48a
  147135: 6320a8d
  147071: 47ad9ae
  146943: 5d9e81e
v: v3
  • Loading branch information
Paul Mackerras committed Jan 17, 2009
1 parent 1f75e43 commit dd9b477
Show file tree
Hide file tree
Showing 3 changed files with 416 additions and 62 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: 3b6f9e5cb21964b7ce12bf81076f830885563ec8
refs/heads/master: d859e29fe34cb833071b20aef860ee94fbad9bb2
21 changes: 19 additions & 2 deletions trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define _LINUX_PERF_COUNTER_H

#include <asm/atomic.h>
#include <asm/ioctl.h>

#ifdef CONFIG_PERF_COUNTERS
# include <asm/perf_counter.h>
Expand Down Expand Up @@ -94,6 +95,12 @@ struct perf_counter_hw_event {
u64 __reserved_2;
};

/*
* Ioctls that can be done on a perf counter fd:
*/
#define PERF_COUNTER_IOC_ENABLE _IO('$', 0)
#define PERF_COUNTER_IOC_DISABLE _IO('$', 1)

/*
* Kernel-internal data types:
*/
Expand Down Expand Up @@ -173,8 +180,10 @@ struct perf_counter {
struct file *filp;

struct perf_counter *parent;
struct list_head child_list;

/*
* Protect attach/detach:
* Protect attach/detach and child_list:
*/
struct mutex mutex;

Expand All @@ -199,13 +208,21 @@ struct perf_counter {
struct perf_counter_context {
#ifdef CONFIG_PERF_COUNTERS
/*
* Protect the list of counters:
* Protect the states of the counters in the list,
* nr_active, and the list:
*/
spinlock_t lock;
/*
* Protect the list of counters. Locking either mutex or lock
* is sufficient to ensure the list doesn't change; to change
* the list you need to lock both the mutex and the spinlock.
*/
struct mutex mutex;

struct list_head counter_list;
int nr_counters;
int nr_active;
int is_active;
struct task_struct *task;
#endif
};
Expand Down
Loading

0 comments on commit dd9b477

Please sign in to comment.