diff options
Diffstat (limited to 'tools/perf/builtin-trace.c')
| -rw-r--r-- | tools/perf/builtin-trace.c | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index adbf28183560..b36061cd1ab8 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
| @@ -1758,6 +1758,7 @@ static int trace__printf_interrupted_entry(struct trace *trace) | |||
| 1758 | { | 1758 | { |
| 1759 | struct thread_trace *ttrace; | 1759 | struct thread_trace *ttrace; |
| 1760 | size_t printed; | 1760 | size_t printed; |
| 1761 | int len; | ||
| 1761 | 1762 | ||
| 1762 | if (trace->failure_only || trace->current == NULL) | 1763 | if (trace->failure_only || trace->current == NULL) |
| 1763 | return 0; | 1764 | return 0; |
| @@ -1768,9 +1769,14 @@ static int trace__printf_interrupted_entry(struct trace *trace) | |||
| 1768 | return 0; | 1769 | return 0; |
| 1769 | 1770 | ||
| 1770 | printed = trace__fprintf_entry_head(trace, trace->current, 0, false, ttrace->entry_time, trace->output); | 1771 | printed = trace__fprintf_entry_head(trace, trace->current, 0, false, ttrace->entry_time, trace->output); |
| 1771 | printed += fprintf(trace->output, ")%-*s ...\n", trace->args_alignment, ttrace->entry_str); | 1772 | printed += len = fprintf(trace->output, "%s)", ttrace->entry_str); |
| 1772 | ttrace->entry_pending = false; | 1773 | |
| 1774 | if (len < trace->args_alignment - 4) | ||
| 1775 | printed += fprintf(trace->output, "%-*s", trace->args_alignment - 4 - len, " "); | ||
| 1776 | |||
| 1777 | printed += fprintf(trace->output, " ...\n"); | ||
| 1773 | 1778 | ||
| 1779 | ttrace->entry_pending = false; | ||
| 1774 | ++trace->nr_events_printed; | 1780 | ++trace->nr_events_printed; |
| 1775 | 1781 | ||
| 1776 | return printed; | 1782 | return printed; |
| @@ -2026,9 +2032,10 @@ static int trace__sys_exit(struct trace *trace, struct perf_evsel *evsel, | |||
| 2026 | if (ttrace->entry_pending) { | 2032 | if (ttrace->entry_pending) { |
| 2027 | printed = fprintf(trace->output, "%s", ttrace->entry_str); | 2033 | printed = fprintf(trace->output, "%s", ttrace->entry_str); |
| 2028 | } else { | 2034 | } else { |
| 2029 | fprintf(trace->output, " ... ["); | 2035 | printed += fprintf(trace->output, " ... ["); |
| 2030 | color_fprintf(trace->output, PERF_COLOR_YELLOW, "continued"); | 2036 | color_fprintf(trace->output, PERF_COLOR_YELLOW, "continued"); |
| 2031 | fprintf(trace->output, "]: %s()", sc->name); | 2037 | printed += 9; |
| 2038 | printed += fprintf(trace->output, "]: %s()", sc->name); | ||
| 2032 | } | 2039 | } |
| 2033 | 2040 | ||
| 2034 | printed++; /* the closing ')' */ | 2041 | printed++; /* the closing ')' */ |
| @@ -2507,19 +2514,30 @@ static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp); | |||
| 2507 | 2514 | ||
| 2508 | static bool perf_evlist__add_vfs_getname(struct perf_evlist *evlist) | 2515 | static bool perf_evlist__add_vfs_getname(struct perf_evlist *evlist) |
| 2509 | { | 2516 | { |
| 2510 | struct perf_evsel *evsel = perf_evsel__newtp("probe", "vfs_getname"); | 2517 | bool found = false; |
| 2518 | struct perf_evsel *evsel, *tmp; | ||
| 2519 | struct parse_events_error err = { .idx = 0, }; | ||
| 2520 | int ret = parse_events(evlist, "probe:vfs_getname*", &err); | ||
| 2511 | 2521 | ||
| 2512 | if (IS_ERR(evsel)) | 2522 | if (ret) |
| 2513 | return false; | 2523 | return false; |
| 2514 | 2524 | ||
| 2515 | if (perf_evsel__field(evsel, "pathname") == NULL) { | 2525 | evlist__for_each_entry_safe(evlist, evsel, tmp) { |
| 2526 | if (!strstarts(perf_evsel__name(evsel), "probe:vfs_getname")) | ||
| 2527 | continue; | ||
| 2528 | |||
| 2529 | if (perf_evsel__field(evsel, "pathname")) { | ||
| 2530 | evsel->handler = trace__vfs_getname; | ||
| 2531 | found = true; | ||
| 2532 | continue; | ||
| 2533 | } | ||
| 2534 | |||
| 2535 | list_del_init(&evsel->node); | ||
| 2536 | evsel->evlist = NULL; | ||
| 2516 | perf_evsel__delete(evsel); | 2537 | perf_evsel__delete(evsel); |
| 2517 | return false; | ||
| 2518 | } | 2538 | } |
| 2519 | 2539 | ||
| 2520 | evsel->handler = trace__vfs_getname; | 2540 | return found; |
| 2521 | perf_evlist__add(evlist, evsel); | ||
| 2522 | return true; | ||
| 2523 | } | 2541 | } |
| 2524 | 2542 | ||
| 2525 | static struct perf_evsel *perf_evsel__new_pgfault(u64 config) | 2543 | static struct perf_evsel *perf_evsel__new_pgfault(u64 config) |
