Run generic symbol analysis for any platform to identify optimization opportunities.
(
arguments: dict[str, Any], project_root: Path
)
| 2250 | |
| 2251 | |
| 2252 | async def symbol_analysis( |
| 2253 | arguments: dict[str, Any], project_root: Path |
| 2254 | ) -> CallToolResult: |
| 2255 | """Run generic symbol analysis for any platform to identify optimization opportunities.""" |
| 2256 | board = arguments.get("board", "auto") |
| 2257 | example = arguments.get("example", "Blink") |
| 2258 | output_json = arguments.get("output_json", False) |
| 2259 | run_all_platforms = arguments.get("run_all_platforms", False) |
| 2260 | |
| 2261 | result_text = "# Generic Symbol Analysis Report\n\n" |
| 2262 | |
| 2263 | try: |
| 2264 | if run_all_platforms: |
| 2265 | # Run demo script for all platforms |
| 2266 | result_text += "## Running analysis on ALL available platforms\n\n" |
| 2267 | cmd = ["uv", "run", "ci/demo_symbol_analysis.py"] |
| 2268 | |
| 2269 | try: |
| 2270 | demo_result = await run_command(cmd, project_root) |
| 2271 | result_text += demo_result |
| 2272 | except Exception as e: |
| 2273 | return CallToolResult( |
| 2274 | content=[ |
| 2275 | TextContent( |
| 2276 | type="text", |
| 2277 | text=f"Error running demo symbol analysis: {str(e)}", |
| 2278 | ) |
| 2279 | ], |
| 2280 | isError=True, |
| 2281 | ) |
| 2282 | else: |
| 2283 | # Run for specific board |
| 2284 | result_text += f"## Symbol Analysis for Platform: {board}\n\n" |
| 2285 | |
| 2286 | cmd = ["uv", "run", "ci/util/symbol_analysis.py", "--board", board] |
| 2287 | |
| 2288 | try: |
| 2289 | analysis_result = await run_command(cmd, project_root) |
| 2290 | result_text += analysis_result |
| 2291 | except Exception as e: |
| 2292 | return CallToolResult( |
| 2293 | content=[ |
| 2294 | TextContent( |
| 2295 | type="text", |
| 2296 | text=f"Error running symbol analysis for {board}: {str(e)}", |
| 2297 | ) |
| 2298 | ], |
| 2299 | isError=True, |
| 2300 | ) |
| 2301 | |
| 2302 | # Add usage instructions |
| 2303 | result_text += "\n## How to Use Symbol Analysis\n\n" |
| 2304 | result_text += "### Available Commands:\n" |
| 2305 | result_text += ( |
| 2306 | "- `uv run -m ci.util.symbol_analysis --board uno` - Analyze UNO platform\n" |
| 2307 | ) |
| 2308 | result_text += "- `uv run -m ci.util.symbol_analysis --board esp32dev` - Analyze ESP32 platform\n" |
| 2309 | result_text += "- `uv run -m ci.util.symbol_analysis --board teensy31` - Analyze Teensy platform\n" |
no test coverage detected