Re: [PATCH] perf data: export to JSON
From: Nicholas Fraser
Date: Wed Mar 31 2021 - 06:39:20 EST
Hi Jiri,
Thanks for the review. I've addressed your suggestions; some notes are
below. I'll send a new patch.
On 2021-03-24 2:20 p.m., Jiri Olsa wrote:
> On Wed, Mar 24, 2021 at 09:06:50AM -0400, Nicholas Fraser wrote:
>> [...] We use this to import the data into a tool on Windows
>> where integrating perf or libbabeltrace is impractical.
>
> hi,
> exciting ;-) and curious, which tool is that?
>
The tool is called gpuvis. The perf JSON parsing support is here:
https://github.com/ludocode/gpuvis
The idea is to be able to line up samples from perf with GPU trace events, so
you can do things like timebox all perf samples in a particular frame of
rendering.
> we already have zstd support compiled in for compressing samples,
> should be easy to use it for compressing the output of this right
> away
This would require that apps that consume this integrate zstd as well. It's
simpler (both conceptually and from an integration standpoint) to just compress
on command-line if you need with whatever compressor you want. You can even do
this inline by writing to /dev/stdout, e.g.:
perf data convert --to-json /dev/stdout --force | zstd > out.json.zstd
Since we're transferring to Windows, more likely we'd output the JSON and then
put it in a .zip container.
> I understand not supporting opts.all or opts.tod, but 'force'
> support means just assigning 'force' to struct perf_data
It's not clear to me what 'force' does on 'struct perf_data' since we're only
reading it. I assumed for data export it meant the output file should be
overwritten. I've made it do both in the replacement patch.
Nick