aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_syscalls.c')
-rw-r--r--kernel/trace/trace_syscalls.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 527e17eae575..d99abc427c39 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -103,7 +103,8 @@ extern char *__bad_type_size(void);
103#define SYSCALL_FIELD(type, name) \ 103#define SYSCALL_FIELD(type, name) \
104 sizeof(type) != sizeof(trace.name) ? \ 104 sizeof(type) != sizeof(trace.name) ? \
105 __bad_type_size() : \ 105 __bad_type_size() : \
106 #type, #name, offsetof(typeof(trace), name), sizeof(trace.name) 106 #type, #name, offsetof(typeof(trace), name), \
107 sizeof(trace.name), is_signed_type(type)
107 108
108int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s) 109int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
109{ 110{
@@ -120,7 +121,8 @@ int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
120 if (!entry) 121 if (!entry)
121 return 0; 122 return 0;
122 123
123 ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", 124 ret = trace_seq_printf(s, "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
125 "\tsigned:%u;\n",
124 SYSCALL_FIELD(int, nr)); 126 SYSCALL_FIELD(int, nr));
125 if (!ret) 127 if (!ret)
126 return 0; 128 return 0;
@@ -130,8 +132,10 @@ int syscall_enter_format(struct ftrace_event_call *call, struct trace_seq *s)
130 entry->args[i]); 132 entry->args[i]);
131 if (!ret) 133 if (!ret)
132 return 0; 134 return 0;
133 ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;\n", offset, 135 ret = trace_seq_printf(s, "\toffset:%d;\tsize:%zu;"
134 sizeof(unsigned long)); 136 "\tsigned:%u;\n", offset,
137 sizeof(unsigned long),
138 is_signed_type(unsigned long));
135 if (!ret) 139 if (!ret)
136 return 0; 140 return 0;
137 offset += sizeof(unsigned long); 141 offset += sizeof(unsigned long);
@@ -163,8 +167,10 @@ int syscall_exit_format(struct ftrace_event_call *call, struct trace_seq *s)
163 struct syscall_trace_exit trace; 167 struct syscall_trace_exit trace;
164 168
165 ret = trace_seq_printf(s, 169 ret = trace_seq_printf(s,
166 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 170 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
167 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n", 171 "\tsigned:%u;\n"
172 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;"
173 "\tsigned:%u;\n",
168 SYSCALL_FIELD(int, nr), 174 SYSCALL_FIELD(int, nr),
169 SYSCALL_FIELD(long, ret)); 175 SYSCALL_FIELD(long, ret));
170 if (!ret) 176 if (!ret)
@@ -212,7 +218,7 @@ int syscall_exit_define_fields(struct ftrace_event_call *call)
212 if (ret) 218 if (ret)
213 return ret; 219 return ret;
214 220
215 ret = trace_define_field(call, SYSCALL_FIELD(long, ret), 0, 221 ret = trace_define_field(call, SYSCALL_FIELD(long, ret),
216 FILTER_OTHER); 222 FILTER_OTHER);
217 223
218 return ret; 224 return ret;