diff options
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/Documentation/perf-probe.txt | 2 | ||||
| -rw-r--r-- | tools/perf/util/probe-event.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/Documentation/perf-probe.txt b/tools/perf/Documentation/perf-probe.txt index e36ed4dd386..441324f2615 100644 --- a/tools/perf/Documentation/perf-probe.txt +++ b/tools/perf/Documentation/perf-probe.txt | |||
| @@ -87,7 +87,7 @@ Each probe argument follows below syntax. | |||
| 87 | 87 | ||
| 88 | [NAME=]LOCALVAR|$retval|%REG|@SYMBOL | 88 | [NAME=]LOCALVAR|$retval|%REG|@SYMBOL |
| 89 | 89 | ||
| 90 | 'NAME' specifies the name of this argument (optional). You can use the name of local variable, local data structure member (e.g. var->field, var.field2), or kprobe-tracer argument format (e.g. $retval, %ax, etc). | 90 | 'NAME' specifies the name of this argument (optional). You can use the name of local variable, local data structure member (e.g. var->field, var.field2), or kprobe-tracer argument format (e.g. $retval, %ax, etc). Note that the name of this argument will be set as the last member name if you specify a local data structure member (e.g. field2 for 'var->field1.field2'.) |
| 91 | 91 | ||
| 92 | LINE SYNTAX | 92 | LINE SYNTAX |
| 93 | ----------- | 93 | ----------- |
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index ab6f53deaba..19de8b77973 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
| @@ -481,6 +481,10 @@ static void parse_perf_probe_arg(const char *str, struct perf_probe_arg *arg) | |||
| 481 | } while (tmp); | 481 | } while (tmp); |
| 482 | (*fieldp)->name = xstrdup(str); | 482 | (*fieldp)->name = xstrdup(str); |
| 483 | pr_debug("%s(%d)\n", (*fieldp)->name, (*fieldp)->ref); | 483 | pr_debug("%s(%d)\n", (*fieldp)->name, (*fieldp)->ref); |
| 484 | |||
| 485 | /* If no name is specified, set the last field name */ | ||
| 486 | if (!arg->name) | ||
| 487 | arg->name = xstrdup((*fieldp)->name); | ||
| 484 | } | 488 | } |
| 485 | 489 | ||
| 486 | /* Parse perf-probe event command */ | 490 | /* Parse perf-probe event command */ |
