Skip to content

Commit b7b74aa

Browse files
first pass for performix codex insights
1 parent 7803e45 commit b7b74aa

7 files changed

Lines changed: 155 additions & 139 deletions

File tree

content/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/_index.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
---
2-
title: Generate Arm Performix AI Insights in VS Code with Codex
3-
4-
draft: true
5-
cascade:
6-
draft: true
2+
title: Generate Arm Performix AI insights in Visual Studio Code with Codex
73

84
description: Configure the Arm Performix MCP server for Codex in Visual Studio Code and use profile evidence to generate and validate AI Insights.
95

@@ -18,7 +14,7 @@ learning_objectives:
1814
- Generate an AI Insight and validate its recommendations against profile evidence.
1915

2016
prerequisites:
21-
- Arm Performix version 2026.2.5 or later installed. See the [Arm Performix install guide](/install-guides/performix/) for installation and target setup instructions.
17+
- Arm Performix version 2026.2.5 or later installed. For installation and target setup instructions, see the [Arm Performix install guide](/install-guides/performix/).
2218
- Visual Studio Code with the Codex extension installed.
2319
- Access to Codex through ChatGPT sign-in, or an organization-approved OpenAI API key provided through the `OPENAI_API_KEY` environment variable.
2420
- Permission from your organization to share profile data, symbols, source excerpts, disassembly excerpts, and performance metrics with Codex.

content/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/configure_mcp_codex.md

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ layout: learningpathall
99
---
1010
## Choose a configuration method
1111

12-
Codex CLI and the Codex extension share MCP configuration on the same host. Choose one of these methods:
12+
Codex CLI and the Codex extension share MCP configuration on the same host. Choose one of the following methods:
1313

1414
- Use the Codex extension settings.
1515
- Run `codex mcp add` in a terminal.
1616
- Edit `~/.codex/config.toml`.
1717

18-
You only need to complete one method. The MCP server is a local standard input/output (STDIO) process started by the `apx` executable.
18+
You need to complete only one method. The MCP server is a local standard input and output (STDIO) process started by the `apx` executable.
1919

2020
{{% notice Note %}}
21-
Configure the server on the host where Codex runs. In a local VS Code session, this is your development computer. In a remote development session, confirm which host runs the Codex extension and which Arm Performix data directory it uses.
21+
Configure the server on the host where Codex runs. In a local Visual Studio Code (VS Code) session, this is your development computer. In a remote development session, confirm which host runs the Codex extension and which Arm Performix data directory it uses.
2222
{{% /notice %}}
2323

2424
## Configure the server in the Codex extension
2525

26-
To add the server in Visual Studio Code:
26+
To add the server in VS Code:
2727

2828
1. Open the Codex sidebar and select the gear icon.
2929
2. Select **MCP servers**, then select **Add server**.
@@ -80,9 +80,9 @@ codex mcp add arm-performix -- "/Applications/Arm Performix.app/Contents/assets/
8080

8181
Restart the Codex extension after the command completes.
8282

83-
## Configure the server in `config.toml`
83+
## Configure the server in the Codex config file
8484

85-
For direct configuration, open `~/.codex/config.toml` and add:
85+
For direct configuration, open `~/.codex/config.toml` and add the following:
8686

