Skip to content

Commit e55f3a1

Browse files
authored
Merge pull request #3144 from madeline-underwood/perfor
Perfor reviewed
2 parents 5a090a1 + 314b3b9 commit e55f3a1

5 files changed

Lines changed: 25 additions & 17 deletions

File tree

content/learning-paths/servers-and-cloud-computing/performix-mcp-agent/1-overview.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
---
2-
title: Understand Arm Performix in the Arm MCP Server
2+
title: Understand AI-driven profiling with Arm Performix MCP
33
weight: 2
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9+
## Why AI-driven profiling with Arm Performix
10+
11+
The Arm MCP Server exposes Arm Performix as a first-class tool that AI coding assistants can invoke directly. Rather than switching between your IDE and the Performix GUI to analyze results and then back again to apply code changes, an AI agent can orchestrate the entire profiling pipeline — configuring the recipe, launching the collection run, retrieving hotspot data, and proposing optimizations — all in a single agentic workflow.
12+
913
## What is the Arm Performix tool in the MCP Server?
1014

11-
The Arm MCP Server exposes Arm Performix as a first-class tool that AI coding assistants can invoke directly. Arm Performix is a performance profiling tool that simplifies the workflow of collecting CPU samples, building flame graphs, and identifying the functions that dominate application runtime. When integrated into the MCP server, it lets an AI agent orchestrate the entire profiling pipeline — configuring the recipe, launching the collection run, and retrieving the resulting hotspot data — without manual interaction with the Performix engine.
15+
Arm Performix is a performance profiling tool that simplifies the workflow of collecting CPU samples, building flame graphs, and identifying the functions that dominate application runtime. When integrated into the MCP server, it lets an AI agent orchestrate the entire profiling pipeline — configuring the recipe, launching the collection run, and retrieving the resulting hotspot data — without manual interaction with the Performix engine.
1216

13-
This removes a context switch for profiling. Rather than switching between your IDE and the Performix GUI to analyze results and then back again to apply code changes, an AI agent can do all of this for you in a single agentic workflow.
17+
Context switching for profiling is removed. Rather than switching between your IDE and the Performix GUI to analyze results and then back again to apply code changes, an AI agent can do all of this for you in a single agentic workflow.
1418

1519
## How the MCP tool works
1620

@@ -32,7 +36,7 @@ You can ask your AI assistant direct questions and it will invoke the `apx_recip
3236
Run the Code Hotspots recipe on /home/ec2-user/Mandelbrot-Example/build/mandelbrot_single_thread_debug and tell me which functions are the hottest
3337
```
3438

35-
This is useful for quick, exploratory checks. It works well when you already know the binary path and just want a fast hotspot summary before committing to deeper analysis.
39+
Direct chat is useful for quick, exploratory checks. It works well when you already know the binary path and just want a fast hotspot summary before committing to deeper analysis.
3640

3741
### Prompt files
3842

content/learning-paths/servers-and-cloud-computing/performix-mcp-agent/2-setup.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
---
2-
title: Build the example application and configure the target
2+
title: Build the Mandelbrot example on Arm Neoverse
33
weight: 3
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9+
## Prepare the profiling target
10+
11+
In this section, you'll build the Mandelbrot C++ application on your remote Arm server and confirm that Arm Performix can reach the target.
12+
913
## About the example application
1014

1115
This Learning Path profiles the same Mandelbrot C++ application used in the [Find code hotspots with Arm Performix](/learning-paths/servers-and-cloud-computing/cpu_hotspot_performix/) Learning Path. It generates a 1920×1080 bitmap of the Mandelbrot set by iterating a simple recurrence for each pixel and is compute-heavy enough to produce clear profiling signal without requiring a long-running workload. The single-threaded build is intentionally unoptimized so that the hotspot analysis surfaces a meaningful target for improvement.
1216

13-
You don't need to understand the Mandelbrot algorithm to follow this Learning Path. It's used here as a convenient, reproducible benchmark for profiling on Arm Neoverse.
17+
You don't need to understand the Mandelbrot algorithm to follow this Learning Path.
1418

1519
## Connect to your Arm target
1620

