Messages in this thread Patch in this message | | | From | Ravi Bangoria <> | Subject | [PATCH v2 2/3] perf report: Make -F more strict like -s | Date | Thu, 14 Nov 2019 18:52:12 +0530 |
| |
Currently -F allows branch-mode / mem-mode fields with -F even when perf report is not running in that mode. Don't allow that.
Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org> Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com> --- tools/perf/util/sort.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index cba8f22e4ffb..9999f6853440 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -2974,6 +2974,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); } @@ -2983,6 +2986,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); } -- 2.21.0
| |