Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ per-process I/O statistics, ELF metadata, and thread information.

- One-shot mode for a specific PID
- Live mode dashboard with section filtering and refresh loop
- Default live section is `Overview` (`5`) with 32-sample trend lanes
(CPU, RSS, RX/s, TX/s, WR/s)
- Uses procfs endpoints provided by the kernel module

### Tests
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- **CPU Usage Tracking**: Real-time CPU percentage calculation per process and thread
- **ELF Section Analysis**: Binary base address and section boundaries
- **Proc Interface**: Easy access through `/proc/proclens_module/`
- **Live Dashboard Mode**: No-arg mode refreshes every 1s with switchable Memory, Network, Threads, and I/O sections
- **Live Dashboard Mode**: No-arg mode refreshes every 1s with a condensed Overview page, recent trend plots, and switchable Memory, Network, Threads, and I/O sections
- **Comprehensive Testing**: Unit tests and QEMU-based E2E testing
- **Code Quality**: Pre-configured static analysis (sparse, cppcheck, checkpatch)

Expand Down Expand Up @@ -72,9 +72,10 @@
Running without arguments starts a live dashboard:

- Auto-refreshes every 1 second
- Defaults to section `1` (memory-related output)
- Shows quick controls at the top: `1` memory, `2` network, `3` threads, `4` I/O
- Shows command hints in-app: `1/2/3/4` switch sections, `0` changes PID
- Defaults to section `5` (overview summary)
- Overview includes 32-sample block-style histogram trend lanes for CPU, RSS, RX/s, TX/s, and WR/s based on recent snapshots
- Shows quick controls at the top: `1` memory, `2` network, `3` threads, `4` I/O, `5` overview
- Shows command hints in-app: `1/2/3/4/5` switch sections, `0` changes PID
- Prints timestamps at top and bottom in `YY/MM/DD HH:MM:SS`
- Keeps a snapshot history (up to 120 entries) for in-app navigation
- Press Up/`k` for older snapshots, Down/`j` for newer snapshots, `f` to resume live follow
Expand Down
18 changes: 15 additions & 3 deletions docs/TECHNICAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,31 @@ Simple C program that supports two modes:
Prompts for a PID, then enters a 1-second refresh loop with section filtering.
Each refresh prints start/end timestamps in `YY/MM/DD HH:MM:SS`.
Snapshots are kept in an in-memory ring buffer (120 entries) for history browsing.
Default section is `5` (Overview).

Overview mode includes trend lanes rendered from recent snapshot history:
- CPU%
- RSS
- RX/s
- TX/s
- WR/s

Each lane uses 32 samples and block-style histogram glyphs, with one blank line
between lanes for readability.

Controls shown in the header:
- `1` - Memory section (default)
- `1` - Memory section
- `2` - Network section
- `3` - Thread section
- `4` - I/O section
- `5` - Overview section (default)
- `0` - Prompt for a new PID (switch process)
- `Up` or `k` - Older snapshot
- `Down` or `j` - Newer snapshot
- `f` - Return to live-follow mode

Keys `1`, `2`, `3`, `4` switch sections instantly (no Enter required). Pressing `0` temporarily
restores cooked terminal mode so the user can type a PID, then returns to raw mode.
Keys `1`, `2`, `3`, `4`, `5` switch sections instantly (no Enter required). Pressing `0`
temporarily restores cooked terminal mode so the user can type a PID, then returns to raw mode.

### I/O Stats

Expand Down
7 changes: 5 additions & 2 deletions docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,16 @@ Expected behavior:
- If `proclens_module` is not loaded, program exits immediately with status `-1`
- If required proc files are missing (`pid`, `det`, `threads`), program exits immediately with status `-1`
- Screen refreshes every 1 second
- Header shows controls (`1` memory, `2` network, `3` threads, `4` I/O, `0` switch PID)
- Header shows controls (`1` memory, `2` network, `3` threads, `4` I/O, `5` overview, `0` switch PID)
- Each refresh shows `Snapshot start` and `Snapshot end` timestamps in `YY/MM/DD HH:MM:SS`
- Overview page shows 32-sample block-style histogram trend lanes for CPU, RSS, RX/s, TX/s, and WR/s once enough samples are collected
- Trend lanes are separated by one blank line (for example between RX/s and TX/s)
- `Up`/`k` moves to older snapshots, `Down`/`j` moves toward newer snapshots
- While browsing old snapshots, header indicates history-browsing mode
- Press `f` to return to live-follow mode
- Default section is memory (`1`)
- Default section is overview (`5`)
- Press `4` to view only I/O statistics (`[io]` section)
- Press `5` to return to the condensed overview page
- Pressing `0` prompts for a new PID and continues live refresh for that PID

Note: Live mode requires a real TTY for raw terminal input (`tcgetattr`/`tcsetattr`).
Expand Down
Binary file modified docs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading