mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Erdem Aktas <eaktas1@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>
Subject: [patch] perf_counter : breaking parameter parsing when the command is  reached
Date: Mon, 6 Jul 2009 01:44:35 -0400	[thread overview]
Message-ID: <3fee128b0907052244n1c5fe000me5ca087918f6fa41@mail.gmail.com> (raw)

    Once the perf parameter parser reaches a non-parameter word, that means
    the command is already found and the rest of the string is the parameter
    of this command so no need to parse more.

    As an example, when we want to run
    perf stat -- ls -al
    it is obvious that the -al is the parameter of the ls command, so we
    should able to run this like
    perf stat ls -al

    Signed-off-by: eaktas <eaktas1@gmail.com>

diff --git a/tools/perf/util/parse-options.c b/tools/perf/util/parse-options.c
index 1bf6719..4ad4962 100644
--- a/tools/perf/util/parse-options.c
+++ b/tools/perf/util/parse-options.c
@@ -284,6 +284,11 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
 			if (ctx->flags & PARSE_OPT_STOP_AT_NON_OPTION)
 				break;
 			ctx->out[ctx->cpidx++] = ctx->argv[0];
+			while (--(ctx->argc)) {
+				ctx->argv++;
+				ctx->out[ctx->cpidx++] = ctx->argv[0];
+			}
+			ctx->argc++;
 			continue;
 		}

             reply	other threads:[~2009-07-06  5:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-06  5:44 Erdem Aktas [this message]
2009-07-10  9:14 ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3fee128b0907052244n1c5fe000me5ca087918f6fa41@mail.gmail.com \
    --to=eaktas1@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®