sudara / melatonin_perfetto

Use google's perfetto performance tracing in JUCE plugins and apps
38 stars 8 forks source link

Explicit Linux Support #22

Open sudara opened 10 months ago

sudara commented 10 months ago

See: https://forum.juce.com/t/new-module-profile-your-juce-ui-dsp-performance-with-perfetto/54589/56?u=sudara

sudara commented 10 months ago

@psemiletov Can you let me know which location is best for you? What do you think a good default folder for the trace files is?

If you want to get it working before this issue is fixed, see the juce internals for how userHomeDirectory is resolved, you might need to make a Downloads folder there and then that should work?...

https://github.com/juce-framework/JUCE/blob/master/modules/juce_core/native/juce_Files_linux.cpp#L107-L115

psemiletov commented 10 months ago

Hello! The location does not matter (but, for example it can be userDocumentsDirectory /from JUCE File File::getSpecialLocation (const SpecialLocationType type)/, the important thing to produce trace file at all, and would be fine to know from the documentation where to find such file and what is file's name. When I ran my plugin with profiler, I saw profiler's messages at console, but can't find a file :(

sudara commented 10 months ago

@psemiletov

Thanks! I'll move it to userDocumentsDirectory for now, there's a couple commits on the linux branch.

The name and location of the file are written to cout when the application is gracefully quit.

Please note that no file is written if you just kill the process (like hitting stop in an IDE).

I'll get tests on linux running in a branch to clear things up.

sudara commented 10 months ago

For me, the following is logged to cout:

Wrote perfetto trace to: /Users/sudara/Downloads/perfetto-DEBUG-2023-09-10_1937.pftrace
psemiletov commented 10 months ago

When you merge it to main branch I'll be able to try it from Drumlabooh cmake build :)

sudara commented 10 months ago

Looks like there are some build issues in CI that I will have to come back to look at.

In the meantime, you can check cout to see where it's being written or run off the branch.

TheOnlyJoey commented 4 months ago

Any updates on this? Also willing to look into this if @sudara does not have the time a the moment

sudara commented 4 months ago

@TheOnlyJoey Hey hey! I'm just back from vacation — if you are motivated, I'd say go for it! It shouldn't be too tough, it's more about getting things happy in CI, hopefully perfetto itself is happy on linux?...