public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Andi Kleen <ak@linux.intel.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] perf record: encode -k clockid frequency into Perf trace
Date: Mon, 8 Oct 2018 14:42:12 -0300	[thread overview]
Message-ID: <20181008174212.GR3541@kernel.org> (raw)
In-Reply-To: <4f558425-b420-d99c-ff19-8f91e8ed5302@linux.intel.com>

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

  parent reply	other threads:[~2018-10-08 17:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-03 16:57 [PATCH v3] perf record: encode -k clockid frequency into Perf trace Alexey Budankov
2018-10-04 12:36 ` Jiri Olsa
2018-10-06 11:51   ` Arnaldo Carvalho de Melo
2018-10-06 13:14     ` Alexey Budankov
2018-10-08 17:37       ` Arnaldo Carvalho de Melo
2018-10-04 15:27 ` Arnaldo Carvalho de Melo
2018-10-04 16:13   ` Alexey Budankov
2018-10-08 17:42 ` Arnaldo Carvalho de Melo [this message]
2018-10-08 18:13   ` Alexey Budankov

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=20181008174212.GR3541@kernel.org \
    --to=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexey.budankov@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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