[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181008174212.GR3541@kernel.org>
Date: Mon, 8 Oct 2018 14:42:12 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Alexey Budankov <alexey.budankov@...ux.intel.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Andi Kleen <ak@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] perf record: encode -k clockid frequency into Perf
trace
Em Wed, Oct 03, 2018 at 07:57:12PM +0300, Alexey Budankov escreveu:
>
> Store -k clockid frequency into Perf trace to enable timestamps
> derived metrics conversion into wall clock time on reporting stage.
<SNIP>
> +++ b/tools/perf/util/env.h
> @@ -63,6 +63,7 @@ struct perf_env {
> struct numa_node *numa_nodes;
> struct memory_node *memory_nodes;
> unsigned long long memory_bsize;
> + size_t clockid_res_ns;
> };
>
> extern struct perf_env perf_env;
> diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
> index 1ec1d9bc2d63..4ce5339158f7 100644
> --- a/tools/perf/util/header.c
> +++ b/tools/perf/util/header.c
> @@ -1034,6 +1034,13 @@ static int write_auxtrace(struct feat_fd *ff,
> return err;
> }
>
> +static int write_clockid(struct feat_fd *ff,
> + struct perf_evlist *evlist __maybe_unused)
> +{
> + return do_write(ff, &ff->ph->env.clockid_res_ns,
> + sizeof(ff->ph->env.clockid_res_ns));
> +}
> +
Is sizeof(size_t) the same everywhere? I think you should encode this
always as a u64, read it, assign it to a temp u64 var, write the u64 to
the perf.data header, read it using do_read_u64, that will take care of
endianness, then set it to the size_t in the ff->ph->env.clockid_res_ns,
right?
I'm removing the patch till this gets sorted out,
Thanks,
- Arnaldo
Powered by blists - more mailing lists