Merge branch 'tracing/core' into perf/core
[safe/jmp/linux-2.6] / kernel / trace / trace_syscalls.c
index 8bda4bf..d00d1a8 100644 (file)
@@ -166,7 +166,8 @@ extern char *__bad_type_size(void);
 #define SYSCALL_FIELD(type, name)                                      \
        sizeof(type) != sizeof(trace.name) ?                            \
                __bad_type_size() :                                     \
-               #type, #name, offsetof(typeof(trace), name), sizeof(trace.name)
+               #type, #name, offsetof(typeof(trace), name),            \
+               sizeof(trace.name), is_signed_type(type)
 
 int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
 {
@@ -183,7 +184,8 @@ int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
        if (!entry)
                return 0;
 
-       ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n",
+       ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
+                              "\tsigned:%u;\n",
                               SYSCALL_FIELD(int, nr));
        if (!ret)
                return 0;
@@ -193,8 +195,10 @@ int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
                                        entry->args[i]);
                if (!ret)
                        return 0;
-               ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;\n", offset,
-                                      sizeof(unsigned long));
+               ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;"
+                                      "\tsigned:%u;\n", offset,
+                                      sizeof(unsigned long),
+                                      is_signed_type(unsigned long));
                if (!ret)
                        return 0;
                offset += sizeof(unsigned long);
@@ -226,10 +230,12 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
        struct syscall_trace_exit trace;
 
        ret = trace_seq_printf(s,
-                              "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
-                              "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n",
+                              "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
+                              "\tsigned:%u;\n"
+                              "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
+                              "\tsigned:%u;\n",
                               SYSCALL_FIELD(int, nr),
-                              SYSCALL_FIELD(unsigned long, ret));
+                              SYSCALL_FIELD(long, ret));
        if (!ret)
                return 0;
 
@@ -275,7 +281,7 @@ int syscall_exit_define_fields(struct ftrace_event_call *call)
        if (ret)
                return ret;
 
-       ret = trace_define_field(call, SYSCALL_FIELD(unsigned long, ret), 0,
+       ret = trace_define_field(call, SYSCALL_FIELD(long, ret),
                                 FILTER_OTHER);
 
        return ret;