diff options
author | Oleg Nesterov <oleg@redhat.com> | 2013-03-30 15:28:15 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2013-04-13 09:32:03 -0400 |
commit | 4ee5a52ed6301d0afa56cc995ef2c3795f45e801 (patch) | |
tree | 2ed597fd7f5519f914bd7aed5561c141b6599c77 | |
parent | 3ede82dd3e3deb23429f2bf44fb600f440eef84b (diff) |
uprobes/tracing: Change create_trace_uprobe() to support uretprobes
Finally change create_trace_uprobe() to check if argv[0][0] == 'r'
and pass the correct "is_ret" to alloc_trace_uprobe().
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Tested-by: Anton Arapov <anton@redhat.com>
-rw-r--r-- | kernel/trace/trace_uprobe.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 8c9f4894bcc0..2d08bea638a4 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c | |||
@@ -201,7 +201,7 @@ end: | |||
201 | 201 | ||
202 | /* | 202 | /* |
203 | * Argument syntax: | 203 | * Argument syntax: |
204 | * - Add uprobe: p[:[GRP/]EVENT] PATH:SYMBOL[+offs] [FETCHARGS] | 204 | * - Add uprobe: p|r[:[GRP/]EVENT] PATH:SYMBOL [FETCHARGS] |
205 | * | 205 | * |
206 | * - Remove uprobe: -:[GRP/]EVENT | 206 | * - Remove uprobe: -:[GRP/]EVENT |
207 | */ | 207 | */ |
@@ -213,20 +213,23 @@ static int create_trace_uprobe(int argc, char **argv) | |||
213 | char buf[MAX_EVENT_NAME_LEN]; | 213 | char buf[MAX_EVENT_NAME_LEN]; |
214 | struct path path; | 214 | struct path path; |
215 | unsigned long offset; | 215 | unsigned long offset; |
216 | bool is_delete; | 216 | bool is_delete, is_return; |
217 | int i, ret; | 217 | int i, ret; |
218 | 218 | ||
219 | inode = NULL; | 219 | inode = NULL; |
220 | ret = 0; | 220 | ret = 0; |
221 | is_delete = false; | 221 | is_delete = false; |
222 | is_return = false; | ||
222 | event = NULL; | 223 | event = NULL; |
223 | group = NULL; | 224 | group = NULL; |
224 | 225 | ||
225 | /* argc must be >= 1 */ | 226 | /* argc must be >= 1 */ |
226 | if (argv[0][0] == '-') | 227 | if (argv[0][0] == '-') |
227 | is_delete = true; | 228 | is_delete = true; |
229 | else if (argv[0][0] == 'r') | ||
230 | is_return = true; | ||
228 | else if (argv[0][0] != 'p') { | 231 | else if (argv[0][0] != 'p') { |
229 | pr_info("Probe definition must be started with 'p' or '-'.\n"); | 232 | pr_info("Probe definition must be started with 'p', 'r' or '-'.\n"); |
230 | return -EINVAL; | 233 | return -EINVAL; |
231 | } | 234 | } |
232 | 235 | ||
@@ -324,7 +327,7 @@ static int create_trace_uprobe(int argc, char **argv) | |||
324 | kfree(tail); | 327 | kfree(tail); |
325 | } | 328 | } |
326 | 329 | ||
327 | tu = alloc_trace_uprobe(group, event, argc, false); | 330 | tu = alloc_trace_uprobe(group, event, argc, is_return); |
328 | if (IS_ERR(tu)) { | 331 | if (IS_ERR(tu)) { |
329 | pr_info("Failed to allocate trace_uprobe.(%d)\n", (int)PTR_ERR(tu)); | 332 | pr_info("Failed to allocate trace_uprobe.(%d)\n", (int)PTR_ERR(tu)); |
330 | ret = PTR_ERR(tu); | 333 | ret = PTR_ERR(tu); |