[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-3912f2abc942a002ef611fc973add5e5eadb3432@git.kernel.org>
Date: Mon, 28 Dec 2009 10:04:37 GMT
From: tip-bot for Amerigo Wang <amwang@...hat.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, acme@...hat.com, paulus@...ba.org,
hpa@...or.com, mingo@...hat.com, a.p.zijlstra@...llo.nl,
efault@....de, amwang@...hat.com, fweisbec@...il.com,
tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/core] perf: Use format string of printf to align strings
Commit-ID: 3912f2abc942a002ef611fc973add5e5eadb3432
Gitweb: http://git.kernel.org/tip/3912f2abc942a002ef611fc973add5e5eadb3432
Author: Amerigo Wang <amwang@...hat.com>
AuthorDate: Mon, 14 Dec 2009 03:23:56 -0500
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Mon, 28 Dec 2009 09:03:16 +0100
perf: Use format string of printf to align strings
Instead of filling whitespaces to do alignment, use
printf's format string.
This simplifies the code a bit.
Signed-off-by: WANG Cong <amwang@...hat.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
LKML-Reference: <20091214082700.4224.57640.sendpatchset@...alhost.localdomain>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
tools/perf/builtin-help.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-help.c b/tools/perf/builtin-help.c
index 9f810b1..e427d69 100644
--- a/tools/perf/builtin-help.c
+++ b/tools/perf/builtin-help.c
@@ -286,8 +286,7 @@ void list_common_cmds_help(void)
puts(" The most commonly used perf commands are:");
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
- printf(" %s ", common_cmds[i].name);
- mput_char(' ', longest - strlen(common_cmds[i].name));
+ printf(" %-*s ", longest, common_cmds[i].name);
puts(common_cmds[i].help);
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists