Skip to content

Enhance tracing functionality and add Chrome tracing support#12

Merged
reiase merged 14 commits intomasterfrom
feature/refine_trace
Nov 13, 2025
Merged

Enhance tracing functionality and add Chrome tracing support#12
reiase merged 14 commits intomasterfrom
feature/refine_trace

Conversation

@reiase
Copy link
Copy Markdown
Contributor

@reiase reiase commented Nov 12, 2025

Introduce comprehensive tracing capabilities in Rust and Python, including variable tracking, UI enhancements, and improved error handling. Add support for Chrome tracing and integrate it into the web application, along with updated navigation. Refactor existing code for better maintainability and clarity.

reiase added 14 commits November 9, 2025 11:57
- Implemented tracing API in Rust with functions to start, stop, and list traceable functions.
- Added Python frontend for tracing, including UI for starting/stopping traces and displaying traceable functions.
- Created unit tests for tracing functionality, including edge cases and error handling.
- Enhanced existing tests for tracing decorators and context managers in Python.
- Introduced new helper functions for filtering and determining traceable items.
- Updated REPL commands to support tracing features.
…le tracking

- Introduced `TraceableItem` struct to represent traceable functions/modules with variable information.
- Updated `get_traceable_functions` to return a list of functions in the old format for compatibility.
- Implemented `get_traceable_items` to return a list of `TraceableItem` objects, supporting both old and new formats.
- Refactored variable record retrieval to use SQL queries, improving flexibility and error handling.
- Added a new method `dataframe_to_variable_records` to convert DataFrame to `VariableRecord` objects.
- Updated the Python page to utilize the new traceable items structure and improved UI for variable records.
- Enhanced the traceable functions list to display variables and allow interaction for starting traces.
- Introduced a popover for displaying variable records associated with functions.
…grate DataFrameView for variable records display
- Implemented CORS handling for extension calls in `extension_handler.rs` to support cross-origin requests from Perfetto UI.
- Added a new route for `/chrome-tracing` in `mod.rs` to handle Chrome tracing requests.
- Enhanced the PyTorch magic commands in `torch_magic.py` to include a new `%pytorch timeline` command for exporting timeline data in Chrome tracing format.
- Created a new API client method in `pytorch.rs` to fetch PyTorch profiler timeline data.
- Updated the `traces.rs` API to include a method for retrieving Chrome tracing JSON data.
- Developed a new `ChromeTracing` page in the web application to visualize tracing data using Perfetto UI.
- Added navigation links for Chrome tracing in the `nav_drawer.rs` component.
- Created a dedicated `chrome_tracing.rs` page to handle the display and interaction with Chrome tracing data.
- Updated the main application routing to include the new Chrome tracing page.
- Updated the PyTorch timeline API to ensure consistency with REPL by using the same method for timeline data retrieval.
- Improved error handling in the timeline API to provide clearer messages when no profiler instances are found or when timeline data is empty.
- Added a new command-line argument to the inspect magic for listing all PyTorch modules, including submodules.
- Refactored the TorchMagic class to implement a global profiler that automatically records data after each optimizer step.
- Enhanced the Chrome tracing page to handle loading and displaying timeline data more effectively, including improved error messages and user guidance.
- Updated the API client to validate the response format for timeline data and log appropriate warnings for errors.
…nce documentation parsing

- Updated the magic command from %lsmagics to %cmds for listing probing magic commands.
- Enhanced the docstring parsing to extract subcommands and descriptions more effectively.
- Updated tests to reflect the command name change and ensure functionality remains intact.
- Improved output formatting to include subcommands in the help display.
- Deleted the test file `test_trace.py` which contained unit tests for the probing.inspect.trace module.
- The removal includes tests for the probe decorator, ProbingTracer class, and various tracing functions.
- This change cleans up the test suite as part of a broader refactor.
@reiase reiase merged commit f5c28d2 into master Nov 13, 2025
6 checks passed
@reiase reiase deleted the feature/refine_trace branch November 15, 2025 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant