firefox-devtools / firefox-devtools/profiler
When importing perf profiles with headers, import the profile capture time into the profile
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
From #3550:
> When running
>
> ```
> perf script --header
> ```
>
> Perf sometimes outputs headers, that look like:
>
> ```
> # ========
> # captured on : Mon Aug 30 11:15:28 2021
> # header version : 1
> # data offset : 336
> # data size : 31672
> # feat offset : 32008
> # hostname : markhansen
> # os release : 5.10.40-amd64
> ```
Our profile format has a spot to store the recording start timestamp, in `profile.meta.startTime`. The perf importer [stores the timestamp of the first sample](https://github.com/firefox-devtools/profiler/blob/cdb575ded9fa3d8e83c4231d8889052e1a7bee8f/src/profile-logic/import/linux-perf.js#L334) there, but I think that timestamp is not a unix timestamp and instead is relative to the system boot time.
As a result, profiles from the perf importer look like they were captured in 1970: https://share.firefox.dev/3i0gvuX
(We show this date both in the tab title and in the Profile Info panel.)
It would be great if we could parse the "captured on" timestamp and put it into `profile.meta.startTime`.
cc mhansen
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-443)
Contributor guide
Assessment
This issue has not been assessed yet.