Re: [PATCH] perf data: export to JSON

From: Jiri Olsa
Date: Thu Apr 01 2021 - 13:44:03 EST


On Wed, Mar 31, 2021 at 06:38:16AM -0400, Nicholas Fraser wrote:
> 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.

I recall you did not add support for walltime clock,
don't you need it to sync with other events?

>
>
> > 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.
>
>

ok

> > 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.
>

it tells perf to skip ownership validation, perf will not
open other user data file if it's not forced

jirka