Re: [PATCH 17/19] perf script: print addr by default for BTS

From: David Ahern
Date: Fri Oct 18 2013 - 14:20:34 EST


On 10/18/13 6:29 AM, Adrian Hunter wrote:
addr is not displayed by default for hardware events,
however for branch events it is the target of the branch
so for BTS display it by default if it was recorded.

Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
tools/perf/builtin-script.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 3f9a9bf..1a91621 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -413,7 +413,9 @@ static void print_sample_bts(union perf_event *event,
printf(" => ");

/* print branch_to information */
- if (PRINT_FIELD(ADDR))
+ if (PRINT_FIELD(ADDR) ||
+ ((evsel->attr.sample_type & PERF_SAMPLE_ADDR) &&
+ !output[attr->type].user_set))
print_sample_addr(event, sample, machine, thread, attr);

printf("\n");


Looks ok to me. Acked-by: David Ahern <dsahern@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/