History

tracing/uprobes: Support perf-style return probe

Support perf-style return probe ("SYMBOL%return") for uprobe events as same as kprobe events does. Link: https://lkml.kernel.org/r/159972814601.428528.7641183316212425445.stgit@devnote2

Masami Hiramatsu committed 6 years ago

Commit 3dd3aae1 parent 4725cd82 files · +15 −2Browse files

Showing the changes to kernel (2 of 2 files). Show all

Unified · Split

2 files
  1. kernel/trace/trace.c +1 −1
  2. kernel/trace/trace_uprobe.c +14 −1
kernel/trace/trace.c+1−1
@@ -5125,7 +5125,7 @@ static const char readme_msg[] = · 5124 unmodified lines
5125 "place (kretprobe): [<module>:]<symbol>[+<offset>]%return|<memaddr>\n"5125 "place (kretprobe): [<module>:]<symbol>[+<offset>]%return|<memaddr>\n"
5126#endif5126#endif
5127#ifdef CONFIG_UPROBE_EVENTS5127#ifdef CONFIG_UPROBE_EVENTS
5128 " place (uprobe): <path>:<offset>[(ref_ctr_offset)]\n"5128 " place (uprobe): <path>:<offset>[%return][(ref_ctr_offset)]\n"
5129#endif5129#endif
5130 "\t args: <name>=fetcharg[:type]\n"5130 "\t args: <name>=fetcharg[:type]\n"
5131 "\t fetcharg: %<register>, @<address>, @<symbol>[+|-<offset>],\n"5131 "\t fetcharg: %<register>, @<address>, @<symbol>[+|-<offset>],\n"
kernel/trace/trace_uprobe.c+14−1
@@ -528,7 +528,7 @@ end: · 527 unmodified lines
528 528
529/*529/*
530 * Argument syntax:530 * Argument syntax:
531 * - Add uprobe: p|r[:[GRP/]EVENT] PATH:OFFSET [FETCHARGS]531 * - Add uprobe: p|r[:[GRP/]EVENT] PATH:OFFSET[%return][(REF)] [FETCHARGS]
532 */532 */
533static int trace_uprobe_create(int argc, const char **argv)533static int trace_uprobe_create(int argc, const char **argv)
534{534{
@@ -617,6 +617,19 @@ static int trace_uprobe_create(int argc, const char **argv) · 82 unmodified lines
617 }617 }
618 }618 }
619 619
620 /* Check if there is %return suffix */
621 tmp = strchr(arg, '%');
622 if (tmp) {
623 if (!strcmp(tmp, "%return")) {
624 *tmp = '\0';
625 is_return = true;
626 } else {
627 trace_probe_log_err(tmp - filename, BAD_ADDR_SUFFIX);
628 ret = -EINVAL;
629 goto fail_address_parse;
630 }
631 }
632
620 /* Parse uprobe offset. */633 /* Parse uprobe offset. */
621 ret = kstrtoul(arg, 0, &offset);634 ret = kstrtoul(arg, 0, &offset);
622 if (ret) {635 if (ret) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t