diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 22:58:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-10 22:58:13 -0500 |
commit | 1dd7dcb6eaa677b034e7ef63df8320277507ae70 (patch) | |
tree | 3f1592b634d7bdde94e00570925be2dade8433d4 /kernel/trace/trace_syscalls.c | |
parent | b6da0076bab5a12afb19312ffee41c95490af2a0 (diff) | |
parent | 3558a5ac50dbb2419cc649d5e154af161d661037 (diff) |
Merge tag 'trace-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing updates from Steven Rostedt:
"There was a lot of clean ups and minor fixes. One of those clean ups
was to the trace_seq code. It also removed the return values to the
trace_seq_*() functions and use trace_seq_has_overflowed() to see if
the buffer filled up or not. This is similar to work being done to
the seq_file code as well in another tree.
Some of the other goodies include:
- Added some "!" (NOT) logic to the tracing filter.
- Fixed the frame pointer logic to the x86_64 mcount trampolines
- Added the logic for dynamic trampolines on !CONFIG_PREEMPT systems.
That is, the ftrace trampoline can be dynamically allocated and be
called directly by functions that only have a single hook to them"
* tag 'trace-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (55 commits)
tracing: Truncated output is better than nothing
tracing: Add additional marks to signal very large time deltas
Documentation: describe trace_buf_size parameter more accurately
tracing: Allow NOT to filter AND and OR clauses
tracing: Add NOT to filtering logic
ftrace/fgraph/x86: Have prepare_ftrace_return() take ip as first parameter
ftrace/x86: Get rid of ftrace_caller_setup
ftrace/x86: Have save_mcount_regs macro also save stack frames if needed
ftrace/x86: Add macro MCOUNT_REG_SIZE for amount of stack used to save mcount regs
ftrace/x86: Simplify save_mcount_regs on getting RIP
ftrace/x86: Have save_mcount_regs store RIP in %rdi for first parameter
ftrace/x86: Rename MCOUNT_SAVE_FRAME and add more detailed comments
ftrace/x86: Move MCOUNT_SAVE_FRAME out of header file
ftrace/x86: Have static tracing also use ftrace_caller_setup
ftrace/x86: Have static function tracing always test for function graph
kprobes: Add IPMODIFY flag to kprobe_ftrace_ops
ftrace, kprobes: Support IPMODIFY flag to find IP modify conflict
kprobes/ftrace: Recover original IP if pre_handler doesn't change it
tracing/trivial: Fix typos and make an int into a bool
tracing: Deletion of an unnecessary check before iput()
...
Diffstat (limited to 'kernel/trace/trace_syscalls.c')
-rw-r--r-- | kernel/trace/trace_syscalls.c | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 29228c4d5696..dfe00a4f3f3e 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -114,7 +114,7 @@ print_syscall_enter(struct trace_iterator *iter, int flags, | |||
114 | struct trace_entry *ent = iter->ent; | 114 | struct trace_entry *ent = iter->ent; |
115 | struct syscall_trace_enter *trace; | 115 | struct syscall_trace_enter *trace; |
116 | struct syscall_metadata *entry; | 116 | struct syscall_metadata *entry; |
117 | int i, ret, syscall; | 117 | int i, syscall; |
118 | 118 | ||
119 | trace = (typeof(trace))ent; | 119 | trace = (typeof(trace))ent; |
120 | syscall = trace->nr; | 120 | syscall = trace->nr; |
@@ -128,35 +128,28 @@ print_syscall_enter(struct trace_iterator *iter, int flags, | |||
128 | goto end; | 128 | goto end; |
129 | } | 129 | } |
130 | 130 | ||
131 | ret = trace_seq_printf(s, "%s(", entry->name); | 131 | trace_seq_printf(s, "%s(", entry->name); |
132 | if (!ret) | ||
133 | return TRACE_TYPE_PARTIAL_LINE; | ||
134 | 132 | ||
135 | for (i = 0; i < entry->nb_args; i++) { | 133 | for (i = 0; i < entry->nb_args; i++) { |
134 | |||
135 | if (trace_seq_has_overflowed(s)) | ||
136 | goto end; | ||
137 | |||
136 | /* parameter types */ | 138 | /* parameter types */ |
137 | if (trace_flags & TRACE_ITER_VERBOSE) { | 139 | if (trace_flags & TRACE_ITER_VERBOSE) |
138 | ret = trace_seq_printf(s, "%s ", entry->types[i]); | 140 | trace_seq_printf(s, "%s ", entry->types[i]); |
139 | if (!ret) | 141 | |
140 | return TRACE_TYPE_PARTIAL_LINE; | ||
141 | } | ||
142 | /* parameter values */ | 142 | /* parameter values */ |
143 | ret = trace_seq_printf(s, "%s: %lx%s", entry->args[i], | 143 | trace_seq_printf(s, "%s: %lx%s", entry->args[i], |
144 | trace->args[i], | 144 | trace->args[i], |
145 | i == entry->nb_args - 1 ? "" : ", "); | 145 | i == entry->nb_args - 1 ? "" : ", "); |
146 | if (!ret) | ||
147 | return TRACE_TYPE_PARTIAL_LINE; | ||
148 | } | 146 | } |
149 | 147 | ||
150 | ret = trace_seq_putc(s, ')'); | 148 | trace_seq_putc(s, ')'); |
151 | if (!ret) | ||
152 | return TRACE_TYPE_PARTIAL_LINE; | ||
153 | |||
154 | end: | 149 | end: |
155 | ret = trace_seq_putc(s, '\n'); | 150 | trace_seq_putc(s, '\n'); |
156 | if (!ret) | ||
157 | return TRACE_TYPE_PARTIAL_LINE; | ||
158 | 151 | ||
159 | return TRACE_TYPE_HANDLED; | 152 | return trace_handle_return(s); |
160 | } | 153 | } |
161 | 154 | ||
162 | static enum print_line_t | 155 | static enum print_line_t |
@@ -168,7 +161,6 @@ print_syscall_exit(struct trace_iterator *iter, int flags, | |||
168 | struct syscall_trace_exit *trace; | 161 | struct syscall_trace_exit *trace; |
169 | int syscall; | 162 | int syscall; |
170 | struct syscall_metadata *entry; | 163 | struct syscall_metadata *entry; |
171 | int ret; | ||
172 | 164 | ||
173 | trace = (typeof(trace))ent; | 165 | trace = (typeof(trace))ent; |
174 | syscall = trace->nr; | 166 | syscall = trace->nr; |
@@ -176,7 +168,7 @@ print_syscall_exit(struct trace_iterator *iter, int flags, | |||
176 | 168 | ||
177 | if (!entry) { | 169 | if (!entry) { |
178 | trace_seq_putc(s, '\n'); | 170 | trace_seq_putc(s, '\n'); |
179 | return TRACE_TYPE_HANDLED; | 171 | goto out; |
180 | } | 172 | } |
181 | 173 | ||
182 | if (entry->exit_event->event.type != ent->type) { | 174 | if (entry->exit_event->event.type != ent->type) { |
@@ -184,12 +176,11 @@ print_syscall_exit(struct trace_iterator *iter, int flags, | |||
184 | return TRACE_TYPE_UNHANDLED; | 176 | return TRACE_TYPE_UNHANDLED; |
185 | } | 177 | } |
186 | 178 | ||
187 | ret = trace_seq_printf(s, "%s -> 0x%lx\n", entry->name, | 179 | trace_seq_printf(s, "%s -> 0x%lx\n", entry->name, |
188 | trace->ret); | 180 | trace->ret); |
189 | if (!ret) | ||
190 | return TRACE_TYPE_PARTIAL_LINE; | ||
191 | 181 | ||
192 | return TRACE_TYPE_HANDLED; | 182 | out: |
183 | return trace_handle_return(s); | ||
193 | } | 184 | } |
194 | 185 | ||
195 | extern char *__bad_type_size(void); | 186 | extern char *__bad_type_size(void); |