diff --git a/study/debug/README.md b/study/debug/README.md new file mode 100644 index 0000000..d7ddc1f --- /dev/null +++ b/study/debug/README.md @@ -0,0 +1,92 @@ +Linux内核调试以及用户空间与内核空间进行数据交换的方式 +======= + +| CSDN | GitHub | +|:----:|:------:| +| [You-Get--基于Python3的开源网络视频下载工具](http://blog.csdn.net/gatieme/article/details/61623891) | [`AderXCoding/system/tools/you-get`](https://github.com/gatieme/AderXCoding/tree/master/system/tools/you-get) | + +
+知识共享许可协议 +本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可, 转载请注明出处, 谢谢合作 +
+ + + +#2 用户空间与内核空间数据交换的文件系统 +------- + +##2.1 debugfs文件系统 +------- + +##2.2 procfs文件系统 +------- + + +##2.3 sysfs文件系统 +------- + +##2.4 relayfs文件系统 +------- + + + +#3 内核调试工具 +------- + + +##3.1 printk +------- + + +##3.2 ftrace +------- + + +##3.3 kprobe +------- + + + + +#4 用户空间工具 +------- + + +##4.1 trace-cmd +------- + + +##4.2 systemtap +------- + + +##4.3 kgdb +------- + + +##4.4 kgtp +------- + + + +[Linux内核里的DebugFS](http://www.cnblogs.com/wwang/archive/2011/01/17/1937609.html) + +[Debugging the Linux Kernel with debugfs](http://opensourceforu.com/2010/10/debugging-linux-kernel-with-debugfs/) + +[debugfs-seq_file](http://lxr.free-electrons.com/source/drivers/base/power/wakeup.c) + + +[Linux Debugfs文件系统介绍及使用](http://blog.sina.com.cn/s/blog_40d2f1c80100p7u2.html) + +[Linux 文件系统:procfs, sysfs, debugfs 用法简介](http://www.tinylab.org/show-the-usage-of-procfs-sysfs-debugfs/) + +[用户空间与内核空间数据交换的方式(1)------debugfs](http://www.cnblogs.com/hoys/archive/2011/04/10/2011124.html) + + +[Linux 运用debugfs调试方法](http://www.xuebuyuan.com/1023006.html) + + + +
+ +知识共享许可协议本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可, 转载请注明出处, 谢谢合作. diff --git a/study/debug/debugfs/00-code/debugfs/Makefile b/study/debug/filesystem/debugfs/00-code/debugfs/Makefile similarity index 100% rename from study/debug/debugfs/00-code/debugfs/Makefile rename to study/debug/filesystem/debugfs/00-code/debugfs/Makefile diff --git a/study/debug/debugfs/00-code/debugfs/my_debugfs.c b/study/debug/filesystem/debugfs/00-code/debugfs/my_debugfs.c similarity index 100% rename from study/debug/debugfs/00-code/debugfs/my_debugfs.c rename to study/debug/filesystem/debugfs/00-code/debugfs/my_debugfs.c diff --git a/study/debug/debugfs/00-code/debugfs_seq_fs/Makefile b/study/debug/filesystem/debugfs/00-code/debugfs_seq_fs/Makefile similarity index 100% rename from study/debug/debugfs/00-code/debugfs_seq_fs/Makefile rename to study/debug/filesystem/debugfs/00-code/debugfs_seq_fs/Makefile diff --git a/study/debug/debugfs/00-code/debugfs_seq_fs/pcie_debugfs.c b/study/debug/filesystem/debugfs/00-code/debugfs_seq_fs/pcie_debugfs.c similarity index 100% rename from study/debug/debugfs/00-code/debugfs_seq_fs/pcie_debugfs.c rename to study/debug/filesystem/debugfs/00-code/debugfs_seq_fs/pcie_debugfs.c diff --git a/study/debug/debugfs/00-code/my_debug/Makefile b/study/debug/filesystem/debugfs/00-code/my_debug/Makefile similarity index 100% rename from study/debug/debugfs/00-code/my_debug/Makefile rename to study/debug/filesystem/debugfs/00-code/my_debug/Makefile diff --git a/study/debug/debugfs/00-code/my_debug/my_debugfs.c b/study/debug/filesystem/debugfs/00-code/my_debug/my_debugfs.c similarity index 100% rename from study/debug/debugfs/00-code/my_debug/my_debugfs.c rename to study/debug/filesystem/debugfs/00-code/my_debug/my_debugfs.c diff --git a/study/debug/debugfs/README.md b/study/debug/filesystem/debugfs/README.md similarity index 100% rename from study/debug/debugfs/README.md rename to study/debug/filesystem/debugfs/README.md diff --git a/study/debug/proc/00-code/create_proc_entry/Makefile b/study/debug/filesystem/procfs/00-code/create_proc_entry/Makefile similarity index 100% rename from study/debug/proc/00-code/create_proc_entry/Makefile rename to study/debug/filesystem/procfs/00-code/create_proc_entry/Makefile diff --git a/study/debug/proc/00-code/create_proc_entry/README.md b/study/debug/filesystem/procfs/00-code/create_proc_entry/README.md similarity index 100% rename from study/debug/proc/00-code/create_proc_entry/README.md rename to study/debug/filesystem/procfs/00-code/create_proc_entry/README.md diff --git a/study/debug/proc/00-code/create_proc_entry/hello_proc.c b/study/debug/filesystem/procfs/00-code/create_proc_entry/hello_proc.c similarity index 100% rename from study/debug/proc/00-code/create_proc_entry/hello_proc.c rename to study/debug/filesystem/procfs/00-code/create_proc_entry/hello_proc.c diff --git a/study/debug/proc/00-code/create_proc_entry/hello_proc.c.bak b/study/debug/filesystem/procfs/00-code/create_proc_entry/hello_proc.c.bak similarity index 100% rename from study/debug/proc/00-code/create_proc_entry/hello_proc.c.bak rename to study/debug/filesystem/procfs/00-code/create_proc_entry/hello_proc.c.bak diff --git a/study/debug/proc/00-code/create_proc_entry/jif.c b/study/debug/filesystem/procfs/00-code/create_proc_entry/jif.c similarity index 100% rename from study/debug/proc/00-code/create_proc_entry/jif.c rename to study/debug/filesystem/procfs/00-code/create_proc_entry/jif.c diff --git a/study/debug/proc/00-code/create_proc_entry/test.c b/study/debug/filesystem/procfs/00-code/create_proc_entry/test.c similarity index 100% rename from study/debug/proc/00-code/create_proc_entry/test.c rename to study/debug/filesystem/procfs/00-code/create_proc_entry/test.c diff --git a/study/debug/proc/00-code/create_proc_entry/test2.c b/study/debug/filesystem/procfs/00-code/create_proc_entry/test2.c similarity index 100% rename from study/debug/proc/00-code/create_proc_entry/test2.c rename to study/debug/filesystem/procfs/00-code/create_proc_entry/test2.c diff --git a/study/debug/proc/00-code/proc_create/3.c b/study/debug/filesystem/procfs/00-code/proc_create/3.c similarity index 100% rename from study/debug/proc/00-code/proc_create/3.c rename to study/debug/filesystem/procfs/00-code/proc_create/3.c diff --git a/study/debug/proc/00-code/proc_create/Makefile b/study/debug/filesystem/procfs/00-code/proc_create/Makefile similarity index 100% rename from study/debug/proc/00-code/proc_create/Makefile rename to study/debug/filesystem/procfs/00-code/proc_create/Makefile diff --git a/study/debug/proc/00-code/proc_create/jif.c b/study/debug/filesystem/procfs/00-code/proc_create/jif.c similarity index 100% rename from study/debug/proc/00-code/proc_create/jif.c rename to study/debug/filesystem/procfs/00-code/proc_create/jif.c diff --git a/study/debug/proc/00-code/proc_create/test.c b/study/debug/filesystem/procfs/00-code/proc_create/test.c similarity index 100% rename from study/debug/proc/00-code/proc_create/test.c rename to study/debug/filesystem/procfs/00-code/proc_create/test.c diff --git a/study/debug/proc/00-code/proc_create/test2.c b/study/debug/filesystem/procfs/00-code/proc_create/test2.c similarity index 100% rename from study/debug/proc/00-code/proc_create/test2.c rename to study/debug/filesystem/procfs/00-code/proc_create/test2.c diff --git a/study/debug/proc/00-code/proc_create_data/Makefile b/study/debug/filesystem/procfs/00-code/proc_create_data/Makefile similarity index 100% rename from study/debug/proc/00-code/proc_create_data/Makefile rename to study/debug/filesystem/procfs/00-code/proc_create_data/Makefile diff --git a/study/debug/proc/00-code/proc_create_data/jif.c b/study/debug/filesystem/procfs/00-code/proc_create_data/jif.c similarity index 100% rename from study/debug/proc/00-code/proc_create_data/jif.c rename to study/debug/filesystem/procfs/00-code/proc_create_data/jif.c diff --git a/study/debug/proc/00-code/proc_final/Makefile b/study/debug/filesystem/procfs/00-code/proc_final/Makefile similarity index 100% rename from study/debug/proc/00-code/proc_final/Makefile rename to study/debug/filesystem/procfs/00-code/proc_final/Makefile diff --git a/study/debug/proc/00-code/proc_final/common.h b/study/debug/filesystem/procfs/00-code/proc_final/common.h similarity index 100% rename from study/debug/proc/00-code/proc_final/common.h rename to study/debug/filesystem/procfs/00-code/proc_final/common.h diff --git a/study/debug/proc/00-code/proc_final/config.h b/study/debug/filesystem/procfs/00-code/proc_final/config.h similarity index 100% rename from study/debug/proc/00-code/proc_final/config.h rename to study/debug/filesystem/procfs/00-code/proc_final/config.h diff --git a/study/debug/proc/00-code/proc_final/main.c b/study/debug/filesystem/procfs/00-code/proc_final/main.c similarity index 100% rename from study/debug/proc/00-code/proc_final/main.c rename to study/debug/filesystem/procfs/00-code/proc_final/main.c diff --git a/study/debug/proc/00-code/proc_final/main.h b/study/debug/filesystem/procfs/00-code/proc_final/main.h similarity index 100% rename from study/debug/proc/00-code/proc_final/main.h rename to study/debug/filesystem/procfs/00-code/proc_final/main.h diff --git a/study/debug/proc/00-code/proc_final/ro.c b/study/debug/filesystem/procfs/00-code/proc_final/ro.c similarity index 100% rename from study/debug/proc/00-code/proc_final/ro.c rename to study/debug/filesystem/procfs/00-code/proc_final/ro.c diff --git a/study/debug/proc/00-code/proc_final/rw.c b/study/debug/filesystem/procfs/00-code/proc_final/rw.c similarity index 100% rename from study/debug/proc/00-code/proc_final/rw.c rename to study/debug/filesystem/procfs/00-code/proc_final/rw.c diff --git a/study/debug/proc/00-code/proc_final/wo.c b/study/debug/filesystem/procfs/00-code/proc_final/wo.c similarity index 100% rename from study/debug/proc/00-code/proc_final/wo.c rename to study/debug/filesystem/procfs/00-code/proc_final/wo.c diff --git a/study/debug/proc/00-code/seq_file_exam/Makefile b/study/debug/filesystem/procfs/00-code/seq_file_exam/Makefile similarity index 100% rename from study/debug/proc/00-code/seq_file_exam/Makefile rename to study/debug/filesystem/procfs/00-code/seq_file_exam/Makefile diff --git a/study/debug/proc/00-code/seq_file_exam/seq_file_exam.c b/study/debug/filesystem/procfs/00-code/seq_file_exam/seq_file_exam.c similarity index 100% rename from study/debug/proc/00-code/seq_file_exam/seq_file_exam.c rename to study/debug/filesystem/procfs/00-code/seq_file_exam/seq_file_exam.c diff --git a/study/debug/proc/README.md b/study/debug/filesystem/procfs/README.md similarity index 100% rename from study/debug/proc/README.md rename to study/debug/filesystem/procfs/README.md diff --git a/study/debug/relayfs/README.md b/study/debug/filesystem/relayfs/README.md similarity index 100% rename from study/debug/relayfs/README.md rename to study/debug/filesystem/relayfs/README.md diff --git a/study/debug/filesystem/sysfs/README.md b/study/debug/filesystem/sysfs/README.md new file mode 100644 index 0000000..01617a9 --- /dev/null +++ b/study/debug/filesystem/sysfs/README.md @@ -0,0 +1 @@ +[用户空间与内核空间数据交换的方式(4)------relayfs](http://www.cnblogs.com/hoys/archive/2011/04/10/2011270.html) \ No newline at end of file diff --git a/study/debug/kprobe/00-code/Makefile b/study/debug/modules/kprobe/00-code/Makefile similarity index 100% rename from study/debug/kprobe/00-code/Makefile rename to study/debug/modules/kprobe/00-code/Makefile diff --git a/study/debug/kprobe/00-code/hw_breakpoint/Makefile b/study/debug/modules/kprobe/00-code/hw_breakpoint/Makefile similarity index 100% rename from study/debug/kprobe/00-code/hw_breakpoint/Makefile rename to study/debug/modules/kprobe/00-code/hw_breakpoint/Makefile diff --git a/study/debug/kprobe/00-code/hw_breakpoint/data_breakpoint.c b/study/debug/modules/kprobe/00-code/hw_breakpoint/data_breakpoint.c similarity index 100% rename from study/debug/kprobe/00-code/hw_breakpoint/data_breakpoint.c rename to study/debug/modules/kprobe/00-code/hw_breakpoint/data_breakpoint.c diff --git a/study/debug/kprobe/00-code/jprobe/Makefile b/study/debug/modules/kprobe/00-code/jprobe/Makefile similarity index 100% rename from study/debug/kprobe/00-code/jprobe/Makefile rename to study/debug/modules/kprobe/00-code/jprobe/Makefile diff --git a/study/debug/kprobe/00-code/jprobe/jprobe-exam.c b/study/debug/modules/kprobe/00-code/jprobe/jprobe-exam.c similarity index 100% rename from study/debug/kprobe/00-code/jprobe/jprobe-exam.c rename to study/debug/modules/kprobe/00-code/jprobe/jprobe-exam.c diff --git a/study/debug/kprobe/00-code/kprobe/Makefile b/study/debug/modules/kprobe/00-code/kprobe/Makefile similarity index 100% rename from study/debug/kprobe/00-code/kprobe/Makefile rename to study/debug/modules/kprobe/00-code/kprobe/Makefile diff --git a/study/debug/kprobe/00-code/kprobe/README.md b/study/debug/modules/kprobe/00-code/kprobe/README.md similarity index 100% rename from study/debug/kprobe/00-code/kprobe/README.md rename to study/debug/modules/kprobe/00-code/kprobe/README.md diff --git a/study/debug/kprobe/00-code/kprobe/kprobe-exam.c b/study/debug/modules/kprobe/00-code/kprobe/kprobe-exam.c similarity index 100% rename from study/debug/kprobe/00-code/kprobe/kprobe-exam.c rename to study/debug/modules/kprobe/00-code/kprobe/kprobe-exam.c diff --git a/study/debug/kprobe/00-code/kretprobe/Makefile b/study/debug/modules/kprobe/00-code/kretprobe/Makefile similarity index 100% rename from study/debug/kprobe/00-code/kretprobe/Makefile rename to study/debug/modules/kprobe/00-code/kretprobe/Makefile diff --git a/study/debug/kprobe/00-code/kretprobe/kretprobe-exam.c b/study/debug/modules/kprobe/00-code/kretprobe/kretprobe-exam.c similarity index 100% rename from study/debug/kprobe/00-code/kretprobe/kretprobe-exam.c rename to study/debug/modules/kprobe/00-code/kretprobe/kretprobe-exam.c diff --git a/study/debug/kprobe/00-code/test.c b/study/debug/modules/kprobe/00-code/test.c similarity index 100% rename from study/debug/kprobe/00-code/test.c rename to study/debug/modules/kprobe/00-code/test.c diff --git a/study/debug/kprobe/00-code/testvfork.c b/study/debug/modules/kprobe/00-code/testvfork.c similarity index 100% rename from study/debug/kprobe/00-code/testvfork.c rename to study/debug/modules/kprobe/00-code/testvfork.c diff --git a/study/debug/trace/00-code/ftrace_demo/Makefile b/study/debug/modules/trace/00-code/ftrace_demo/Makefile similarity index 100% rename from study/debug/trace/00-code/ftrace_demo/Makefile rename to study/debug/modules/trace/00-code/ftrace_demo/Makefile diff --git a/study/debug/trace/00-code/ftrace_demo/ftrace_demo.c b/study/debug/modules/trace/00-code/ftrace_demo/ftrace_demo.c similarity index 100% rename from study/debug/trace/00-code/ftrace_demo/ftrace_demo.c rename to study/debug/modules/trace/00-code/ftrace_demo/ftrace_demo.c diff --git a/study/debug/trace/00-code/trace-events-sample/Makefile b/study/debug/modules/trace/00-code/trace-events-sample/Makefile similarity index 100% rename from study/debug/trace/00-code/trace-events-sample/Makefile rename to study/debug/modules/trace/00-code/trace-events-sample/Makefile diff --git a/study/debug/trace/00-code/trace-events-sample/README.md b/study/debug/modules/trace/00-code/trace-events-sample/README.md similarity index 100% rename from study/debug/trace/00-code/trace-events-sample/README.md rename to study/debug/modules/trace/00-code/trace-events-sample/README.md diff --git a/study/debug/trace/00-code/trace-events-sample/trace-events-sample.c b/study/debug/modules/trace/00-code/trace-events-sample/trace-events-sample.c similarity index 100% rename from study/debug/trace/00-code/trace-events-sample/trace-events-sample.c rename to study/debug/modules/trace/00-code/trace-events-sample/trace-events-sample.c diff --git a/study/debug/trace/00-code/trace-events-sample/trace-events-sample.h b/study/debug/modules/trace/00-code/trace-events-sample/trace-events-sample.h similarity index 100% rename from study/debug/trace/00-code/trace-events-sample/trace-events-sample.h rename to study/debug/modules/trace/00-code/trace-events-sample/trace-events-sample.h diff --git a/study/debug/systemtap/README.md b/study/debug/tools/kgtp/README.md similarity index 100% rename from study/debug/systemtap/README.md rename to study/debug/tools/kgtp/README.md diff --git a/study/debug/tools/perf/README.md b/study/debug/tools/perf/README.md new file mode 100644 index 0000000..b4ae80b --- /dev/null +++ b/study/debug/tools/perf/README.md @@ -0,0 +1,5 @@ +http://www.cnblogs.com/hazir/p/systemtap_introduction.html + +http://ddebs.ubuntu.com/pool/main/l/linux/ + +http://www.ibm.com/developerworks/cn/linux/l-cn-systemtap3/ \ No newline at end of file diff --git a/study/debug/tools/systemtap/README.md b/study/debug/tools/systemtap/README.md new file mode 100644 index 0000000..b4ae80b --- /dev/null +++ b/study/debug/tools/systemtap/README.md @@ -0,0 +1,5 @@ +http://www.cnblogs.com/hazir/p/systemtap_introduction.html + +http://ddebs.ubuntu.com/pool/main/l/linux/ + +http://www.ibm.com/developerworks/cn/linux/l-cn-systemtap3/ \ No newline at end of file diff --git a/study/debug/tools/trace-cmd/README.md b/study/debug/tools/trace-cmd/README.md new file mode 100644 index 0000000..b4ae80b --- /dev/null +++ b/study/debug/tools/trace-cmd/README.md @@ -0,0 +1,5 @@ +http://www.cnblogs.com/hazir/p/systemtap_introduction.html + +http://ddebs.ubuntu.com/pool/main/l/linux/ + +http://www.ibm.com/developerworks/cn/linux/l-cn-systemtap3/ \ No newline at end of file