[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190312111424.GC24700@krava>
Date: Tue, 12 Mar 2019 12:14:24 +0100
From: Jiri Olsa <jolsa@...hat.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: acme@...nel.org, jolsa@...nel.org,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 1/3] perf, tools, report: Handle samples without time
On Mon, Mar 11, 2019 at 08:52:22PM -0700, Andi Kleen wrote:
> From: Andi Kleen <ak@...ux.intel.com>
>
> When a sample doesn't have a time stamp (e.g. from --no-time),
> show the beginning of the trace for res samples instead of generating
> an impossible time range that errors out.
>
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
Acked-by: Jiri Olsa <jolsa@...nel.org>
thanks,
jirka
> ---
> tools/perf/ui/browsers/res_sample.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/ui/browsers/res_sample.c b/tools/perf/ui/browsers/res_sample.c
> index c0dd73176d42..c450a3536f10 100644
> --- a/tools/perf/ui/browsers/res_sample.c
> +++ b/tools/perf/ui/browsers/res_sample.c
> @@ -60,7 +60,9 @@ int res_sample_browse(struct res_sample *res_samples, int num_res,
> return -1;
> r = &res_samples[choice];
>
> - n = timestamp__scnprintf_nsec(r->time - context_len, trange, sizeof trange);
> + n = timestamp__scnprintf_nsec(r->time > context_len ?
> + r->time - context_len : r->time,
> + trange, sizeof trange);
> trange[n++] = ',';
> timestamp__scnprintf_nsec(r->time + context_len, trange + n, sizeof trange - n);
>
> --
> 2.20.1
>
Powered by blists - more mailing lists