Skip to content
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

linux栈回溯跟踪问题(dump_stack) #4

Open
cclinuxer opened this issue Jul 10, 2020 · 2 comments
Open

linux栈回溯跟踪问题(dump_stack) #4

cclinuxer opened this issue Jul 10, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@cclinuxer
Copy link
Owner

No description provided.

@cclinuxer cclinuxer self-assigned this Jul 10, 2020
@cclinuxer cclinuxer added the bug Something isn't working label Jul 10, 2020
@cclinuxer
Copy link
Owner Author

cclinuxer commented Jul 10, 2020

在实际的环境中,系统异常的时候,我们有时候需要知道,是哪一个进程调用了系统调用,或者是谁下发了配置到内核,这个时候可以通过dump_stack来打印调用栈。

        struct task_struct *my_parent = current->parent;
         if((dev!=NULL)&&(dev->name!=NULL)){
		printk(" ifconfig devname=%s current=%s pid=%d   parent_pid=%d\n",dev->name,
                current->comm, current->pid, my_parent->pid);
        }
         dump_stack();
	if (net_ratelimit()){
		char *mac_str=NULL;
		struct task_struct *my_parent = current->parent;
		printk("huangjie edit current=%s pid=%d	parent_pid=%d\n",current->comm, current->pid, my_parent->pid);
		dump_stack();
	}

@cclinuxer
Copy link
Owner Author

这里只是我比较喜欢用的,用于查看是哪些应用在配置系统状态。当然还有其他的一些工具诸如ftrace、jprobe、ebpf后面我会开新的issue来详细介绍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant