Skip to content

SnapdragonGameStudios/Snapdragon_Profiler_Ecosystem

Repository files navigation

Snapdragon Profiler Ecosystem

A collection of tools for working with Snapdragon Profiler (SDP).

Branches

main: Primary development branch. Contributors should develop submissions based on this branch, and submit pull requests to this branch.

Available Tools

Converter

Convert SDP exported CSV trace files into Perfetto compatible JSON format for visualization and analysis. This converter supports CSV files exported from both SDP capture modes:

  • Realtime Capture Mode — Streaming/live capture sessions where metrics are recorded continuously in real time
  • Trace Capture Mode — Full trace sessions with detailed scheduling, slice, and counter data captured over a defined time window

Supported Event Types

CSV Row Type Perfetto Phase Description
System counters "ph": "C" System-level metrics (CPU frequency, GPU metrics, DSP metrics)
Process counters "ph": "C" Per-process counter values (e.g., aaRdy, GPU Rendering Pipe Metrics)
Process slices "ph": "X" Duration events with start/end timestamps
System scheduling slices "ph": "X" Kernel scheduling events (e.g., Sched CPU)
Metadata "ph": "M" Auto-generated process_name and thread_name labels

RenderStage Splitter

Split GPU RenderStage events in a Perfetto .pftrace by process. The tool reads a Perfetto trace, extracts GpuRenderStageEvent packets, resolves each event to a process when possible, and writes an augmented .pftrace with separate RenderStage tracks per process for easier analysis in Perfetto UI.

The tool also includes a debug mode that scans the input trace and prints packet, process, track, and RenderStage diagnostics.

Installation Instructions

# Install uv (if not already installed)
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Sync the project (creates virtual environment and installs dependencies)
uv sync

Usage

All tools are accessible through the unified main.py entry point:

# Show available tools
uv run main.py --help

# Run a specific tool (e.g., converter)
uv run main.py converter <tool-specific arguments ...>

# Run the RenderStage splitter
uv run main.py split-renderstage <input.pftrace> <output.pftrace>

Converter Examples

# Single file (output: trace1.json)
uv run main.py converter trace1.csv

# Single file with custom output name
uv run main.py converter trace1.csv -o custom_output.json

# Multiple files (each gets its own .json: trace1.json, trace2.json, trace3.json)
uv run main.py converter trace1.csv trace2.csv trace3.csv

# All CSV files in the current directory
uv run main.py converter *.csv

# Output to a specific directory
uv run main.py converter *.csv --output-dir ./output/

You can also invoke the converter directly (bypassing the dispatcher):

uv run python -m tools.converter.convert_sdp_csv_to_perfetto_json trace1.csv

RenderStage Splitter Examples

# Split GPU RenderStage events into process-specific tracks
uv run main.py split-renderstage input.pftrace output.pftrace

# Inspect trace contents without writing an output file
uv run main.py split-renderstage --debug input.pftrace

You can also invoke the RenderStage splitter directly (bypassing the dispatcher):

uv run python -m tools.converter.split_renderstage_by_process input.pftrace output.pftrace

# Or use the uv-installed console script
uv run split-renderstage-by-process input.pftrace output.pftrace

Development

To contribute new features or fixes, please see CONTRIBUTING.md for guidelines on branching, submitting pull requests, and coding standards.

# Clone the repository
git clone https://github.com/SnapdragonGameStudios/Snapdragon_Profiler_Ecosystem.git
cd Snapdragon_Profiler_Ecosystem

# Sync the project (creates virtual environment and installs dev dependencies)
uv sync

Testing

The project includes a comprehensive test suite using pytest.

# Run all tests
uv run pytest

# Run tests with verbose output
uv run pytest -v

# Run a specific test class
uv run pytest tests/test_convert_sdp_csv_to_perfetto_json.py::TestExampleCSV -v

Getting in Contact

License

Snapdragon Profiler Ecosystem is licensed under the BSD-3-clause License. See LICENSE.txt for the full license text.

About

A collection of tools for snapdragon profiler

Resources

License

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages