Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147466
b: refs/heads/master
c: 9d23a90
h: refs/heads/master
v: v3
  • Loading branch information
Paul Mackerras authored and Ingo Molnar committed May 15, 2009
1 parent dd17eb9 commit c0d1875
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 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: ef923214a4816c289e4af2d67a9ebb1a31e4ac61
refs/heads/master: 9d23a90a67261e73b2fcac04d8ca963c6b496afb
11 changes: 10 additions & 1 deletion trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,11 @@ struct perf_counter_mmap_page {
__u32 data_head; /* head in the data section */
};

#define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0)
#define PERF_EVENT_MISC_CPUMODE_UNKNOWN (0 << 0)
#define PERF_EVENT_MISC_KERNEL (1 << 0)
#define PERF_EVENT_MISC_USER (1 << 1)
#define PERF_EVENT_MISC_USER (2 << 0)
#define PERF_EVENT_MISC_HYPERVISOR (3 << 0)
#define PERF_EVENT_MISC_OVERFLOW (1 << 2)

struct perf_event_header {
Expand Down Expand Up @@ -596,6 +599,12 @@ extern int sysctl_perf_counter_mlock;

extern void perf_counter_init(void);

#ifndef perf_misc_flags
#define perf_misc_flags(regs) (user_mode(regs) ? PERF_EVENT_MISC_USER : \
PERF_EVENT_MISC_KERNEL)
#define perf_instruction_pointer(regs) instruction_pointer(regs)
#endif

#else
static inline void
perf_counter_task_sched_in(struct task_struct *task, int cpu) { }
Expand Down
5 changes: 2 additions & 3 deletions trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2042,11 +2042,10 @@ static void perf_counter_output(struct perf_counter *counter,
header.size = sizeof(header);

header.misc = PERF_EVENT_MISC_OVERFLOW;
header.misc |= user_mode(regs) ?
PERF_EVENT_MISC_USER : PERF_EVENT_MISC_KERNEL;
header.misc |= perf_misc_flags(regs);

if (record_type & PERF_RECORD_IP) {
ip = instruction_pointer(regs);
ip = perf_instruction_pointer(regs);
header.type |= PERF_RECORD_IP;
header.size += sizeof(ip);
}
Expand Down

0 comments on commit c0d1875

Please sign in to comment.