Skip to content

Commit 8f012ee

Browse files
committed
updated README
1 parent 007acb6 commit 8f012ee

1 file changed

Lines changed: 63 additions & 65 deletions

File tree

README.md

Lines changed: 63 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,63 @@
1717
- **Comprehensive Testing**: Unit tests and QEMU-based E2E testing
1818
- **Code Quality**: Pre-configured static analysis (sparse, cppcheck, checkpatch)
1919

20+
### Example Output
21+
22+
```
23+
>> Enter process ID (or Ctrl+C to exit): 3115
24+
25+
================================================================================
26+
PROCESS INFORMATION
27+
================================================================================
28+
Command line: ./build/test_multithread
29+
Process ID: 3115
30+
Name: test_multithrea
31+
CPU Usage: 2.06%
32+
33+
Memory Layout:
34+
--------------------------------------------------------------------------------
35+
Code Section: 0x0000643f5b8f5000 - 0x0000643f5b8f5459
36+
Data Section: 0x0000643f5b8f7d78 - 0x0000643f5b8f8010
37+
BSS Section: 0x0000643f5b8f8010 - 0x0000643f87d3b000
38+
Heap: 0x0000643f87d3b000 - 0x0000643f87d5c000
39+
Stack: 0x00007ffcdf141220 - 0x00007ffcdf121000
40+
ELF Base: 0x0000643f5b8f4000
41+
42+
Memory Layout Visualization:
43+
--------------------------------------------------------------------------------
44+
Low: 0x0000643f5b8f5000
45+
46+
CODE (1 KB)
47+
[= ]
48+
49+
DATA (664 B)
50+
[= ]
51+
52+
BSS (708 MB)
53+
[================================================= ]
54+
55+
HEAP (132 KB)
56+
[= ]
57+
58+
STACK (128 KB)
59+
[= ]
60+
61+
High: 0x00007ffcdf141220
62+
--------------------------------------------------------------------------------
63+
64+
================================================================================
65+
THREAD INFORMATION
66+
================================================================================
67+
TID NAME CPU(%) STATE PRIORITY NICE CPU_AFFINITY
68+
----- --------------- ------- ----- -------- ---- ----------------
69+
3115 test_multithrea 2.06 S 0 0 0,1
70+
3117 test_multithrea 0.32 S 0 0 0,1
71+
3118 test_multithrea 0.29 S 0 0 0,1
72+
3119 test_multithrea 0.26 S 0 0 0,1
73+
3120 test_multithrea 0.14 S 0 0 0,1
74+
--------------------------------------------------------------------------------
75+
```
76+
2077
## Quick Start
2178

2279
### Prerequisites
@@ -40,6 +97,12 @@
4097
./build/proc_elf_ctrl
4198
```
4299

100+
### Uninstall the Module
101+
102+
```bash
103+
sudo make uninstall
104+
```
105+
43106
## Project Structure
44107

45108
```
@@ -53,67 +116,6 @@ kernel_module/
53116
└── Makefile # Build system with quality checks
54117
```
55118

56-
The program will prompt you to enter a process ID (PID). You can find PIDs using:
57-
58-
```bash
59-
ps aux | grep <process_name>
60-
```
61-
62-
### 3. Example Output
63-
64-
```
65-
>> Enter process ID (or Ctrl+C to exit): 1234
66-
67-
================================================================================
68-
PROCESS INFORMATION
69-
================================================================================
70-
Process ID: 1234
71-
Name: bash
72-
CPU Usage: 0.50%
73-
74-
Memory Layout:
75-
--------------------------------------------------------------------------------
76-
Code Section: 0x0000563a00001234 - 0x0000563a00005678
77-
Data Section: 0x0000563a00009abc - 0x0000563a0000def0
78-
BSS Section: 0x0000563a0000def0 - 0x0000563a0000def0
79-
Heap: 0x0000563b00000000 - 0x0000563b00008000
80-
Stack: 0x00007ffd12345000 - 0x00007ffd12340000
81-
ELF Base: 0x0000563a00001000
82-
83-
Memory Layout Visualization:
84-
--------------------------------------------------------------------------------
85-
Low: 0x0000563a00001234
86-
87-
CODE (82 KB)
88-
[== ]
89-
90-
DATA (5 KB)
91-
[= ]
92-
93-
BSS (486 MB)
94-
[==================================================]
95-
96-
HEAP (132 KB)
97-
[== ]
98-
99-
STACK (131 KB)
100-
[== ]
101-
102-
High: 0x00007ffd12345000
103-
--------------------------------------------------------------------------------
104-
105-
================================================================================
106-
THREAD INFORMATION
107-
================================================================================
108-
TID NAME CPU(%) STATE PRIORITY NICE CPU_AFFINITY
109-
----- -------- ------- ----- -------- ---- ----------------
110-
01234 bash 0.50 S 0 0 0,1,2,3
111-
01235 worker 0.01 R 0 0 0,1
112-
--------------------------------------------------------------------------------
113-
Total threads: 2
114-
================================================================================
115-
```
116-
117119
**Notes**:
118120
- **Memory Visualization**: Each region's bar length is proportional to its actual size
119121
- Sizes are automatically displayed in appropriate units (B, KB, or MB)
@@ -123,11 +125,7 @@ Total threads: 2
123125
- PRIORITY: Shown as nice value (-20 to 19, where lower is higher priority)
124126
- CPU_AFFINITY: Shows which CPUs the thread can run on
125127

126-
### 4. Uninstall the Module
127128

128-
```bash
129-
sudo make uninstall
130-
```
131129

132130
## Safe Testing with QEMU
133131

0 commit comments

Comments
 (0)