diff options
author | Zhang, Yanmin <yanmin_zhang@linux.intel.com> | 2010-04-19 01:32:41 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-04-19 05:35:33 -0400 |
commit | 39447b386c846bbf1c56f6403c5282837486200f (patch) | |
tree | 5ceaf9900919e4bd269b92c55df15e33039fefd1 /arch/x86/include/asm/perf_event.h | |
parent | b5a80b7e91d6c067339e4d81a0176a835e9bf910 (diff) |
perf: Enhance perf to allow for guest statistic collection from host
Below patch introduces perf_guest_info_callbacks and related
register/unregister functions. Add more PERF_RECORD_MISC_XXX bits
meaning guest kernel and guest user space.
Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/include/asm/perf_event.h')
-rw-r--r-- | arch/x86/include/asm/perf_event.h | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/arch/x86/include/asm/perf_event.h b/arch/x86/include/asm/perf_event.h index f6d43dbfd8e..254883d0c7e 100644 --- a/arch/x86/include/asm/perf_event.h +++ b/arch/x86/include/asm/perf_event.h | |||
@@ -135,17 +135,10 @@ extern void perf_events_lapic_init(void); | |||
135 | */ | 135 | */ |
136 | #define PERF_EFLAGS_EXACT (1UL << 3) | 136 | #define PERF_EFLAGS_EXACT (1UL << 3) |
137 | 137 | ||
138 | #define perf_misc_flags(regs) \ | 138 | struct pt_regs; |
139 | ({ int misc = 0; \ | 139 | extern unsigned long perf_instruction_pointer(struct pt_regs *regs); |
140 | if (user_mode(regs)) \ | 140 | extern unsigned long perf_misc_flags(struct pt_regs *regs); |
141 | misc |= PERF_RECORD_MISC_USER; \ | 141 | #define perf_misc_flags(regs) perf_misc_flags(regs) |
142 | else \ | ||
143 | misc |= PERF_RECORD_MISC_KERNEL; \ | ||
144 | if (regs->flags & PERF_EFLAGS_EXACT) \ | ||
145 | misc |= PERF_RECORD_MISC_EXACT; \ | ||
146 | misc; }) | ||
147 | |||
148 | #define perf_instruction_pointer(regs) ((regs)->ip) | ||
149 | 142 | ||
150 | #else | 143 | #else |
151 | static inline void init_hw_perf_events(void) { } | 144 | static inline void init_hw_perf_events(void) { } |