摘要:
参考:https://crash-utility.github.io/help_pages/ptov.html 用法: 将物理内存地址转换为内核虚拟地址 ptov <物理地址> 将percpu偏移地址转为指定cpu上的内核虚拟地址 得到percpu地址在所有cpu上的虚拟地址:ptov <percp
阅读全文
posted @ 2022-05-28 18:01
dolinux
阅读(298)
推荐(0)
摘要:
参考:https://crash-utility.github.io/help_pages/search.html 用法: 设置搜索的起始地址,可以配合下面的-k -u -p等使用 search -s <起始地址> 搜索内核虚拟地址空间,这个也是默认的搜索选项 search -k 搜索内核虚拟地址空
阅读全文
posted @ 2022-05-28 15:19
dolinux
阅读(773)
推荐(0)
摘要:
参考 https://stackoverflow.com/questions/28003921/sending-file-descriptor-by-linux-socket Linux高级进程编程———在任意两个进程间传递文件描述符:使用 sendmsg 和 recvmsg 实现 linux进程间
阅读全文
posted @ 2022-05-25 22:29
dolinux
阅读(1125)
推荐(0)
摘要:
参考: https://man7.org/linux/man-pages/man1/top.1.html NAME top top - display Linux processes SYNOPSIS top top -hv|-bcEeHiOSs1 -d secs -n max -u|U user
阅读全文
posted @ 2022-05-23 11:03
dolinux
阅读(151)
推荐(0)
摘要:
修改某次提交的内容 比如有下面一段提交历史: 0621df5ad (qos_sched) sched: Fix sleeping in atomic context at cpu_qos_write() f169a3e0b sched: Introduce handle priority rever
阅读全文
posted @ 2022-05-09 21:11
dolinux
阅读(472)
推荐(0)
摘要:
参考 https://gitee.com/openeuler/kernel/issues/I4EUVI 提交 4a280fac30d27ae2aff096f9f99aa12d50f83426
阅读全文
posted @ 2022-05-07 17:52
dolinux
阅读(186)
推荐(0)
摘要:
提交信息 branch: openEuler-20.03-LTS-SP3 commit: 6174ecb523613c8ed8dcdc889d46f4c02f65b9e4 4e3f738c49f2693dba6c4be92230232869f71c16 862e230817f796b7c7cf47d
阅读全文
posted @ 2022-05-07 10:13
dolinux
阅读(107)
推荐(0)
摘要:
参考 整理一些大厂的开源平台及github,向他们看齐... 安装、引导、启动 BIOS/UEFI https://chuna2.787528.xyz/pengdonglin137/p/16618789.html 百敖BIOS培训系列一:UEFI启动流程总览 UEFI原理及开发视频教程 UEFI/Leg
阅读全文
posted @ 2022-05-07 09:43
dolinux
阅读(284)
推荐(0)
摘要:
当应用程序申请内存时,如果系统内存不足或者到达了memory cgroup设置的limit,会触发内存回收,如果还是得不到想要的数量的内存,最后会出发oom,选择一个进程杀死,释放其占用的内存。 下面通过实验来学习一下通过memory cgroup触发oom。 内核:linux-5.14 发行版:u
阅读全文
posted @ 2022-05-01 15:46
dolinux
阅读(1933)
推荐(0)
摘要:
参考 BuildYourOwnKernel https://wiki.ubuntu.com/KernelTeam/KernelMaintenance https://wiki.ubuntu.org.cn/UbuntuHelp:Kernel/Compile Ubuntu下获取内核源码 解压: cd /
阅读全文
posted @ 2022-05-01 10:18
dolinux
阅读(141)
推荐(0)
摘要:
参考 https://openanolis.cn/sig/pmem Linux挂载持久化内存(PMEM) Linux文件系统与持久性内存介绍:块设备、闪存(NAND/NOR)、NVDIMM(非易失性内存)、PMEM(PMDK)- ndctl Linux Kernel中AEP的现状和发展
阅读全文
posted @ 2022-05-01 00:14
dolinux
阅读(202)
推荐(0)
摘要:
参考 https://developer.aliyun.com/article/807824 https://openanolis.cn/video/447397858019557785 内核功能与接口
阅读全文
posted @ 2022-05-01 00:08
dolinux
阅读(70)
推荐(0)
摘要:
参考 https://gitee.com/anolis/tracing-ssar/blob/master/Reference_zh-CN.md https://gitee.com/anolis/tracing-ssar
阅读全文
posted @ 2022-05-01 00:05
dolinux
阅读(80)
推荐(0)
摘要:
参考 https://gitee.com/anolis/sysak sysAK(青囊)系统运维工具集:如何实现高效自动化运维? 系统运维工具 SysAK的云上应用性能诊断 阿里sysAK工具简析
阅读全文
posted @ 2022-05-01 00:02
dolinux
阅读(93)
推荐(0)
摘要:
参考 https://github.com/facebookincubator/oomd https://engineering.fb.com/2018/07/19/production-engineering/oomd/ https://lwn.net/Articles/511731/ https
阅读全文
posted @ 2022-05-01 00:00
dolinux
阅读(237)
推荐(0)
摘要:
参考 https://openanolis.cn/video/528538652696158417 https://www.kernel.org/doc/html/latest/vm/damon/index.html https://gitee.com/anolis/data-profile-too
阅读全文
posted @ 2022-04-30 23:54
dolinux
阅读(61)
推荐(0)
摘要:
在遍历task_group的时候,需要会调用到walk_tg_tree_from函数,从函数注释看,这个函数的流程是: 以from为根节点,当进入一个节点时调用down回调函数,当离开一个节点时调用up函数。这个函数 采用的是深度遍历。 下面用一张图来说明: /* * Iterate task_gr
阅读全文
posted @ 2022-04-24 17:23
dolinux
阅读(166)
推荐(0)
摘要:
参考: https://www.freedesktop.org/wiki/Software/systemd/ Which Service Owns Which Processes? Tips & Tricks Diagnosing Boot Problems Predictable Network
阅读全文
posted @ 2022-04-16 10:55
dolinux
阅读(60)
推荐(0)
摘要:
参考:Control Groups vs. Control Groups systemd的源码链接:https://github.com/systemd/systemd ubuntu系统开机后,可以看到已经挂载了很多文件系统,其中有些是systemd在代码里自动挂载的,比如cgroup。 /dev/
阅读全文
posted @ 2022-04-15 20:28
dolinux
阅读(1432)
推荐(0)
摘要:
内核版本:5.14 ubuntu版本:20.04 参考: Linux_schedule_cgroup.pdf 在开机时,会自动挂载cgroup文件系统,可以通过cat /proc/cgroups来查看当前在用的cgroup子系统。 root@ubuntu-vm:~# cat /proc/cgroup
阅读全文
posted @ 2022-04-15 15:34
dolinux
阅读(665)
推荐(0)
摘要:
参考: https://blog.csdn.net/zhoudawei/article/details/86669868 源码路径:fs/kernfs
阅读全文
posted @ 2022-04-14 20:45
dolinux
阅读(463)
推荐(0)
摘要:
内核版本:Linux-5.14 在linux内核执行fork完毕后,原先父进程中可写的区域在父子进程中都被设置为了CoW,即将pte中可写的比特清除了。 下面是调用流程:[kernel/fork.c] sys_fork -> kernel_clone -> copy_process -> copy_
阅读全文
posted @ 2022-04-11 20:07
dolinux
阅读(178)
推荐(0)
摘要:
参考 双向循环链表 list_head 相关文件: include/linux/list.h 数据结构: struct list_head { struct list_head *next, *prev; }; 接口 static inline void INIT_LIST_HEAD(struct
阅读全文
posted @ 2022-04-07 16:06
dolinux
阅读(395)
推荐(0)
摘要:
参考:https://crash-utility.github.io/help_pages/sys.html 用法: 显示基本的系统信息,比如系统版本,cpu型号,内存容量以及panic信息等 sys 查看系统调用表 显示所有的系统调用信息: sys -c 根据系统调用号找到对应的系统调用信息: s
阅读全文
posted @ 2022-03-27 20:32
dolinux
阅读(235)
推荐(0)
摘要:
参考: https://crash-utility.github.io/help_pages/ps.html 用法 显示所有进程的pid、task_struct、cpu以及运行状态等信息 ps MEM列:使用物理内存的百分比 VSZ列:虚拟地址空间大小,单位KB RSS列:实际使用的物理内存大小,单
阅读全文
posted @ 2022-03-27 20:29
dolinux
阅读(896)
推荐(0)
摘要:
参考: linux中在进程之间传递文件描述符的实现方式 用法: 显示每个cpu的rq中的任务信息(pid,task_struct以及进程名字) runq 显示每个cpu的rq的时间戳信息 runq -t 显示每个cpu上正在运行的任务已经运行了多长时间,格式是 天-时-分-秒-毫秒 runq -m
阅读全文
posted @ 2022-03-27 20:27
dolinux
阅读(704)
推荐(0)
摘要:
参考:https://crash-utility.github.io/help_pages/tree.html 用法: 指定要搜索的树的类型,如果不指定,默认是红黑树类型 tree -t <树类型> | 树类型 | 简写 | 含义 | | : : | : : | : : | | radix | ra
阅读全文
posted @ 2022-03-27 20:23
dolinux
阅读(447)
推荐(0)
摘要:
参考: https://crash-utility.github.io/help_pages/files.html 用法: 查看进程当前打开的文件的信息,被打开的文件的file,dentry以及inode files <pid> 或者 files <进程task_struct> 根据dentry的地
阅读全文
posted @ 2022-03-27 20:22
dolinux
阅读(420)
推荐(0)
摘要:
参考: https://crash-utility.github.io/help_pages/task.html 用法: 显示指定进程的task_struct信息 task <进程pid> 或者 task <进程的task_struct地址> // 可以通过ps或者task <pid>或者进程的ta
阅读全文
posted @ 2022-03-27 20:18
dolinux
阅读(342)
推荐(0)
摘要:
参考: https://crash-utility.github.io/help_pages/kmem.html 常用方法: 查看page flags的定义 kmem -g 将指定的数字翻译为page的flags kmem -g 0x201 查看指定page的信息 kmem -p <page *>
阅读全文
posted @ 2022-03-27 20:18
dolinux
阅读(2465)
推荐(0)
posted @ 2022-03-27 20:17
dolinux
阅读(300)
推荐(0)
摘要:
参考: https://crash-utility.github.io/help_pages/vm.html 用法: 查看进程的用户虚拟内存信息(mm_struct地址,vma等) 查看当前进程: vm 查看指定进程: vm <进程pid> 或者 vm <进程的task_struct> 查看进程的用
阅读全文
posted @ 2022-03-27 20:16
dolinux
阅读(536)
推荐(0)
摘要:
内核版本:5.14 代码路径: kernel/locking/rwsem.c include/linux/rwsem.h 概述 读写信号量具有如下特点: 是一种睡眠锁 可以有多个read持有读信号量 只允许一个write持有持有写信号量 read和write之间互斥 write和write之间互斥
阅读全文
posted @ 2022-03-26 09:52
dolinux
阅读(508)
推荐(0)
摘要:
参考: https://crash-utility.github.io/help_pages/list.html crash中使用list遍历结构体 说明 头节点是A_head: struct A_head { // -h: 内嵌了list_head的结构体的地址 ... // -O: list_h
阅读全文
posted @ 2022-03-23 19:29
dolinux
阅读(1644)
推荐(0)
摘要:
参考: https://crash-utility.github.io/help_pages/dis.html 常用命令 反汇编指定函数 dis -x <function name>/<addr> 反汇编指定偏移 dis -x <function+0xXX> 反汇编从函数开始到指定偏移量之间的代码
阅读全文
posted @ 2022-03-23 19:29
dolinux
阅读(978)
推荐(0)
摘要:
参考: https://crash-utility.github.io/help_pages/bt.html 常用命令 查看调用栈(默认查看的导致crash的进程的调用栈) bt 查看调用栈,显示返回地址在函数内的偏移 bt -sx 查看调用栈中函数的返回地址对应的代码行 bt -l 查看详细的调用
阅读全文
posted @ 2022-03-23 19:29
dolinux
阅读(2317)
推荐(0)
摘要:
编译linux内核时,如果选上了CONFIG_DEBUG_INFO_BTF,那么需要安装pahole,用于生成.tmp_vmlinux.btf. 对于ubuntu系统可以用下面的办法: 安装命令: sudo apt install dwarves 对于Centos系统,如果无法安装dwarves的话
阅读全文
posted @ 2022-03-19 17:46
dolinux
阅读(3428)
推荐(0)
摘要:
https://developer.aliyun.com/mirror/centos centos7: https://mirrors.aliyun.com/centos-vault/7.9.2009/os/Source/SPackages/ centos8: https://mirrors.ali
阅读全文
posted @ 2022-03-17 11:24
dolinux
阅读(498)
推荐(0)
摘要:
参考: https://blog.csdn.net/Kajima_/article/details/111415651 在静态编译tig时,遇到如下问题: LDFLAGS static ./configure --prefix=`pwd`/install make V=1 log如下: ... gc
阅读全文
posted @ 2022-03-10 16:31
dolinux
阅读(1301)
推荐(0)
摘要:
概述 在编译linux内核时,linux会检查当前使用的gcc的版本,如果太老的话,就无法编译linux。 问题 执行命令make ARCH=x86_64 defconfig时,提示如下错误: *** Default configuration is based on 'x86_64_defconf
阅读全文
posted @ 2022-03-08 16:57
dolinux
阅读(2172)
推荐(0)