Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid .pftrace files generated when building MacOS Universal Binaries #24

Open
moritzsur opened this issue Oct 2, 2023 · 7 comments

Comments

@moritzsur
Copy link

Following the instructions 1:1 does not create valid .pftrace files that can be used in perfetto.
Im on Ventura 13.6 and used the FetchContent cmake method.
When starting the session, a small .pftrace file is being created that contains valid metadata, then when closing the plugin another larger file is being created which seems to contain the trace data since its size depends on the amount of playback when measuring DSP. This file does not contain valid metadata.
Both files show an empty timeline in perfetto.

I tried TRACE_COMPONENT in component paint methods and TRACE_DSP in dsp methods.

The files have a .txt suffix so that they can be uploaded to github.

perfetto-DEBUG-2023-10-02_1412.pftrace.txt
perfetto-DEBUG-2023-10-02_1411.pftrace.txt

@sudara
Copy link
Owner

sudara commented Oct 2, 2023

Hi there,

What platform are you on? The only condition I've seen where trace files are empty are when the memory needs exceed the settings, as seen in #6.

But something else seems wrong if you are getting 2 tracefiles. The write to a file should only occur at the end of a session.

I have a branch that makes this all a bit simpler (removes the singleton) — but can you confirm that MelatoninPerfetto::get().endSession(); is only in the plugin processor's destructor? (not the editor, or anywhere else)

@moritzsur
Copy link
Author

Hi, after some more testing I think the small file is only generated by some hosts when the plugin binary changes (some indexing or background testing).

The solution was to add -DCMAKE_OSX_ARCHITECTURES="x86_64" to my cmake options.

@sudara
Copy link
Owner

sudara commented Oct 2, 2023

Hi, after some more testing I think the small file is only generated by some hosts when the plugin binary changes (some indexing or background testing).

Ah, hmm, yeah I could see auval scanning (what logic runs) creating a small trace file...

The solution was to add -DCMAKE_OSX_ARCHITECTURES="x86_64" to my cmake options.

I don't understand how this could be related to your issue... Are you on macOS M1/M2? I am and don't have this set... Could you undo that one single change and verify the trace issue returns?

@moritzsur
Copy link
Author

When I remove the option the trace files are empty again.

When setting it to a universal build it shows an error:
Screenshot 2023-10-02 at 17 59 56

Here is the full command in case it helps:
-G Ninja -DCMAKE_BUILD_TYPE=Debug -DFORMATS=Standalone;VST3;AAX;AU -DCMAKE_OSX_ARCHITECTURES="x86_64" -DPERFETTO=ON -DJUCE_GLOBAL_ARA_SDK_PATH=someirrelevantpath

@sudara
Copy link
Owner

sudara commented Oct 2, 2023

Ok, thanks for helping to isolate the issue. That's very strange. I'll reopen this issue and try to reproduce.

@sudara sudara reopened this Oct 2, 2023
@sudara sudara changed the title Invalid .pftrace files generated Invalid .pftrace files generated when building MacOS Universal Binaries Oct 2, 2023
@moritzsur
Copy link
Author

Forgot to mention, yes Im on M2.
Not adding a cmake option for the architecture does not cause this error, but the trace files are still empty for me.

@sudara
Copy link
Owner

sudara commented Oct 2, 2023

Ok perfect thanks. And you are seeing good trace files when building with x86_64 locally.... curious. Currently I don't have any arch set on my M1, which should default me to the single x86_64 arch. On Sonoma here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants