2 Star 1 Fork 0

陈孝松/blog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
0001-debug-task_struct.patch 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
ChenXiaoSong 提交于 2025-08-28 19:07 +08:00 . initial commit
From 0ccd4af01e66defd61020ebff43de9ff84167c67 Mon Sep 17 00:00:00 2001
From: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Date: Fri, 30 Aug 2024 13:37:31 +0000
Subject: [PATCH] debug task_struct
Signed-off-by: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
---
fs/ext2/dir.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index b335f17f682f..da7210ea6a65 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -265,6 +265,15 @@ ext2_readdir(struct file *file, struct dir_context *ctx)
unsigned chunk_mask = ~(ext2_chunk_size(inode)-1);
bool need_revalidate = !inode_eq_iversion(inode, file->f_version);
bool has_filetype;
+ struct list_head *list;
+ struct task_struct *child;
+
+ printk(KERN_INFO "current pid %d comm %s, parent pid %d comm %s\n",
+ current->pid, current->comm, current->parent->pid, current->parent->comm);
+ list_for_each(list, &current->children) {
+ child = list_entry(list, struct task_struct, sibling);
+ printk(KERN_INFO "child pid %d, comm %s\n", child->pid, child->comm);
+ }
if (pos > inode->i_size - EXT2_DIR_REC_LEN(1))
return 0;
--
2.34.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chenxiaosonggitee/blog.git
git@gitee.com:chenxiaosonggitee/blog.git
chenxiaosonggitee
blog
blog
master

搜索帮助