aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-12 16:16:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-12 16:16:52 -0400
commit4ddbac98980fe0a42cf57af5d1032e024aced6a1 (patch)
tree341d152dc1f9427d70d5b1fadafca61d22baacbb /include/linux
parent02a99ed6207e9a1d787bb360ef97de023c7edf4a (diff)
parent018df72dd01576ab199c6129233cdeaf1409958b (diff)
Merge branch 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perfcounters-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: perf_counter: Start documenting HAVE_PERF_COUNTERS requirements perf_counter: Add forward/backward attribute ABI compatibility perf record: Explicity program a default counter perf_counter: Remove PERF_TYPE_RAW special casing perf_counter: PERF_TYPE_HW_CACHE is a hardware counter too powerpc, perf_counter: Fix performance counter event types perf_counter/x86: Add a quirk for Atom processors perf_counter tools: Remove one L1-data alias
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/perf_counter.h22
-rw-r--r--include/linux/syscalls.h2
2 files changed, 18 insertions, 6 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 6e133954e2e4..1b3118a1023a 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -120,6 +120,8 @@ enum perf_counter_sample_format {
120 PERF_SAMPLE_ID = 1U << 6, 120 PERF_SAMPLE_ID = 1U << 6,
121 PERF_SAMPLE_CPU = 1U << 7, 121 PERF_SAMPLE_CPU = 1U << 7,
122 PERF_SAMPLE_PERIOD = 1U << 8, 122 PERF_SAMPLE_PERIOD = 1U << 8,
123
124 PERF_SAMPLE_MAX = 1U << 9, /* non-ABI */
123}; 125};
124 126
125/* 127/*
@@ -131,17 +133,26 @@ enum perf_counter_read_format {
131 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, 133 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
132 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, 134 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
133 PERF_FORMAT_ID = 1U << 2, 135 PERF_FORMAT_ID = 1U << 2,
136
137 PERF_FORMAT_MAX = 1U << 3, /* non-ABI */
134}; 138};
135 139
140#define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */
141
136/* 142/*
137 * Hardware event to monitor via a performance monitoring counter: 143 * Hardware event to monitor via a performance monitoring counter:
138 */ 144 */
139struct perf_counter_attr { 145struct perf_counter_attr {
146
140 /* 147 /*
141 * Major type: hardware/software/tracepoint/etc. 148 * Major type: hardware/software/tracepoint/etc.
142 */ 149 */
143 __u32 type; 150 __u32 type;
144 __u32 __reserved_1; 151
152 /*
153 * Size of the attr structure, for fwd/bwd compat.
154 */
155 __u32 size;
145 156
146 /* 157 /*
147 * Type specific configuration information. 158 * Type specific configuration information.
@@ -168,12 +179,12 @@ struct perf_counter_attr {
168 comm : 1, /* include comm data */ 179 comm : 1, /* include comm data */
169 freq : 1, /* use freq, not period */ 180 freq : 1, /* use freq, not period */
170 181
171 __reserved_2 : 53; 182 __reserved_1 : 53;
172 183
173 __u32 wakeup_events; /* wakeup every n events */ 184 __u32 wakeup_events; /* wakeup every n events */
174 __u32 __reserved_3; 185 __u32 __reserved_2;
175 186
176 __u64 __reserved_4; 187 __u64 __reserved_3;
177}; 188};
178 189
179/* 190/*
@@ -621,7 +632,8 @@ extern int perf_counter_overflow(struct perf_counter *counter, int nmi,
621static inline int is_software_counter(struct perf_counter *counter) 632static inline int is_software_counter(struct perf_counter *counter)
622{ 633{
623 return (counter->attr.type != PERF_TYPE_RAW) && 634 return (counter->attr.type != PERF_TYPE_RAW) &&
624 (counter->attr.type != PERF_TYPE_HARDWARE); 635 (counter->attr.type != PERF_TYPE_HARDWARE) &&
636 (counter->attr.type != PERF_TYPE_HW_CACHE);
625} 637}
626 638
627extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64); 639extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64);
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index c6c84ad8bd71..418d90f5effe 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -758,6 +758,6 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
758 758
759 759
760asmlinkage long sys_perf_counter_open( 760asmlinkage long sys_perf_counter_open(
761 const struct perf_counter_attr __user *attr_uptr, 761 struct perf_counter_attr __user *attr_uptr,
762 pid_t pid, int cpu, int group_fd, unsigned long flags); 762 pid_t pid, int cpu, int group_fd, unsigned long flags);
763#endif 763#endif