Skip to content

Commit 4012285

Browse files
Merge branch 'ArmDeveloperEcosystem:main' into rasp_pi
2 parents ab1019c + 6871a6a commit 4012285

File tree

10 files changed

+225
-0
lines changed

10 files changed

+225
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Use the Arm Performance Studio Integration extension in Godot
3+
4+
draft: true
5+
cascade:
6+
draft: true
7+
8+
minutes_to_complete: 15
9+
10+
who_is_this_for: This is an introductory topic for Godot developers who are targeting Android devices and want to get more insight into how their game performs on devices with Arm CPUs and GPUs.
11+
12+
learning_objectives:
13+
- Install the Arm Performance Studio Integration extension in Godot
14+
- Annotate your Godot game with markers that give context to a profile in Arm Performance Studio tools
15+
16+
prerequisites:
17+
- Familiarity with Godot
18+
- Familiarity with Arm Performance Studio tools
19+
20+
author: Albin Bernhardsson, Julie Gaskin
21+
22+
### Tags
23+
skilllevels: Introductory
24+
subjects: Performance and Architecture
25+
armips:
26+
- Cortex-A
27+
- Mali
28+
tools_software_languages:
29+
- Godot
30+
- Arm Performance Studio
31+
operatingsystems:
32+
- Windows
33+
- macOS
34+
- Linux
35+
36+
37+
further_reading:
38+
- resource:
39+
title: Get started with Streamline
40+
link: https://developer.arm.com/documentation/102477/latest/
41+
type: documentation
42+
- resource:
43+
title: Android performance triage with Streamline
44+
link: https://developer.arm.com/documentation/102540/latest/
45+
type: documentation
46+
- resource:
47+
title: Get started with Performance Advisor
48+
link: https://developer.arm.com/documentation/102478/latest/
49+
type: documentation
50+
- resource:
51+
title: Arm Performance Studio
52+
link: https://developer.arm.com/Tools%20and%20Software/Arm%20Performance%20Studio
53+
type: website
54+
55+
56+
57+
### FIXED, DO NOT MODIFY
58+
# ================================================================================
59+
weight: 1 # _index.md always has weight of 1 to order correctly
60+
layout: "learningpathall" # All files under learning paths have this same wrapper
61+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
62+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
---
2+
title: Arm Performance Studio Godot integrations
3+
weight: 3
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Arm Performance Studio Godot integrations
10+
11+
[Arm Performance Studio](https://developer.arm.com/Tools%20and%20Software/Arm%20Performance%20Studio) is a free suite of analysis tools to help you profile game performance on mobile devices with Arm CPUs and GPUs. Arm provides a Godot extension to make data from [Godot games](https://godotengine.org/) visible in the Arm Performance Studio tools, [Streamline](https://developer.arm.com/Tools%20and%20Software/Streamline%20Performance%20Analyzer) and [Performance Advisor](https://developer.arm.com/Tools%20and%20Software/Performance%20Advisor).
12+
13+
This package provides a simple way to incorporate annotations into your Godot project. These annotations enable you to mark the timeline with events or custom counters which provides valuable context alongside the performance data in Streamline, so you can see what was happening in the game when bottlenecks occur. For example, here you can see markers that highlight where a wave of enemies is spawning:
14+
15+
![Marker annotations in Streamline](sl_annotation.png "Figure 1. Marker annotations in Streamline")
16+
17+
{{% notice Note %}}
18+
The Arm Performance Studio Integration extension is supported with Godot version 4.3 and later.
19+
{{% /notice %}}
20+
21+
### How to install the Arm Performance Studio Integration extension
22+
23+
1. In Godot, click **AssetLib** to see the available extensions.
24+
25+
2. Find the **Arm Performance Studio Integration** extension, then double-click to open the extension.
26+
27+
3. The extension opens in a dialog box. Click **Download**.
28+
29+
![Installing the Arm Performance Studio Integration extension in Godot](godot_install_performance_studio_extension.png "Figure 2. Installing the Arm Performance Studio Integration extension in Godot")
30+
31+
4. A new dialog box opens where you can change the install folder if required. Click Install.
32+
33+
### Using the extension
34+
35+
All functionality in the extension is provided by the PerformanceStudio class, so first create an instance of it:
36+
37+
```console
38+
var performance_studio = PerformanceStudio.new()
39+
```
40+
41+
### Adding single markers to a Godot project
42+
43+
The simplest annotations are single markers, which can have a name and a color. To use them in a Godot project where you have installed this extension, simply call into the Performance Studio library as follows:
44+
45+
```console
46+
performance_studio.marker("Game Started")
47+
```
48+
49+
This will emit a timestamped marker with the label "Game Started". When you capture a profile in Streamline, you can see this marker along the top of the timeline at the point that the game starts.
50+
51+
![Marker annotation in Streamline](sl_marker.png "Figure 4. Marker annotation in Streamline")
52+
53+
To give the annotation a color, use the `marker_color` method:
54+
55+
```console
56+
performance_studio.marker_color("Game Started", Color8(0, 255, 0))
57+
```
58+
59+
### Defining regions in a Godot project
60+
61+
To define regions of interest within the game, you can specify a pair of markers prefixed with “Region Start” and “Region End”, for example:
62+
63+
```console
64+
performance_studio.marker("Region Start Times Square")
65+
# Do work
66+
performance_studio.marker("Region End Times Square")
67+
```
68+
69+
These regions are shown on the frame rate analysis chart in the Performance Advisor report.
70+
71+
![Regions in Performance Advisor](pa_frame_rate_regions.png "Figure 5. Regions in Performance Advisor")
72+
73+
Also, dedicated charts for each region are appended to the end of the report, so you can analyze each region independently.
74+
75+
![Dedicated region charts in Performance Advisor](pa_dedicated_region_charts.png "Figure 6. Dedicated region charts in Performance Advisor")
76+
77+
### Using channels in a Godot project
78+
79+
Channels are custom event timelines associated with a software thread. You can create channels and place annotations within them. A channel annotation has a text label and a color but, unlike markers, they span a range of time.
80+
81+
To create a channel called "Spawner" and insert an annotation called "Spawning Wave", with the color red:
82+
83+
```console
84+
var channel : PerformanceStudio_Channel
85+
86+
func _ready() -> void:
87+
channel = performance_studio.create_channel("Spawner")
88+
89+
# Annotations can then be inserted into a channel:
90+
func _on_new_wave_started() -> void:
91+
channel.annotate_color("Spawning Wave", Color8(255, 0, 0))
92+
93+
func _on_wave_completed() -> void:
94+
channel.end()
95+
```
96+
97+
To see channels in Streamline, select the **Core Map** view, and expand the **VkThread** thread:
98+
99+
![Channel annotations in Streamline](sl_channel.png "Figure 7. Channel annotations in Streamline")
100+
101+
### Creating counters
102+
103+
Counters are numerical data points that can be plotted as a chart in the Streamline timeline view. Counters can be created as either absolute counters, where every value is an absolute value, or as a delta counter, where values are the number of instances of an event since the last value was emitted. All values are floats and will be presented to 2 decimal places.
104+
105+
When charts are first defined, you can specify a title and series name. The title names the chart, the series names the data series.
106+
107+
Multiple counter series can use the same title, which means that they will be plotted on the same chart in the Streamline timeline.
108+
109+
To create a counter:
110+
111+
```console
112+
var counter = performance_studio.create_counter("Title", "Series", false)
113+
```
114+
115+
Counter values are set easily as shown below:
116+
117+
```console
118+
counter.setValue(42.2)
119+
```
120+
121+
### Custom Activity Maps
122+
123+
[Custom Activity Map (CAM)](https://developer.arm.com/documentation/101816/latest/Annotate-your-code/User-space-annotations/Custom-Activity-Map-annotations) views allow execution information to be plotted on a hierarchical set of timelines. Like channel annotations, CAM views plot jobs on tracks, but unlike channel annotations, CAM views are not associated with a specific thread. Each CAM view contains one or more tracks and each track contains one or more jobs.
124+
125+
![Custom activity maps in Streamline](sl_cam.png "Figure 8. Custom activity maps in Streamline")
126+
127+
To create a custom activity map and add tracks to it:
128+
129+
```console
130+
var game_cam : PerformanceStudio_CAM
131+
var wave_track : PerformanceStudio_CAMTrack
132+
var ui_track : PerformanceStudio_CAMTrack
133+
134+
func _ready() -> void:
135+
# Create the CAM
136+
game_cam = performance_studio.create_cam("Game Activity")
137+
138+
# Add tracks to the CAM
139+
wave_track = game_cam.create_track("Wave Activity")
140+
ui_track = game_cam.create_track("UI Activity")
141+
```
142+
143+
To create a job within a track:
144+
145+
```console
146+
var wave_job : PerformanceStudio_CAMJob
147+
148+
func _on_new_wave_started() -> void:
149+
wave_job = wave_track.create_job("Spawning Wave", Color8(255, 0, 0))
150+
151+
func _on_wave_completed() -> void:
152+
wave_job.stop()
153+
```
154+
155+
You can now annotate your Godot game and analyze the performance with markers that give context to a profile in Arm Performance Studio tools.
140 KB
Loading
199 KB
Loading
39.1 KB
Loading
88.1 KB
Loading
79.2 KB
Loading
89.3 KB
Loading
130 KB
Loading

0 commit comments

Comments
 (0)