8787
```toml
8888
[mcp_servers.arm-performix]
@@ -92,13 +92,15 @@ args = ["mcp", "start"]
9292

9393
Replace `command` with the full path to `apx` on your host. Save the file and restart the Codex extension.
9494

95+
{{% notice Note %}}
9596
On Windows, use a TOML literal string so backslashes in the path aren't treated as escape characters:
9697

9798
```toml
9899
[mcp_servers.arm-performix]
99100
command = 'C:\Program Files\Arm Performix\assets\apx\apx.exe'
100101
args = ["mcp", "start"]
101102
```
103+
{{% /notice %}}
102104

103105
## Check that the MCP server is connected
104106

@@ -126,4 +128,74 @@ List the Arm Performix Code Hotspots runs that can be used to generate an AI Ins
126128

127129
Record the run ID you want to analyze. A run name can be changed and might not be unique, so use the run ID in later prompts.
128130

129-
You have now configured and tested the MCP connection. If no supported run is available, create a Code Hotspots run in the next section.
131+
## Troubleshoot the MCP connection
132+
133+
Use the following checks to troubleshoot issues with MCP connection:
134+
135+
### The Arm Performix MCP server isn't listed
136+
137+
Check whether Codex loaded the server configuration:
138+
139+
```bash
140+
codex mcp list
141+
```
142+
143+
Find `arm-performix` in the output. Then confirm:
144+
145+
- The command is the full path to the `apx` executable, including `apx.exe` on Windows.
146+
- The arguments are `mcp` and `start`.
147+
- The server is enabled.
148+
- You restarted the extension after changing the configuration.
149+
- You edited the configuration for the same user account and Codex host that runs the extension.
150+
151+
### The MCP server fails to start
152+
153+
Run the executable's built-in help from a terminal to separate an `apx` problem from a Codex configuration problem. Replace `<path-to-apx>` with the configured path:
154+
155+
```bash
156+
"<path-to-apx>" mcp --help
157+
```
158+
159+
If the help text doesn't appear, check the executable path, file permissions, and installed Arm Performix version. If it does appear, reopen **MCP servers** in the Codex extension and check the server status.
160+
161+
In a remote development session, make sure `apx` is installed on the Codex host and that this installation uses the expected Performix configuration and run data.
162+
163+
### Codex doesn't use Arm Performix
164+
165+
Name the server and task explicitly:
166+
167+
```text
168+
Use the Arm Performix MCP server to list the available Arm Performix runs.
169+
```
170+
171+
For a specific run:
172+
173+
```text
174+
Use Arm Performix to generate an AI Insight for run ID "<run-id>".
175+
```
176+
177+
If you have several MCP servers, an ambiguous prompt such as `give me insights` might not select Arm Performix.
178+
179+
### Code Hotspots runs are missing
180+
181+
Check:
182+
183+
- You created at least one completed Code Hotspots run.
184+
- The MCP server runs as the same user who created or imported the run.
185+
- The GUI, CLI, and MCP server use the same Arm Performix data location.
186+
- The selected run contains enough samples and profile data for analysis.
187+
- A remote Visual Studio Code environment isn't using a different home directory or Performix configuration.
188+
189+
Compare the MCP result with the CLI:
190+
191+
```bash
192+
apx run list
193+
```
194+
195+
If the CLI also returns no run, create or import a run. If the CLI returns the run but Codex doesn't, recheck which host, user, and configuration start the MCP server.
196+
197+
## What you've accomplished and what's next
198+
199+
You've now configured and tested the MCP connection.
200+
201+
Next, you'll create a Code Hotspots run if no supported run is available. If you have an available supported run, skip to [Generate Arm Performix AI insights for a Code Hotspots run](/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/generate_ai_insights/).

content/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/create_a_code_hotspots_run.md

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Create a Code Hotspots run
2+
title: Create an Arm Performix Code Hotspots run
33

44
weight: 4
55

@@ -9,16 +9,16 @@ layout: learningpathall
99
---
1010
## Prepare a representative workload
1111

12-
You can skip this section if you already selected a supported Code Hotspots run.
12+
If you already have a supported Code Hotspots run, skip to [Generate Arm Performix AI insights for a Code Hotspots run](/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/generate_ai_insights/).
1313

1414
For a new run, choose a workload that represents the behavior you want to optimize. Specify the executable with an absolute path because Performix doesn't support relative workload paths. Build it with debug symbols when possible so Performix can attribute samples to functions and source lines. Aim for at least 20 seconds of representative activity; a very short run might not collect enough samples for useful analysis.
1515

1616
Before profiling, make sure you know:
1717

18-
- The Performix target name.
19-
- The executable path and arguments on the target.
20-
- The workload's working directory and required environment variables.
21-
- Whether running the workload has side effects.
18+
- the Performix target name
19+
- the executable path and arguments on the target
20+
- the workload's working directory and required environment variables
21+
- whether running the workload has side effects
2222

2323
## Create a run with Codex
2424

@@ -36,8 +36,8 @@ Use Arm Performix to run the Code Hotspots recipe on target "<target-name>" with
3636

3737
Replace:
3838

39-
- `<target-name>` with the Performix target name returned by Codex.
40-
- `<command>` with the command that starts your workload on the target.
39+
- `<target-name>` with the Performix target name returned by Codex
40+
- `<command>` with the command that starts your workload on the target
4141

4242
For example:
4343

@@ -66,12 +66,36 @@ apx recipe run code_hotspots \
6666
--timeout 30
6767
```
6868

