|
|
--- |
|
|
title: Macos Sample File Viewer |
|
|
emoji: π |
|
|
colorFrom: blue |
|
|
colorTo: yellow |
|
|
sdk: static |
|
|
pinned: false |
|
|
license: apache-2.0 |
|
|
app_build_command: npm run build |
|
|
app_file: dist/index.html |
|
|
--- |
|
|
|
|
|
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference |
|
|
|
|
|
# π Backtrace Viewer |
|
|
|
|
|
A modern web application for viewing and analyzing backtrace files from sampling profilers, built with Svelte. |
|
|
|
|
|
## Features |
|
|
|
|
|
- **π File Upload**: Load your own backtrace files or use the included sample |
|
|
- **π Thread Filtering**: Filter threads by name using exact prefix matching |
|
|
- **π Toggle Views**: Expand/collapse individual threads to focus on what matters |
|
|
- **π Collapsible Backtraces**: Click on any backtrace line to collapse/expand sections |
|
|
- **π± Responsive Design**: Works great on desktop and mobile devices |
|
|
- **β‘ Fast Performance**: Built with Svelte for optimal performance |
|
|
|
|
|
## Getting Started |
|
|
|
|
|
### Prerequisites |
|
|
|
|
|
- Node.js (version 14 or higher) |
|
|
- npm or yarn |
|
|
|
|
|
### Installation |
|
|
|
|
|
1. Clone or navigate to the project directory: |
|
|
|
|
|
```bash |
|
|
cd backtrace-viewer |
|
|
``` |
|
|
|
|
|
2. Install dependencies: |
|
|
|
|
|
```bash |
|
|
npm install |
|
|
``` |
|
|
|
|
|
3. Start the development server: |
|
|
|
|
|
```bash |
|
|
npm run dev |
|
|
``` |
|
|
|
|
|
4. Open your browser to `http://localhost:5173` |
|
|
|
|
|
### Building for Production |
|
|
|
|
|
```bash |
|
|
npm run build |
|
|
``` |
|
|
|
|
|
The built files will be in the `dist/` directory. |
|
|
|
|
|
## Usage |
|
|
|
|
|
### Loading Files |
|
|
|
|
|
- The app will automatically load `sample.txt` when you open it |
|
|
- Click "π Load Backtrace File" to upload your own backtrace files |
|
|
- Supported format: Text files from sampling profilers (like macOS `sample` command) |
|
|
|
|
|
### Filtering Threads |
|
|
|
|
|
- Use the filter input to find threads by name |
|
|
- Only shows threads whose names start with your filter text (case-insensitive) |
|
|
- Thread names are extracted from the part after the `:` in thread headers |
|
|
|
|
|
### Viewing Backtraces |
|
|
|
|
|
- Click on any thread header to expand/collapse its backtrace |
|
|
- Click on individual backtrace lines to collapse/expand sections |
|
|
- Indentation shows the call hierarchy |
|
|
- Sample counts and function names are highlighted for easy reading |
|
|
|
|
|
### File Format Support |
|
|
|
|
|
The viewer supports backtrace files with this format: |
|
|
|
|
|
``` |
|
|
6963 Thread_10032126: hf-xet-0 |
|
|
+ 6963 thread_start (in libsystem_pthread.dylib) + 8 [0x19e40ab80] |
|
|
+ 6963 _pthread_start (in libsystem_pthread.dylib) + 136 [0x19e40fc0c] |
|
|
+ 6963 pythread_wrapper (in Python) + 48 [0x104da7cd0] |
|
|
... |
|
|
``` |
|
|
|
|
|
Where: |
|
|
|
|
|
- Thread headers: `{count} Thread_{id}: {name}` |
|
|
- Thread names: Optional part after `:` |
|
|
- Backtrace lines: Indented with `+`, `!`, `:`, `|` characters |
|
|
- Sample counts, function names, and addresses are automatically highlighted |
|
|
|
|
|
## Contributing |
|
|
|
|
|
Feel free to open issues or submit pull requests to improve the viewer! |
|
|
|
|
|
## License |
|
|
|
|
|
MIT License |
|
|
|