diff options
Diffstat (limited to 'Documentation/kprobes.txt')
-rw-r--r-- | Documentation/kprobes.txt | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index d71fafffce90..da5404ab7569 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -14,6 +14,7 @@ CONTENTS | |||
14 | 8. Kprobes Example | 14 | 8. Kprobes Example |
15 | 9. Jprobes Example | 15 | 9. Jprobes Example |
16 | 10. Kretprobes Example | 16 | 10. Kretprobes Example |
17 | Appendix A: The kprobes debugfs interface | ||
17 | 18 | ||
18 | 1. Concepts: Kprobes, Jprobes, Return Probes | 19 | 1. Concepts: Kprobes, Jprobes, Return Probes |
19 | 20 | ||
@@ -349,9 +350,12 @@ for instrumentation and error reporting.) | |||
349 | 350 | ||
350 | If the number of times a function is called does not match the number | 351 | If the number of times a function is called does not match the number |
351 | of times it returns, registering a return probe on that function may | 352 | of times it returns, registering a return probe on that function may |
352 | produce undesirable results. We have the do_exit() case covered. | 353 | produce undesirable results. In such a case, a line: |
353 | do_execve() and do_fork() are not an issue. We're unaware of other | 354 | kretprobe BUG!: Processing kretprobe d000000000041aa8 @ c00000000004f48c |
354 | specific cases where this could be a problem. | 355 | gets printed. With this information, one will be able to correlate the |
356 | exact instance of the kretprobe that caused the problem. We have the | ||
357 | do_exit() case covered. do_execve() and do_fork() are not an issue. | ||
358 | We're unaware of other specific cases where this could be a problem. | ||
355 | 359 | ||
356 | If, upon entry to or exit from a function, the CPU is running on | 360 | If, upon entry to or exit from a function, the CPU is running on |
357 | a stack other than that of the current task, registering a return | 361 | a stack other than that of the current task, registering a return |
@@ -614,3 +618,27 @@ http://www-106.ibm.com/developerworks/library/l-kprobes.html?ca=dgr-lnxw42Kprobe | |||
614 | http://www.redhat.com/magazine/005mar05/features/kprobes/ | 618 | http://www.redhat.com/magazine/005mar05/features/kprobes/ |
615 | http://www-users.cs.umn.edu/~boutcher/kprobes/ | 619 | http://www-users.cs.umn.edu/~boutcher/kprobes/ |
616 | http://www.linuxsymposium.org/2006/linuxsymposium_procv2.pdf (pages 101-115) | 620 | http://www.linuxsymposium.org/2006/linuxsymposium_procv2.pdf (pages 101-115) |
621 | |||
622 | |||
623 | Appendix A: The kprobes debugfs interface | ||
624 | |||
625 | With recent kernels (> 2.6.20) the list of registered kprobes is visible | ||
626 | under the /debug/kprobes/ directory (assuming debugfs is mounted at /debug). | ||
627 | |||
628 | /debug/kprobes/list: Lists all registered probes on the system | ||
629 | |||
630 | c015d71a k vfs_read+0x0 | ||
631 | c011a316 j do_fork+0x0 | ||
632 | c03dedc5 r tcp_v4_rcv+0x0 | ||
633 | |||
634 | The first column provides the kernel address where the probe is inserted. | ||
635 | The second column identifies the type of probe (k - kprobe, r - kretprobe | ||
636 | and j - jprobe), while the third column specifies the symbol+offset of | ||
637 | the probe. If the probed function belongs to a module, the module name | ||
638 | is also specified. | ||
639 | |||
640 | /debug/kprobes/enabled: Turn kprobes ON/OFF | ||
641 | |||
642 | Provides a knob to globally turn registered kprobes ON or OFF. By default, | ||
643 | all kprobes are enabled. By echoing "0" to this file, all registered probes | ||
644 | will be disarmed, till such time a "1" is echoed to this file. | ||