aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/Documentation/perf-probe.txt2
-rw-r--r--tools/perf/util/probe-event.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt
index d7e4869905f1..f96382692f42 100644
--- a/tools/perf/Documentation/perf-probe.txt
+++ b/tools/perf/Documentation/perf-probe.txt
@@ -170,7 +170,7 @@ Probe points are defined by following syntax.
170 or, 170 or,
171 sdt_PROVIDER:SDTEVENT 171 sdt_PROVIDER:SDTEVENT
172 172
173'EVENT' specifies the name of new event, if omitted, it will be set the name of the probed function. You can also specify a group name by 'GROUP', if omitted, set 'probe' is used for kprobe and 'probe_<bin>' is used for uprobe. 173'EVENT' specifies the name of new event, if omitted, it will be set the name of the probed function, and for return probes, a "\_\_return" suffix is automatically added to the function name. You can also specify a group name by 'GROUP', if omitted, set 'probe' is used for kprobe and 'probe_<bin>' is used for uprobe.
174Note that using existing group name can conflict with other events. Especially, using the group name reserved for kernel modules can hide embedded events in the 174Note that using existing group name can conflict with other events. Especially, using the group name reserved for kernel modules can hide embedded events in the
175modules. 175modules.
176'FUNC' specifies a probed function name, and it may have one of the following options; '+OFFS' is the offset from function entry address in bytes, ':RLN' is the relative-line number from function entry line, and '%return' means that it probes function return. And ';PTN' means lazy matching pattern (see LAZY MATCHING). Note that ';PTN' must be the end of the probe point definition. In addition, '@SRC' specifies a source file which has that function. 176'FUNC' specifies a probed function name, and it may have one of the following options; '+OFFS' is the offset from function entry address in bytes, ':RLN' is the relative-line number from function entry line, and '%return' means that it probes function return. And ';PTN' means lazy matching pattern (see LAZY MATCHING). Note that ';PTN' must be the end of the probe point definition. In addition, '@SRC' specifies a source file which has that function.
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 7e582547ac07..a68141d360b0 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2573,7 +2573,8 @@ int show_perf_probe_events(struct strfilter *filter)
2573} 2573}
2574 2574
2575static int get_new_event_name(char *buf, size_t len, const char *base, 2575static int get_new_event_name(char *buf, size_t len, const char *base,
2576 struct strlist *namelist, bool allow_suffix) 2576 struct strlist *namelist, bool ret_event,
2577 bool allow_suffix)
2577{ 2578{
2578 int i, ret; 2579 int i, ret;
2579 char *p, *nbase; 2580 char *p, *nbase;
@@ -2590,7 +2591,7 @@ static int get_new_event_name(char *buf, size_t len, const char *base,
2590 *p = '\0'; 2591 *p = '\0';
2591 2592
2592 /* Try no suffix number */ 2593 /* Try no suffix number */
2593 ret = e_snprintf(buf, len, "%s", nbase); 2594 ret = e_snprintf(buf, len, "%s%s", nbase, ret_event ? "__return" : "");
2594 if (ret < 0) { 2595 if (ret < 0) {
2595 pr_debug("snprintf() failed: %d\n", ret); 2596 pr_debug("snprintf() failed: %d\n", ret);
2596 goto out; 2597 goto out;
@@ -2689,8 +2690,8 @@ static int probe_trace_event__set_name(struct probe_trace_event *tev,
2689 group = PERFPROBE_GROUP; 2690 group = PERFPROBE_GROUP;
2690 2691
2691 /* Get an unused new event name */ 2692 /* Get an unused new event name */
2692 ret = get_new_event_name(buf, 64, event, 2693 ret = get_new_event_name(buf, 64, event, namelist,
2693 namelist, allow_suffix); 2694 tev->point.retprobe, allow_suffix);
2694 if (ret < 0) 2695 if (ret < 0)
2695 return ret; 2696 return ret;
2696 2697