diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-04-08 09:01:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-08 12:53:28 -0400 |
commit | 6b6e5486b3a168f0328c82a8d4376caf901472b1 (patch) | |
tree | f47c942f813f1348b5218d2a8df0c76378faff0b /kernel | |
parent | 6fab01927e8bdbbc77bafba2abb4810c5591ad52 (diff) |
perf_counter: use misc field to widen type
Push the PERF_EVENT_COUNTER_OVERFLOW bit into the misc field so that
we can have the full 32bit for PERF_RECORD_ bits.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
LKML-Reference: <20090408130408.891867663@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/perf_counter.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 4af98f943d3b..bf12df6f3538 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -1828,15 +1828,16 @@ static void perf_counter_output(struct perf_counter *counter, | |||
1828 | int callchain_size = 0; | 1828 | int callchain_size = 0; |
1829 | u64 time; | 1829 | u64 time; |
1830 | 1830 | ||
1831 | header.type = PERF_EVENT_COUNTER_OVERFLOW; | 1831 | header.type = 0; |
1832 | header.size = sizeof(header); | 1832 | header.size = sizeof(header); |
1833 | 1833 | ||
1834 | header.misc = user_mode(regs) ? | 1834 | header.misc = PERF_EVENT_MISC_OVERFLOW; |
1835 | header.misc |= user_mode(regs) ? | ||
1835 | PERF_EVENT_MISC_USER : PERF_EVENT_MISC_KERNEL; | 1836 | PERF_EVENT_MISC_USER : PERF_EVENT_MISC_KERNEL; |
1836 | 1837 | ||
1837 | if (record_type & PERF_RECORD_IP) { | 1838 | if (record_type & PERF_RECORD_IP) { |
1838 | ip = instruction_pointer(regs); | 1839 | ip = instruction_pointer(regs); |
1839 | header.type |= __PERF_EVENT_IP; | 1840 | header.type |= PERF_RECORD_IP; |
1840 | header.size += sizeof(ip); | 1841 | header.size += sizeof(ip); |
1841 | } | 1842 | } |
1842 | 1843 | ||
@@ -1845,12 +1846,12 @@ static void perf_counter_output(struct perf_counter *counter, | |||
1845 | tid_entry.pid = current->group_leader->pid; | 1846 | tid_entry.pid = current->group_leader->pid; |
1846 | tid_entry.tid = current->pid; | 1847 | tid_entry.tid = current->pid; |
1847 | 1848 | ||
1848 | header.type |= __PERF_EVENT_TID; | 1849 | header.type |= PERF_RECORD_TID; |
1849 | header.size += sizeof(tid_entry); | 1850 | header.size += sizeof(tid_entry); |
1850 | } | 1851 | } |
1851 | 1852 | ||
1852 | if (record_type & PERF_RECORD_GROUP) { | 1853 | if (record_type & PERF_RECORD_GROUP) { |
1853 | header.type |= __PERF_EVENT_GROUP; | 1854 | header.type |= PERF_RECORD_GROUP; |
1854 | header.size += sizeof(u64) + | 1855 | header.size += sizeof(u64) + |
1855 | counter->nr_siblings * sizeof(group_entry); | 1856 | counter->nr_siblings * sizeof(group_entry); |
1856 | } | 1857 | } |
@@ -1861,7 +1862,7 @@ static void perf_counter_output(struct perf_counter *counter, | |||
1861 | if (callchain) { | 1862 | if (callchain) { |
1862 | callchain_size = (1 + callchain->nr) * sizeof(u64); | 1863 | callchain_size = (1 + callchain->nr) * sizeof(u64); |
1863 | 1864 | ||
1864 | header.type |= __PERF_EVENT_CALLCHAIN; | 1865 | header.type |= PERF_RECORD_CALLCHAIN; |
1865 | header.size += callchain_size; | 1866 | header.size += callchain_size; |
1866 | } | 1867 | } |
1867 | } | 1868 | } |
@@ -1872,7 +1873,7 @@ static void perf_counter_output(struct perf_counter *counter, | |||
1872 | */ | 1873 | */ |
1873 | time = sched_clock(); | 1874 | time = sched_clock(); |
1874 | 1875 | ||
1875 | header.type |= __PERF_EVENT_TIME; | 1876 | header.type |= PERF_RECORD_TIME; |
1876 | header.size += sizeof(u64); | 1877 | header.size += sizeof(u64); |
1877 | } | 1878 | } |
1878 | 1879 | ||