lkml.org 
[lkml]   [2010]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] perf: Handle perf-versionnumber
Date
From: Andi Kleen <ak@linux.intel.com>

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@linux.intel.com>
---
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


\
 
 \ /
  Last update: 2010-11-18 11:53    [W:0.072 / U:0.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site