17-
This Learning Path targets an AWS Graviton3 metal instance (`m7g.metal`) with 64 Neoverse V1 cores. Any Arm Linux server with multiple cores works for the parallelization step, but a metal instance gives you direct access to all hardware threads without the overhead of virtualization.
21+
For profiling, the Learning Path targets an AWS Graviton3 metal instance (`m7g.metal`) with 64 Neoverse V1 cores. Any Arm Linux server with multiple cores works for the parallelization step, but a metal instance gives you direct access to all hardware threads without the overhead of virtualization.
1822

1923
You connect to the remote target via SSH through the Arm MCP Server. The `apx_recipe_run` tool accepts the target host IP address and SSH username directly as parameters, so there is no separate target configuration step required. Ensure your remote Arm server is reachable over SSH from the machine running your AI coding assistant, and follow the [Configure your MCP client](https://github.com/arm/mcp?tab=readme-ov-file#2-configure-your-mcp-client) instructions in the Arm MCP Server repository before continuing.
2024

@@ -36,7 +40,7 @@ cd Mandelbrot-Example
3640
make single_thread DEBUG=1
3741
```
3842

39-
This produces the binary at `./build/mandelbrot_single_thread_debug`. Confirm it exists before continuing:
43+
The command produces the binary at `./build/mandelbrot_single_thread_debug`. Confirm it exists before continuing:
4044

4145
```bash
4246
ls -lh build/mandelbrot_single_thread_debug

content/learning-paths/servers-and-cloud-computing/performix-mcp-agent/3-run-hotspot.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
---
2-
title: Run the Code Hotspots recipe using a GitHub Copilot agent
2+
title: Run Code Hotspots with an AI agent
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9+
## Execute profiling through the Arm MCP Server
10+
11+
In this section, you'll use a GitHub Copilot prompt file to drive the Code Hotspots recipe through the Arm MCP Server. The agent confirms your target details, runs the recipe autonomously, and returns structured profiling results.
12+
913
## Use the Arm MCP performance-beginner prompt file
1014

1115
{{% notice Note %}}
12-
This section uses Visual Studio Code with GitHub Copilot. If you prefer a different AI assistant, see [Configure other AI agents](#configure-other-ai-agents) at the end of this section for equivalent configurations for Kiro and OpenAI Codex.
16+
The section uses Visual Studio Code with GitHub Copilot. If you prefer a different AI assistant, see [Configure other AI agents](#configure-other-ai-agents) at the end of this section for equivalent configurations for Kiro and OpenAI Codex.
1317
{{% /notice %}}
1418

1519
The Arm MCP Server repository includes a ready-made prompt file called `performance-beginner` that guides an AI agent through the full Code Hotspots workflow: baseline profiling, hotspot identification, targeted code changes, and re-profiling to confirm the improvement. You don't need to write this file yourself, you copy it from the repository.

content/learning-paths/servers-and-cloud-computing/performix-mcp-agent/4-optimize.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: Apply optimizations and verify improvements
2+
title: Optimize code with AI-driven profiling feedback
33
weight: 5
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Apply the agent's proposed optimizations
9+
## Apply AI-suggested optimizations
1010

1111
In the previous section, the agent identified three optimization opportunities:
1212

@@ -47,7 +47,7 @@ The fix is to replace `std::complex<double>` in `getIterations` with plain `doub
4747
$$re_{new} = re_z^2 - im_z^2 + re_c$$
4848
$$im_{new} = 2 \cdot re_z \cdot im_z + im_c$$
4949

50-
This eliminates every `std::complex` method call from the inner loop. If the agent hasn't already proposed this change, use the following prompt to direct it:
50+
The fix eliminates every `std::complex` method call from the inner loop. If the agent hasn't already proposed this change, use the following prompt to direct it:
5151

5252
```text
5353
On the remote server, rewrite the getIterations function in

content/learning-paths/servers-and-cloud-computing/performix-mcp-agent/_index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
---
22
title: Identify code hotspots using Arm Performix through the Arm MCP Server
33

4-
draft: true
5-
cascade:
6-
draft: true
7-
84
description: Learn how to use an AI agent and the Performix tool through the Arm MCP Server to run the Code Hotspots recipe on a C++ application, interpret flame graph results, and apply targeted optimizations on Arm Neoverse.
95

106
minutes_to_complete: 30

0 commit comments

Comments
 (0)