Merge "Avoid capturing always on tracing when generating layers trace" into main