All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf report: Fix -F for branch & mem modes
@ 2021-03-04  6:29 Ravi Bangoria
  2021-03-04  6:45 ` Athira Rajeev
  0 siblings, 1 reply; 3+ messages in thread
From: Ravi Bangoria @ 2021-03-04  6:29 UTC (permalink / raw)
  To: acme; +Cc: ravi.bangoria, jolsa, namhyung, atrajeev, kan.liang, linux-kernel

perf report fails to add valid additional fields with -F when
used with branch or mem modes. Fix it.

Before patch:

  $ ./perf record -b
  $ ./perf report -b -F +srcline_from --stdio
  Error:
  Invalid --fields key: `srcline_from'

After patch:

  $ ./perf report -b -F +srcline_from --stdio
  # Samples: 8K of event 'cycles'
  # Event count (approx.): 8784
  ...

Reported-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Fixes: aa6b3c99236b ("perf report: Make -F more strict like -s")
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
---
 tools/perf/util/sort.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 0d5ad42812b9..552b590485bf 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -3140,7 +3140,7 @@ 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)
+		if (sort__mode != SORT_MODE__BRANCH)
 			return -EINVAL;
 
 		return __sort_dimension__add_output(list, sd);
@@ -3152,7 +3152,7 @@ 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)
+		if (sort__mode != SORT_MODE__MEMORY)
 			return -EINVAL;
 
 		return __sort_dimension__add_output(list, sd);
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-04 17:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-04  6:29 [PATCH] perf report: Fix -F for branch & mem modes Ravi Bangoria
2021-03-04  6:45 ` Athira Rajeev
2021-03-04 17:05   ` Arnaldo Carvalho de Melo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.