From: Adrian Hunter <adrian.hunter@intel.com>
To: Leo Yan <leo.yan@linaro.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
Steve MacLean <Steve.MacLean@Microsoft.com>,
Yonatan Goldschmidt <yonatan.goldschmidt@granulate.io>,
Kan Liang <kan.liang@linux.intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/4] perf tool: Change fields type in perf_record_time_conv
Date: Wed, 28 Apr 2021 16:16:45 +0300 [thread overview]
Message-ID: <a3bcac42-f268-fe65-b871-3d5e3718a30b@intel.com> (raw)
In-Reply-To: <20210428120915.7123-2-leo.yan@linaro.org>
On 28/04/21 3:09 pm, Leo Yan wrote:
> C standard claims "An object declared as type _Bool is large enough to
> store the values 0 and 1", bool type size can be 1 byte or larger than
> 1 byte. Thus it's uncertian for bool type size with different
> compilers.
>
> This patch changes the bool type in structure perf_record_time_conv to
> __u8 type, and pads extra bytes for 8-byte alignment; this can give
> reliable structure size.
>
> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
> Fixes: d110162cafc8 ("perf tsc: Support cap_user_time_short for event TIME_CONV")
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> tools/lib/perf/include/perf/event.h | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/lib/perf/include/perf/event.h b/tools/lib/perf/include/perf/event.h
> index d82054225fcc..48583e441d9b 100644
> --- a/tools/lib/perf/include/perf/event.h
> +++ b/tools/lib/perf/include/perf/event.h
> @@ -346,8 +346,9 @@ struct perf_record_time_conv {
> __u64 time_zero;
> __u64 time_cycles;
> __u64 time_mask;
> - bool cap_user_time_zero;
> - bool cap_user_time_short;
> + __u8 cap_user_time_zero;
> + __u8 cap_user_time_short;
> + __u8 reserved[6]; /* For alignment */
> };
>
> struct perf_record_header_feature {
>
next prev parent reply other threads:[~2021-04-28 13:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-28 12:09 [PATCH v3 0/4] perf: Allow TIME_CONV to be backwards-compatible and dump it Leo Yan
2021-04-28 12:09 ` [PATCH v3 1/4] perf tool: Change fields type in perf_record_time_conv Leo Yan
2021-04-28 13:16 ` Adrian Hunter [this message]
2021-04-28 12:09 ` [PATCH v3 2/4] perf jit: Let convert_timestamp() to be backwards-compatible Leo Yan
2021-04-28 12:09 ` [PATCH v3 3/4] perf session: Add swap operation for event TIME_CONV Leo Yan
2021-04-28 14:43 ` Adrian Hunter
2021-04-28 12:09 ` [PATCH v3 4/4] perf session: Dump PERF_RECORD_TIME_CONV event Leo Yan
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=a3bcac42-f268-fe65-b871-3d5e3718a30b@intel.com \
--to=adrian.hunter@intel.com \
--cc=Steve.MacLean@Microsoft.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=gustavoars@kernel.org \
--cc=jolsa@redhat.com \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=yonatan.goldschmidt@granulate.io \
/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
all inboxes | Powered by JetHome®