[PATCH 2/2] perf: Handle perf-versionnumber

From: Andi Kleen
Date: Thu Nov 18 2010 - 05:51:16 EST


From: Andi Kleen <ak@xxxxxxxxxxxxxxx>

Sometimes it's useful to have multiple perfs with version number
around. This was defeated by the internal command code. Don't
try to handle a number as a internal command.

Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
---
tools/perf/perf.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/perf.c b/tools/perf/perf.c
index cdd6c03..c14c0fa 100644
--- a/tools/perf/perf.c
+++ b/tools/perf/perf.c
@@ -444,8 +444,11 @@ int main(int argc, const char **argv)
*
* So we just directly call the internal command handler, and
* die if that one cannot handle it.
+ *
+ * If there is a number after the - don't do this. Assume it's
+ * a perf-VERSIONNUMBER
*/
- if (!prefixcmp(cmd, "perf-")) {
+ if (!prefixcmp(cmd, "perf-") && !isdigit(cmd[5])) {
cmd += 5;
argv[0] = cmd;
handle_internal_command(argc, argv);
--
1.7.1

--
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/