-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gdbinit
More file actions
66 lines (56 loc) · 1.46 KB
/
.gdbinit
File metadata and controls
66 lines (56 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# TensorOS GDB configuration
# Usage: gdb -x .gdbinit build/tensoros.bin
# Connect to QEMU GDB stub
target remote localhost:1234
# Load kernel symbols
symbol-file build/tensoros.bin
# Set architecture
set architecture i386:x86-64
# Don't ask for confirmations
set confirm off
# Display source on stop
set listsize 20
# Useful breakpoints
break kernel_main
break tensor_sched_init
break tensor_mm_init
break aishell_main
# Custom commands
define tensor-state
print kstate
end
document tensor-state
Print the global kernel state (MEU count, GPU count, tensor ops, etc.)
end
define meu-list
set $i = 0
while $i < kstate.meu_count
printf "MEU #%d: %s (state=%d, priority=%d)\n", \
kstate.meus[$i].id, kstate.meus[$i].name, \
kstate.meus[$i].state, kstate.meus[$i].priority
set $i = $i + 1
end
end
document meu-list
List all Model Execution Units with their state
end
define gpu-info
set $i = 0
while $i < kstate.gpu_count
printf "GPU #%d: vendor=0x%04x device=0x%04x vram=%llu MB\n", \
$i, 0, 0, 0
set $i = $i + 1
end
end
document gpu-info
Show detected GPU information
end
# Start execution
echo \n
echo ============================================\n
echo TensorOS GDB Session\n
echo Breakpoint set at kernel_main\n
echo Type 'continue' to start booting\n
echo Custom commands: tensor-state, meu-list, gpu-info\n
echo ============================================\n
echo \n