mit einem Klick
perfetto-tracing
// Guides the capture and optimization of Perfetto traces in benchmarks. Invoke when the user wants to trace performance, analyze bottlenecks, or generate pftrace files.
// Guides the capture and optimization of Perfetto traces in benchmarks. Invoke when the user wants to trace performance, analyze bottlenecks, or generate pftrace files.
Check and fix coding style for C++/Obj-C++ and CMake files using the unified code_format_check.py script. Use when you need to verify code formatting before git commit or want to automatically format changed files according to project style guidelines.
Build and run Skity unit tests with CMake and gtest filtering, including automatic failed-test extraction and machine-readable JSON output. Use when validating specific test suites or running minimal relevant regression tests after code changes.
| name | perfetto-tracing |
| description | Guides the capture and optimization of Perfetto traces in benchmarks. Invoke when the user wants to trace performance, analyze bottlenecks, or generate pftrace files. |
This skill provides instructions on how to enable, capture, and optimize Perfetto tracing for benchmarks in the Skity project. Future agents can rely on this skill to properly configure and run benchmarks when performance tracing is required.
The Perfetto SDK is integrated via a CMake option. By default, it is turned OFF to ensure zero overhead.
-DSKITY_BENCH_ENABLE_PERFETTO=ON to CMake when configuring the project../test/bench/skity_hw_render_bench).output/hw_benchmarks.pftrace..pftrace file into it.skity_hw_bench.main_bench_thread.Tiger_2000_Metal_MSAA).Iteration_N.This skill should be invoked when:
When dealing with long-running benchmarks or many iterations, trace buffers can easily overflow, resulting in massive trace files or data loss. Use the following strategies to restrict the scope:
Do not run all benchmarks at once. Use the Google Benchmark filter to isolate the target:
./test/bench/skity_hw_render_bench --benchmark_filter="^TargetBenchmarkName$"
Restrict the benchmark iterations to prevent excessive duplicate events from flooding the trace buffer:
./test/bench/skity_hw_render_bench --benchmark_filter="^TargetBenchmarkName$" --benchmark_min_time=0.1
(Alternatively, use --benchmark_repetitions=1 if supported).
If the trace is still too large or losing data, check the perfetto::TraceConfig in the StartPerfettoSession() function of hw_benchmarks.cc.
1024 * 1024 for 1GB).DISCARD instead of RING_BUFFER when internal Skity tracing is enabled. This prevents overwriting the initial metadata (string mappings), which would cause "sequences dropped" errors in the UI.tracing_session->FlushBlocking() before stopping the session.Skity internal events are tracked under the "skity2d" category. Ensure RegisterSkityPerfettoHandler() is correctly initialized in StartPerfettoSession() so that internal Skity function durations are captured alongside Benchmark_Draw and Target_Flush.