exclude_hv : 1, /* ditto hypervisor */
exclude_idle : 1, /* don't count when idle */
mmap : 1, /* include mmap data */
- munmap : 1, /* include munmap data */
comm : 1, /* include comm data */
freq : 1, /* use freq, not period */
- __reserved_1 : 52;
+ __reserved_1 : 53;
__u32 wakeup_events; /* wakeup every n events */
__u32 __reserved_2;
* };
*/
PERF_EVENT_MMAP = 1,
- PERF_EVENT_MUNMAP = 2,
/*
* struct {
extern void perf_counter_mmap(unsigned long addr, unsigned long len,
unsigned long pgoff, struct file *file);
-extern void perf_counter_munmap(unsigned long addr, unsigned long len,
- unsigned long pgoff, struct file *file);
-
extern void perf_counter_comm(struct task_struct *tsk);
extern void perf_counter_fork(struct task_struct *tsk);
perf_counter_mmap(unsigned long addr, unsigned long len,
unsigned long pgoff, struct file *file) { }
-static inline void
-perf_counter_munmap(unsigned long addr, unsigned long len,
- unsigned long pgoff, struct file *file) { }
-
static inline void perf_counter_comm(struct task_struct *tsk) { }
static inline void perf_counter_fork(struct task_struct *tsk) { }
static inline void perf_counter_init(void) { }
static atomic_t nr_counters __read_mostly;
static atomic_t nr_mmap_counters __read_mostly;
-static atomic_t nr_munmap_counters __read_mostly;
static atomic_t nr_comm_counters __read_mostly;
int sysctl_perf_counter_priv __read_mostly; /* do we need to be privileged */
atomic_dec(&nr_counters);
if (counter->attr.mmap)
atomic_dec(&nr_mmap_counters);
- if (counter->attr.munmap)
- atomic_dec(&nr_munmap_counters);
if (counter->attr.comm)
atomic_dec(&nr_comm_counters);
static int perf_counter_fork_match(struct perf_counter *counter)
{
- if (counter->attr.comm || counter->attr.mmap || counter->attr.munmap)
+ if (counter->attr.comm || counter->attr.mmap)
return 1;
return 0;
struct perf_fork_event fork_event;
if (!atomic_read(&nr_comm_counters) &&
- !atomic_read(&nr_mmap_counters) &&
- !atomic_read(&nr_munmap_counters))
+ !atomic_read(&nr_mmap_counters))
return;
fork_event = (struct perf_fork_event){
static int perf_counter_mmap_match(struct perf_counter *counter,
struct perf_mmap_event *mmap_event)
{
- if (counter->attr.mmap &&
- mmap_event->event.header.type == PERF_EVENT_MMAP)
- return 1;
-
- if (counter->attr.munmap &&
- mmap_event->event.header.type == PERF_EVENT_MUNMAP)
+ if (counter->attr.mmap)
return 1;
return 0;
perf_counter_mmap_event(&mmap_event);
}
-void perf_counter_munmap(unsigned long addr, unsigned long len,
- unsigned long pgoff, struct file *file)
-{
- struct perf_mmap_event mmap_event;
-
- if (!atomic_read(&nr_munmap_counters))
- return;
-
- mmap_event = (struct perf_mmap_event){
- .file = file,
- .event = {
- .header = { .type = PERF_EVENT_MUNMAP, },
- .start = addr,
- .len = len,
- .pgoff = pgoff,
- },
- };
-
- perf_counter_mmap_event(&mmap_event);
-}
-
/*
* Log sample_period changes so that analyzing tools can re-normalize the
* event flow.
atomic_inc(&nr_counters);
if (counter->attr.mmap)
atomic_inc(&nr_mmap_counters);
- if (counter->attr.munmap)
- atomic_inc(&nr_munmap_counters);
if (counter->attr.comm)
atomic_inc(&nr_comm_counters);