Re: [PATCH] perf session: Dump PERF_RECORD_TIME_CONV event

From: Leo Yan
Date: Sat Apr 10 2021 - 10:57:49 EST


Hi Adrian,

On Sat, Apr 10, 2021 at 11:46:10AM +0300, Adrian Hunter wrote:

[...]

> Hi Leo
>
> I think there might be some more work related to this.
>
> Pedantically, shouldn't you cater for backward compatibility and
> not assume the following were in the perf.data file:
>
> __u64 time_cycles;
> __u64 time_mask;
> bool cap_user_time_zero;
> bool cap_user_time_short;
>
> That means checking the event size.
>
> Also PERF_RECORD_TIME_CONV should have its own byte-swapper instead of
> perf_event__all64_swap() - also checking event size.
>
> i.e. fixes for:
>
> commit d110162cafc80dad0622cfd40f3113aebb77e1bb
> Author: Leo Yan <leo.yan@xxxxxxxxxx>
> Date: Mon Sep 14 19:53:09 2020 +0800
>
> perf tsc: Support cap_user_time_short for event TIME_CONV

Indeed! IIUC, should have three fixes with event size checking:

- One fix for dumping TIME_CONV event;
- One fix for byte-swapper (especially for bool values);
- One fix for commit d110162cafc80dad0622cfd40f3113aebb77e1bb;

Will follow up for the suggestions. Thanks a lot for your insight
review.

Leo