用vscode阅读linux kernel
1. 移除多余文件
因为linux kernel文件数量过多,会导致系统很慢。
在File->prefenrence->setting->workspace, 右上角有个切换到json文件,编辑如下:
{ "search.exclude": { "**/.git": true, "**/.svn": true, "**/.DS_Store": true, "**/drivers": true, "**/sound": true, "**/tools": true, "**/arch/alpha": true, "**/arch/arc": true, "**/arch/c6x": true, "**/arch/h8300": true, "**/arch/hexagon": true, "**/arch/ia64": true, "**/arch/m32r": true, "**/arch/m68k": true, "**/arch/microblaze": true, "**/arch/mn10300": true, "**/arch/nds32": true, "**/arch/nios2": true, "**/arch/parisc": true, "**/arch/powerpc": true, "**/arch/s390": true, "**/arch/sparc": true, "**/arch/score": true, "**/arch/sh": true, "**/arch/um": true, "**/arch/unicore32": true, "**/arch/xtensa": true }, //-------- Files configuration -------- // Configure glob patterns for excluding files and folders. "files.exclude": { "**/.git": true, "**/.svn": true, "**/.DS_Store": true, "**/drivers": true, "**/sound": true, "**/tools": true, "**/arch/alpha": true, "**/arch/arc": true, "**/arch/c6x": true, "**/arch/h8300": true, "**/arch/hexagon": true, "**/arch/ia64": true, "**/arch/m32r": true, "**/arch/m68k": true, "**/arch/microblaze": true, "**/arch/mn10300": true, "**/arch/nds32": true, "**/arch/nios2": true, "**/arch/parisc": true, "**/arch/powerpc": true, "**/arch/s390": true, "**/arch/sparc": true, "**/arch/score": true, "**/arch/sh": true, "**/arch/um": true, "**/arch/unicore32": true, "**/arch/xtensa": true } }
2. 修复有些头文件路径查找不到
可自行添加头文件路径
ctrl+shift+P: 输入>edit configurations,选择json文件编辑,添加如下:
{ "configurations": [ { "name": "Linux", "includePath": [ "${workspaceFolder}/arch/arm64/include/**", "${workspaceFolder}/include/**", "${workspaceFolder}/include/linux/**", "${workspaceFolder}/arch/arm64/**", "${workspaceFolder}/**" ], "defines": [], "compilerPath": "/usr/bin/gcc", "cStandard": "c11", "cppStandard": "c++17", "intelliSenseMode": "clang-x64" } ], "version": 4 }
PS:ubuntu wine安装的程序卸载:wine uninstaller,执行后会有弹窗提示可卸载的软件