Hi Wyatt,
Thanks for reaching out!
This is indeed very weird. I don't think we've ever seen anything like this before on any of Android, Chrome or any other embedder of the SDK in or out of Google.
So one thing I notice in your code which concerns me a little bit: I see you are doing some sort of "merging of traces" by concatenating n different traces together. I cannot quite piece together from the code how exactly/why exactly you do this. Can you please add a bit more colour there? I suspect it has something to do with that and the inlining thing might be a bit of a red herring.
Specifically I'm interested in the following:
1) Are you collecting n instances of the trace in parallel on different threads? If so, why? Why not use the fact that Perfetto can collect data across the whole process with a single tracing session?
2) Does the problem repro if you only run the trace at a time and open just that trace?
FWIW, doing `cat *.trace > out.trace` is actually an unspecified behaviour in most contexts. It's one of those things which works *most* of the time but it's not actually supported (except in special contexts where we can say for sure this is safe). Definitely taking SDK collected traces and merging them in that way is *not* defined behaviour.,
The "official" way to merge traces is given by
https://github.com/google/perfetto/issues/1018. There's currently an experimental implementation of it in the tree and I hope to stabilize it by the end of the year. But there are already instructions there to try it out and I'll give you some secret instruction: the supported "programatic" way to merge traces will be to zip or tar the traces into a file and open that.
Hope this helps! Looking forward to hearing from you.
Best,
Lalit