[PATCH V2 5/8] perf mem: report physical addresses

From: kan . liang
Date: Thu Jan 07 2016 - 15:49:25 EST


From: Kan Liang <kan.liang@xxxxxxxxx>

perf mem report should support physical addresses by applying -p or
--phys-data.

Signed-off-by: Kan Liang <kan.liang@xxxxxxxxx>
---

Changes since V1:
- Remove default_phys_mem_sort_order. Use a consistent format "--sort="

tools/perf/builtin-mem.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/tools/perf/builtin-mem.c b/tools/perf/builtin-mem.c
index 7d5ff3a..f8b77a3 100644
--- a/tools/perf/builtin-mem.c
+++ b/tools/perf/builtin-mem.c
@@ -176,9 +176,16 @@ static int report_events(int argc, const char **argv, struct perf_mem *mem)
* there is no weight (cost) associated with stores, so don't print
* the column
*/
- if (!(mem->operation & MEM_OPERATION_LOAD))
- rep_argv[i++] = "--sort=mem,sym,dso,symbol_daddr,"
- "dso_daddr,tlb,locked";
+ if (!(mem->operation & MEM_OPERATION_LOAD)) {
+ if (mem->phys_addr)
+ rep_argv[i++] = "--sort=mem,sym,dso,symbol_daddr,"
+ "dso_daddr,tlb,locked,phys_daddr";
+ else
+ rep_argv[i++] = "--sort=mem,sym,dso,symbol_daddr,"
+ "dso_daddr,tlb,locked";
+ } else if (mem->phys_addr)
+ rep_argv[i++] = "--sort=local_weight,mem,sym,dso,symbol_daddr,"
+ "dso_daddr,snoop,tlb,locked,phys_daddr";

for (j = 1; j < argc; j++, i++)
rep_argv[i] = argv[j];
@@ -294,7 +301,7 @@ int cmd_mem(int argc, const char **argv, const char *prefix __maybe_unused)
"separator for columns, no spaces will be added"
" between columns '.' is reserved."),
OPT_BOOLEAN('f', "force", &mem.force, "don't complain, do it"),
- OPT_BOOLEAN('p', "phys-data", &mem.phys_addr, "Record sample physical addresses"),
+ OPT_BOOLEAN('p', "phys-data", &mem.phys_addr, "Record/Report sample physical addresses"),
OPT_END()
};
const char *const mem_subcommands[] = { "record", "report", NULL };
--
1.8.3.1