lkml.org 
[lkml]   [2009]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 02/15] perf_counter: add more context information
Change the callchain context entries to u16, so as to gain some space.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/perf_counter.h | 4 ++--
kernel/perf_counter.c | 6 ++----
2 files changed, 4 insertions(+), 6 deletions(-)
Index: linux-2.6/include/linux/perf_counter.h
===================================================================
--- linux-2.6.orig/include/linux/perf_counter.h
+++ linux-2.6/include/linux/perf_counter.h
@@ -507,10 +507,10 @@ extern void perf_counter_mmap(unsigned l
extern void perf_counter_munmap(unsigned long addr, unsigned long len,
unsigned long pgoff, struct file *file);

-#define MAX_STACK_DEPTH 254
+#define MAX_STACK_DEPTH 255

struct perf_callchain_entry {
- u32 nr, hv, kernel, user;
+ u16 nr, hv, kernel, user;
u64 ip[MAX_STACK_DEPTH];
};

Index: linux-2.6/kernel/perf_counter.c
===================================================================
--- linux-2.6.orig/kernel/perf_counter.c
+++ linux-2.6/kernel/perf_counter.c
@@ -1657,9 +1657,7 @@ void perf_counter_do_pending(void)
* Callchain support -- arch specific
*/

-struct perf_callchain_entry *
-__attribute__((weak))
-perf_callchain(struct pt_regs *regs)
+__weak struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)
{
return NULL;
}
@@ -1819,7 +1817,7 @@ void perf_counter_output(struct perf_cou
callchain = perf_callchain(regs);

if (callchain) {
- callchain_size = (2 + callchain->nr) * sizeof(u64);
+ callchain_size = (1 + callchain->nr) * sizeof(u64);

header.type |= __PERF_EVENT_CALLCHAIN;
header.size += callchain_size;
--



\
 
 \ /
  Last update: 2009-04-06 11:49    [from the cache]
©2003-2011 Jasper Spaans