linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: acme@kernel.org, jolsa@kernel.org,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH v3 04/11] perf tools report: Parse time quantum
Date: Mon, 4 Mar 2019 15:49:04 +0100	[thread overview]
Message-ID: <20190304144904.GM30476@krava> (raw)
In-Reply-To: <20190228183550.14126-5-andi@firstfloor.org>

On Thu, Feb 28, 2019 at 10:35:43AM -0800, Andi Kleen wrote:

SNIP

> +static int
> +parse_time_quantum(const struct option *opt, const char *arg,
> +		   int unset __maybe_unused)
> +{
> +	unsigned long *time_q = opt->value;
> +	char *end;
> +
> +	*time_q = strtoul(arg, &end, 0);
> +	if (end == arg)
> +		goto parse_err;
> +	if (*time_q == 0) {
> +		pr_err("time quantum cannot be 0");
> +		return -1;
> +	}
> +	while (isspace(*end))
> +		end++;
> +	if (*end == 0)
> +		return 0;
> +	if (!strcmp(end, "s")) {
> +		*time_q *= 1000000000;
> +		return 0;
> +	}
> +	if (!strcmp(end, "ms")) {
> +		*time_q *= 1000000;
> +		return 0;
> +	}
> +	if (!strcmp(end, "us")) {
> +		*time_q *= 1000;
> +		return 0;
> +	}
> +	if (!strcmp(end, "ns"))
> +		return 0;
> +parse_err:
> +	pr_err("Cannot parse time quantum `%s'\n", arg);
> +	return -1;
> +}
> +
>  int
>  report_parse_ignore_callees_opt(const struct option *opt __maybe_unused,
>  				const char *arg, int unset __maybe_unused)
> @@ -1148,6 +1186,9 @@ int cmd_report(int argc, const char **argv)
>  		     "Set percent type local/global-period/hits",
>  		     annotate_parse_percent_type),
>  	OPT_BOOLEAN(0, "ns", &symbol_conf.nanosecs, "Show times in nanosecs"),
> +	OPT_CALLBACK(0, "time-quantum", &symbol_conf.time_quantum, "time (ms|us|ns)",

missing 's' unit in ()

jirka

  reply	other threads:[~2019-03-04 14:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-28 18:35 Support sample context in perf report Andi Kleen
2019-02-28 18:35 ` [PATCH v3 01/11] perf tools: Add utility function to fetch executable Andi Kleen
2019-03-04 14:48   ` Jiri Olsa
2019-02-28 18:35 ` [PATCH v3 02/11] perf tools script: Support insn output for normal samples Andi Kleen
2019-03-04 14:48   ` Jiri Olsa
2019-03-04 18:14     ` Andi Kleen
2019-02-28 18:35 ` [PATCH v3 03/11] perf tools report: Support nano seconds Andi Kleen
2019-02-28 18:35 ` [PATCH v3 04/11] perf tools report: Parse time quantum Andi Kleen
2019-03-04 14:49   ` Jiri Olsa [this message]
2019-02-28 18:35 ` [PATCH v3 05/11] perf tools report: Support time sort key Andi Kleen
2019-02-28 18:35 ` [PATCH v3 06/11] perf tools report: Use less for scripts output Andi Kleen
2019-02-28 18:35 ` [PATCH v3 07/11] perf tools report: Support running scripts for current time range Andi Kleen
2019-03-04 14:48   ` Jiri Olsa
2019-02-28 18:35 ` [PATCH v3 08/11] perf tools report: Support builtin perf script in scripts menu Andi Kleen
2019-02-28 18:35 ` [PATCH v3 09/11] perf tools: Add utility function to print ns time stamps Andi Kleen
2019-02-28 18:35 ` [PATCH v3 10/11] perf tools report: Implement browsing of individual samples Andi Kleen
2019-03-04 14:47   ` Jiri Olsa
2019-03-04 14:48   ` Jiri Olsa
2019-03-04 14:48   ` Jiri Olsa
2019-03-04 18:13     ` Andi Kleen
2019-03-04 15:27   ` Jiri Olsa
2019-02-28 18:35 ` [PATCH v3 11/11] perf tools: Add some new tips describing the new options Andi Kleen

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=20190304144904.GM30476@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=andi@firstfloor.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).