69-
The `--timeout 30` option limits profiling to 30 seconds; it doesn't make a short workload run longer. Use a duration that captures representative behavior. Add `--working-dir`, `--env`, or `--source` when your workload needs a specific working directory, environment variables, or host-based source mapping. For an already-running process, replace `--workload` with `--pid <process-id>`.
69+
The `--timeout 30` option limits profiling to 30 seconds and doesn't make a short workload run longer. Use a duration that captures representative behavior.
70+
71+
Add `--working-dir`, `--env`, or `--source` when your workload needs a specific working directory, environment variables, or host-based source mapping. For an already-running process, replace `--workload` with `--pid <process-id>`.
7072

7173
When collection finishes, list the saved runs:
7274

7375
```bash
7476
apx run list
7577
```
7678

77-
Confirm that the new run completed successfully and record its run ID. You now have the stable identifier Codex needs to analyze the intended profile.
79+
Confirm that the new run completed successfully and record its run ID.
80+
81+
## Troubleshoot remote target authentication
82+
83+
If remote target authentication fails, check that:
84+
85+
- SSH key-based authentication works without an interactive password prompt.
86+
- The private key doesn't require an interactive passphrase.
87+
- Passwordless `sudo` is configured for the target user.
88+
- Strict host-key checking succeeds.
89+
- `~/.ssh/known_hosts` contains the target key and each jump-node key.
90+
91+
Use the Arm Performix target test to check the configured connection independently of Codex:
92+
93+
```bash
94+
apx target test --target <target-name>
95+
```
96+
97+
## What you've accomplished and what's next
98+
99+
You've now got the stable identifier Codex needs to analyze the intended profile.
100+
101+
Next, you'll generate AI insights from a Code Hotspots run.

content/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/generate_ai_insights.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Generate AI Insights
2+
title: Generate Arm Performix AI insights for a Code Hotspots run
33

44
weight: 5
55

