aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-07-07 01:52:36 -0400
committerIngo Molnar <mingo@elte.hu>2009-07-10 05:59:40 -0400
commitdb59504d89db1462a5281fb55b1d962cb74a398f (patch)
treeb33fcbee2ee8103c15f6e19ab3039af46fc62219 /kernel/trace/trace.h
parent9d22b536609abf0d64648f99518676ea58245e3b (diff)
ksym_tracer: Extract trace entry from struct trace_ksym
struct trace_ksym is used as an entry in hbp list, and is also used as trace_entry stored in ring buffer. This is not necessary and is a waste of memory in ring buffer. There is also a bug that dereferencing field->ksym_hbp in ksym_trace_output() can be invalid. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: "K.Prasad" <prasad@linux.vnet.ibm.com> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <4A52E2A4.4050007@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 7d5cc37b8fca..ff1ef411a176 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -215,17 +215,12 @@ struct syscall_trace_exit {
215#define KSYM_SELFTEST_ENTRY "ksym_selftest_dummy" 215#define KSYM_SELFTEST_ENTRY "ksym_selftest_dummy"
216extern int process_new_ksym_entry(char *ksymname, int op, unsigned long addr); 216extern int process_new_ksym_entry(char *ksymname, int op, unsigned long addr);
217 217
218struct trace_ksym { 218struct ksym_trace_entry {
219 struct trace_entry ent; 219 struct trace_entry ent;
220 struct hw_breakpoint *ksym_hbp;
221 unsigned long ksym_addr;
222 unsigned long ip; 220 unsigned long ip;
223#ifdef CONFIG_PROFILE_KSYM_TRACER 221 unsigned char type;
224 unsigned long counter;
225#endif
226 struct hlist_node ksym_hlist;
227 char ksym_name[KSYM_NAME_LEN]; 222 char ksym_name[KSYM_NAME_LEN];
228 char p_name[TASK_COMM_LEN]; 223 char cmd[TASK_COMM_LEN];
229}; 224};
230 225
231/* 226/*
@@ -343,7 +338,7 @@ extern void __ftrace_bad_type(void);
343 TRACE_SYSCALL_ENTER); \ 338 TRACE_SYSCALL_ENTER); \
344 IF_ASSIGN(var, ent, struct syscall_trace_exit, \ 339 IF_ASSIGN(var, ent, struct syscall_trace_exit, \
345 TRACE_SYSCALL_EXIT); \ 340 TRACE_SYSCALL_EXIT); \
346 IF_ASSIGN(var, ent, struct trace_ksym, TRACE_KSYM); \ 341 IF_ASSIGN(var, ent, struct ksym_trace_entry, TRACE_KSYM);\
347 __ftrace_bad_type(); \ 342 __ftrace_bad_type(); \
348 } while (0) 343 } while (0)
349 344