diff options
author | Ingo Molnar <mingo@kernel.org> | 2019-12-06 08:54:41 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-12-06 08:54:41 +0100 |
commit | 0f60a0bcc1b96d531fa623ab520f863f1292c75b (patch) | |
tree | 30560c020dfcab8b05519732edd16810e3059b3c /tools/perf/util/sort.c | |
parent | 9f58c93efdffc2cba91fdcee010b3e5e8860334d (diff) | |
parent | fd9bee5e24141d00e23b66d1b51bc759efa7e3fe (diff) |
Merge tag 'perf-urgent-for-mingo-5.5-20191205' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf fixes from Arnaldo Carvalho de Melo:
perf inject:
Adrian Hunter:
- Fix processing of ID index for injected instruction tracing
perf report:
Ravi Bangoria:
- Replace pr_err() with ui__error(), so that we can see the output
in the TUI mode instead of showing and immediately restoring the
screen to the state before perf was started.
- Don't start --mem-mode/--branch-mode mode if required samples are not
available.
tools headers UAPI:
Arnaldo Carvalho de Melo:
- Sync drm/i915_drm.h with the kernel sources
- Update tools's copy of drm.h headers.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/sort.c')
-rw-r--r-- | tools/perf/util/sort.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 345b5ccc90f6..9fcba2872130 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -2681,12 +2681,12 @@ static int setup_sort_list(struct perf_hpp_list *list, char *str, ret = sort_dimension__add(list, tok, evlist, level); if (ret == -EINVAL) { if (!cacheline_size() && !strncasecmp(tok, "dcacheline", strlen(tok))) - pr_err("The \"dcacheline\" --sort key needs to know the cacheline size and it couldn't be determined on this system"); + ui__error("The \"dcacheline\" --sort key needs to know the cacheline size and it couldn't be determined on this system"); else - pr_err("Invalid --sort key: `%s'", tok); + ui__error("Invalid --sort key: `%s'", tok); break; } else if (ret == -ESRCH) { - pr_err("Unknown --sort key: `%s'", tok); + ui__error("Unknown --sort key: `%s'", tok); break; } } @@ -2743,7 +2743,7 @@ static int setup_sort_order(struct evlist *evlist) return 0; if (sort_order[1] == '\0') { - pr_err("Invalid --sort key: `+'"); + ui__error("Invalid --sort key: `+'"); return -EINVAL; } @@ -2959,6 +2959,9 @@ int output_field_add(struct perf_hpp_list *list, char *tok) if (strncasecmp(tok, sd->name, strlen(tok))) continue; + if (sort__mode != SORT_MODE__MEMORY) + return -EINVAL; + return __sort_dimension__add_output(list, sd); } @@ -2968,6 +2971,9 @@ int output_field_add(struct perf_hpp_list *list, char *tok) if (strncasecmp(tok, sd->name, strlen(tok))) continue; + if (sort__mode != SORT_MODE__BRANCH) + return -EINVAL; + return __sort_dimension__add_output(list, sd); } @@ -3034,7 +3040,7 @@ static int __setup_output_field(void) strp++; if (!strlen(strp)) { - pr_err("Invalid --fields key: `+'"); + ui__error("Invalid --fields key: `+'"); goto out; } |