[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200803113127.GD139381@krava>
Date: Mon, 3 Aug 2020 13:31:27 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Jiri Olsa <jolsa@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
lkml <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Michael Petlan <mpetlan@...hat.com>,
Ian Rogers <irogers@...gle.com>,
Andi Kleen <ak@...ux.intel.com>,
David Ahern <dsahern@...il.com>,
Geneviève Bastien <gbastien@...satic.net>,
Wang Nan <wangnan0@...wei.com>,
Jeremie Galarneau <jgalar@...icios.com>
Subject: Re: [PATCH 4/6] perf tools: Add support to store time of day in CTF
data conversion
On Mon, Aug 03, 2020 at 01:00:12PM +0900, Namhyung Kim wrote:
> On Thu, Jul 30, 2020 at 11:39:48PM +0200, Jiri Olsa wrote:
> > Adding support to convert and store time of day in CTF
> > data conversion for 'perf data convert' subcommand.
> >
> > The perf.data used for conversion needs to have clock data
> > information - must be recorded with -k/--clockid option).
> >
> > New --tod option is added to 'perf data convert' subcommand
> > to convert data with timestamps converted to wall clock time.
> >
> > Record data with clockid set:
> > # perf record -k CLOCK_MONOTONIC kill
> > kill: not enough arguments
> > [ perf record: Woken up 1 times to write data ]
> > [ perf record: Captured and wrote 0.033 MB perf.data (8 samples) ]
> >
> > Convert data with TOD timestamps:
> > # perf data convert --tod --to-ctf ./ctf
> > [ perf data convert: Converted 'perf.data' into CTF data './ctf' ]
> > [ perf data convert: Converted and wrote 0.000 MB (8 samples) ]
> >
> > Display data in perf script:
> > # perf script -F+tod --ns
> > perf 262150 2020-07-13 18:38:50.097678523 153633.958246159: 1 cycles: ...
> > perf 262150 2020-07-13 18:38:50.097682941 153633.958250577: 1 cycles: ...
> > perf 262150 2020-07-13 18:38:50.097684997 153633.958252633: 7 cycles: ...
> > ...
>
> I believe this belongs to a later patch.
I wanted to show in changelog that the timestamps match
for both script and data convert tools
jirka
>
> Thanks
> Namhyung
>
> >
> > Display data in babeltrace:
> > # babeltrace --clock-date ./ctf
> > [2020-07-13 18:38:50.097678523] (+?.?????????) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ...
> > [2020-07-13 18:38:50.097682941] (+0.000004418) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ...
> > [2020-07-13 18:38:50.097684997] (+0.000002056) cycles: { cpu_id = 0 }, { perf_ip = 0xFFF ...
> > ...
> >
> > It's available only for recording with clockid specified,
> > because it's the only case where we can get reference time
> > to wallclock time. It's can't do that with perf clock yet.
> >
> > Error is display if you want to use --tod on data without
> > clockid specified:
> >
> > # perf data convert --tod --to-ctf ./ctf
> > Can't provide --tod time, missing clock data. Please record with -k/--clockid option.
> > Failed to setup CTF writer.
> > Error during conversion setup.
> >
> > Signed-off-by: Jiri Olsa <jolsa@...nel.org>
> > ---
> > tools/perf/Documentation/perf-data.txt | 3 ++
> > tools/perf/builtin-data.c | 1 +
> > tools/perf/util/data-convert-bt.c | 56 +++++++++++++++++---------
> > tools/perf/util/data-convert.h | 1 +
> > 4 files changed, 41 insertions(+), 20 deletions(-)
>
Powered by blists - more mailing lists