aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-08-26 23:09:51 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2009-08-26 23:09:51 -0400
commitaeaeae1187d7520f1c5559623f0a149da6a1c96e (patch)
treeabe8ba9315ce8857862d47f4c9cb3f78316fb814 /kernel
parent24851d2447830e6cba4c4b641cb73e713f312373 (diff)
tracing: Restore the const qualifier for field names and types definition
Restore the const qualifier in field's name and type parameters of trace_define_field that was lost while solving a conflict. Fields names and types are defined as builtin constant strings in static TRACE_EVENTs. But kprobes allocates these dynamically. That said, we still want to always pass these strings as const char * in trace_define_fields() to avoid any further accidental writes on the pointed strings. Reported-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_events.c4
-rw-r--r--kernel/trace/trace_syscalls.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 8079bb511c43..197cdaa96c43 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -27,8 +27,8 @@ DEFINE_MUTEX(event_mutex);
27 27
28LIST_HEAD(ftrace_events); 28LIST_HEAD(ftrace_events);
29 29
30int trace_define_field(struct ftrace_event_call *call, char *type, 30int trace_define_field(struct ftrace_event_call *call, const char *type,
31 char *name, int offset, int size, int is_signed, 31 const char *name, int offset, int size, int is_signed,
32 int filter_type) 32 int filter_type)
33{ 33{
34 struct ftrace_event_field *field; 34 struct ftrace_event_field *field;
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 5931933587e9..a928dd004535 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -193,8 +193,8 @@ int syscall_enter_define_fields(struct ftrace_event_call *call)
193 return ret; 193 return ret;
194 194
195 for (i = 0; i < meta->nb_args; i++) { 195 for (i = 0; i < meta->nb_args; i++) {
196 ret = trace_define_field(call, (char *)meta->types[i], 196 ret = trace_define_field(call, meta->types[i],
197 (char *)meta->args[i], offset, 197 meta->args[i], offset,
198 sizeof(unsigned long), 0, 198 sizeof(unsigned long), 0,
199 FILTER_OTHER); 199 FILTER_OTHER);
200 offset += sizeof(unsigned long); 200 offset += sizeof(unsigned long);