lkml.org 
[lkml]   [2013]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/7] perf lock: do not cut lock name
Date
While this could be seen as personal taste, there really isn't any
reason for being so stingy printing the lock name. Furthermore, some
symbol names are really just too long, and cutting them at 16 characters
doesn't help at all.

Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
---
tools/perf/builtin-lock.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index 780484f..2674a42 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -696,10 +696,9 @@ static void print_bad_events(int bad, int total)
static void print_result(void)
{
struct lock_stat *st;
- char cut_name[20];
int bad, total;

- pr_info("%20s ", "Name");
+ pr_info("%40s ", "Name");
pr_info("%10s ", "acquired");
pr_info("%10s ", "contended");

@@ -716,21 +715,8 @@ static void print_result(void)
bad++;
continue;
}
- bzero(cut_name, 20);
-
- if (strlen(st->name) < 16) {
- /* output raw name */
- pr_info("%20s ", st->name);
- } else {
- strncpy(cut_name, st->name, 16);
- cut_name[16] = '.';
- cut_name[17] = '.';
- cut_name[18] = '.';
- cut_name[19] = '\0';
- /* cut off name for saving output style */
- pr_info("%20s ", cut_name);
- }

+ pr_info("%40s ", st->name);
pr_info("%10u ", st->nr_acquired);
pr_info("%10u ", st->nr_contended);

--
1.7.11.7


\
 
 \ /
  Last update: 2013-09-09 04:41    [W:0.139 / U:22.552 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site