@@ -51,6 +51,22 @@ Which additional Performix recipe or view would distinguish between those explan
5151
What is the first optimization I should try, and why?
5252
```
5353

54+
## Improve a generic AI Insight
55+
56+
Ask for one finding and its evidence:
57+
58+
```text
59+
Focus on the highest-impact finding in run ID "<run-id>". Cite the measured evidence, distinguish hypotheses from observations, and identify the next Performix view or recipe to inspect.
60+
```
61+
62+
For a known hotspot:
63+
64+
```text
65+
For function "<function-name>" in run ID "<run-id>", summarize what Code Hotspots proves, what it doesn't prove, and which additional evidence is needed to identify the root cause.
66+
```
67+
68+
If the response remains generic, confirm that the run has enough samples, symbols, source mapping, and disassembly. Code Hotspots locates sampled CPU time; use a more specific Performix recipe when you need evidence about microarchitecture, instruction mix, or memory access.
69+
5470
## Iterate and measure
5571

5672
After you review the evidence, use a controlled optimization loop:
@@ -64,4 +80,8 @@ After you review the evidence, use a controlled optimization loop:
6480

6581
Codex can help with more of this loop if your environment exposes build, deployment, remote-execution, or source-control tools. Review proposed code changes and command approvals before Codex applies or runs them.
6682

67-
You have now generated an evidence-based hypothesis. Next, open the same run in Arm Performix to inspect the underlying profile views.
83+
## What you've accomplished and what's next
84+
85+
You've now generated an evidence-based hypothesis.
86+
87+
Next, you'll open the same run in Arm Performix to inspect the underlying profile views.

content/learning-paths/servers-and-cloud-computing/performix-agentic-dynamic-insights-codex/open-in-performix.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ Use the AI Insight to focus your investigation, not replace it. For example, if
2222

2323
For a before-and-after comparison, keep the workload, target, input, thread count, CPU affinity, and collection settings consistent. A lower sample percentage doesn't prove that a function became faster if total runtime or the surrounding workload changed.
2424

25-
You have configured the Performix MCP server, selected or created a Code Hotspots run, generated an AI Insight, and checked its recommendation against the profile. Continue with the [Arm Performix getting-started video](https://youtu.be/_eX8ZpNT0kc) to explore the graphical workflow.
25+
## What you've accomplished
26+
27+
You've now configured the Performix MCP server, selected or created a Code Hotspots run, generated an AI Insight, and checked its recommendation against the profile.
28+
29+
You can continue with the [Arm Performix getting-started video](https://youtu.be/_eX8ZpNT0kc) to explore the graphical workflow.
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
---
2-
title: Overview
2+
title: Understand the AI-assisted Arm Performix insight workflow
33

44
weight: 2
55

66
description: Learn how Codex uses the Arm Performix MCP server to turn profiling data into evidence-based performance recommendations.
77

88
layout: learningpathall
99
---
10-
## Understand the AI-assisted profiling workflow
10+
## Arm Performix local MCP server
1111

1212
[Arm Performix](https://developer.arm.com/servers-and-cloud-computing/arm-performix) is a performance toolkit designed to help developers identify bottlenecks and validate improvements on Arm-based systems. It simplifies the process of turning low-level performance data into actionable insights through guided analysis paths called recipes. These recipes help you answer common performance questions and move quickly from observation to root cause.
1313

1414
Arm Performix includes a local Model Context Protocol (MCP) server. MCP is a standard way for an AI assistant to discover and call tools. The server lets Codex query Performix recipes, targets, and runs from Visual Studio Code instead of relying on source-code analysis alone.
1515

16-
You will connect the server to Codex, select or create a Code Hotspots run, and ask for an AI Insight. The response should connect each recommendation to evidence from the selected run.
16+
You'll connect the server to Codex, select or create a Code Hotspots run, and ask for an AI Insight. The response should connect each recommendation to evidence from the selected run.
1717

18-
The MCP server runs on the same host as Codex. It can make profile data, symbols, source excerpts, disassembly excerpts, and performance metrics available to the assistant. Confirm that this use complies with your organization's data-handling policy before you continue.
18+
{{% notice Important %}}
19+
The MCP server runs on the same host as Codex. It can make profile data, symbols, source excerpts, disassembly excerpts, and performance metrics available to the assistant. Before you continue, confirm that this use complies with your organization's data-handling policy.
20+
{{% /notice %}}
1921

2022
Use AI-generated responses to support performance investigation. Validate important findings by reviewing the relevant data in Arm Performix and by rerunning the workload after making changes.
2123

22-
## How it works
24+
## Arm Performix insights workflow
2325

24-
Arm Performix stores profiling runs, target information, and rendered analysis data. Its MCP server exposes select Performix capabilities as tools that an MCP-compatible assistant can call.
26+
Arm Performix stores profiling runs, target information, and rendered analysis data. The local MCP server exposes select Performix capabilities as tools that an MCP-compatible assistant can call.
2527

2628
When you ask for insights, the flow is:
2729

@@ -32,4 +34,8 @@ When you ask for insights, the flow is:
3234

3335
The available evidence depends on how the run was collected. Debug symbols and source mappings improve function and source-line attribution, while a representative profiling duration improves sampling quality.
3436

35-
Next, configure the local MCP server and verify that Codex can use its tools.
37+
## What you've learned and what's next
38+
39+
You've learned about Arm Performix's local MCP server and the workflow that's executed when you ask for insights using Codex.
40+
41+
Next, you'll configure the local MCP server and verify that Codex can use its tools.

0 commit comments

Comments
 (0)