-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GDB Plugin Upgrade part3: fs related tools #14854
base: master
Are you sure you want to change the base?
Conversation
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
@XuNeo please update https://nuttx.apache.org/docs/latest/guides/gdbwithpython.html with all the steps you put here. The current "guide" is not useful and point to an external doc that will know fit to NuttX details. |
tools/gdb/utils.py
Outdated
|
||
|
||
def get_symbol_value(name, locspec="nx_start", cacheable=True): | ||
"""Return the value of a symbol value etc: Variable, Marco""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Return the value of a symbol value etc: Variable, Marco""" | |
"""Return the value of a symbol value etc: Variable, Macro""" |
support mount command in gdb, print mount information test result: /bin type binfs /data type hostfs /etc type romfs /proc type procfs /resource type hostfs /tmp type tmpfs Signed-off-by: zhengyu9 <[email protected]>
go through each inode and print its structure info in the form like below: ├── i_name: bin, i_ino: 51 │ i_parent: , i_peer: data, i_child: , i_crefs: 1, i_flags: 3 │ ......(other info) │ ├── i_name: audio, i_ino: 5 │ │ i_parent: dev, i_peer: binder, i_child: mixer...... Signed-off-by: zhengyu9 <[email protected]>
Execute fdinfo or fdinfo -p pid. (gdb) fdinfo PID: 0 FD OFLAGS POS PATH BACKTRACE 0 3 0 /dev/console 0x4028ff0c <sched_backtrace+48> /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105 0x402888f8 <file_allocate_from_tcb+236> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:615 0x402979d0 <nx_vopen+104> /home/neo/projects/vela2/nuttx/fs/vfs/fs_open.c:326 0x40297ad4 <nx_open+116> /home/neo/projects/vela2/nuttx/fs/vfs/fs_open.c:449 0x40291eb4 <group_setupidlefiles+28> /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:75 0x4028df94 <nx_start+628> /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651 0x4028119c <arm64_boot_primary_c_routine+16> /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205 1 3 0 /dev/console 0x4028ff0c <sched_backtrace+48> /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105 0x40289574 <file_dup3+248> /home/neo/projects/vela2/nuttx/fs/vfs/fs_dup2.c:177 0x40288b88 <nx_dup3_from_tcb+176> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:314 0x40288c64 <nx_dup2_from_tcb+16> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:901 0x40288c88 <nx_dup2+28> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:924 0x40291ec4 <group_setupidlefiles+44> /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:84 0x4028df94 <nx_start+628> /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651 0x4028119c <arm64_boot_primary_c_routine+16> /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205 2 3 0 /dev/console 0x4028ff0c <sched_backtrace+48> /home/neo/projects/vela2/nuttx/sched/sched/sched_backtrace.c:105 0x40289574 <file_dup3+248> /home/neo/projects/vela2/nuttx/fs/vfs/fs_dup2.c:177 0x40288b88 <nx_dup3_from_tcb+176> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:314 0x40288c64 <nx_dup2_from_tcb+16> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:901 0x40288c88 <nx_dup2+28> /home/neo/projects/vela2/nuttx/fs/inode/fs_files.c:924 0x40291ed0 <group_setupidlefiles+56> /home/neo/projects/vela2/nuttx/sched/group/group_setupidlefiles.c:117 0x4028df94 <nx_start+628> /home/neo/projects/vela2/nuttx/sched/init/nx_start.c:651 0x4028119c <arm64_boot_primary_c_routine+16> /home/neo/projects/vela2/nuttx/arch/arm64/src/common/arm64_boot.c:205 Signed-off-by: yangao1 <[email protected]>
Signed-off-by: xuxingliang <[email protected]>
(gdb) info shm /var/shm/xms:bq-325-1044165565 memsize: 1536000, paddr: 0x41de3970 /var/shm/xms:bq-325-2123092606 memsize: 1536000, paddr: 0x41f5a9a8 /var/shm/xms:fakemq-325-1835096569 memsize: 12, paddr: 0x420d19e0 (gdb) Signed-off-by: xuxingliang <[email protected]>
@acassis Hi Alan, I'm going to update the docs after uploading all my features. Is that OK? There are some command usage will be slightly changed later. For command usage, use |
Note: Please adhere to Contributing Guidelines.
Summary
In this PR, we introduces several fs related tools.
This PR is based on part1/2 to minimize conflicts. I'll rebase once they are merged. For now please review commits by commits.
New tools added:
foreach_inode
print all the inode and its informationfdinfo
print all the file opened in each taskinfo shm
show the share memory usageAlso included an performance optimization that use generate instead of list where possible.
Impact
New feature added.
Testing
Tested on qemu arm64(info shm is not available because it's disabled).