Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] [2/2] perf: allow installing as perf-versionnumber

0 views
Skip to first unread message

Andi Kleen

unread,
Dec 6, 2009, 9:10:03 AM12/6/09
to

Right now installing a given perf binary as perf-versionnumber doesn't
work because perf internally tries to dispatch a "versionnumber" command.
Add a special case to not dispatch commands starting with a digit.

Signed-off-by: Andi Kleen <a...@linux.intel.com>

---
tools/perf/perf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6.32-ak/tools/perf/perf.c
===================================================================
--- linux-2.6.32-ak.orig/tools/perf/perf.c
+++ linux-2.6.32-ak/tools/perf/perf.c
@@ -441,8 +441,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.
+ *
+ * A special case is a digit option: this might be perf-versionnumber
+ * Just ignore that.
*/
- if (!prefixcmp(cmd, "perf-")) {
+ if (!prefixcmp(cmd, "perf-") && !isdigit(cmd[5])) {
cmd += 5;
argv[0] = cmd;
handle_internal_command(argc, argv);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

0 new messages