diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2008-04-28 05:14:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:32 -0400 |
commit | 3b0cb4caefeca6fe6b05c6c5a76e9c633b44c58f (patch) | |
tree | cf7072f0a2a3f53b1eb36b23c17db8d4a74369c9 /Documentation | |
parent | 26b31c1908e02a316edfba08080373342e662c14 (diff) |
kprobes: update document about batch registration
Add the description of batch registration interfaces to
Documentation/kprobes.txt.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Cc: Shaohua Li <shaohua.li@intel.com>
Cc: David Miller <davem@davemloft.net>
Cc: "Frank Ch. Eigler" <fche@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/kprobes.txt | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/Documentation/kprobes.txt b/Documentation/kprobes.txt index be89f393274f..6877e7187113 100644 --- a/Documentation/kprobes.txt +++ b/Documentation/kprobes.txt | |||
@@ -37,6 +37,11 @@ registration function such as register_kprobe() specifies where | |||
37 | the probe is to be inserted and what handler is to be called when | 37 | the probe is to be inserted and what handler is to be called when |
38 | the probe is hit. | 38 | the probe is hit. |
39 | 39 | ||
40 | There are also register_/unregister_*probes() functions for batch | ||
41 | registration/unregistration of a group of *probes. These functions | ||
42 | can speed up unregistration process when you have to unregister | ||
43 | a lot of probes at once. | ||
44 | |||
40 | The next three subsections explain how the different types of | 45 | The next three subsections explain how the different types of |
41 | probes work. They explain certain things that you'll need to | 46 | probes work. They explain certain things that you'll need to |
42 | know in order to make the best use of Kprobes -- e.g., the | 47 | know in order to make the best use of Kprobes -- e.g., the |
@@ -190,10 +195,11 @@ code mapping. | |||
190 | 4. API Reference | 195 | 4. API Reference |
191 | 196 | ||
192 | The Kprobes API includes a "register" function and an "unregister" | 197 | The Kprobes API includes a "register" function and an "unregister" |
193 | function for each type of probe. Here are terse, mini-man-page | 198 | function for each type of probe. The API also includes "register_*probes" |
194 | specifications for these functions and the associated probe handlers | 199 | and "unregister_*probes" functions for (un)registering arrays of probes. |
195 | that you'll write. See the files in the samples/kprobes/ sub-directory | 200 | Here are terse, mini-man-page specifications for these functions and |
196 | for examples. | 201 | the associated probe handlers that you'll write. See the files in the |
202 | samples/kprobes/ sub-directory for examples. | ||
197 | 203 | ||
198 | 4.1 register_kprobe | 204 | 4.1 register_kprobe |
199 | 205 | ||
@@ -319,6 +325,43 @@ void unregister_kretprobe(struct kretprobe *rp); | |||
319 | Removes the specified probe. The unregister function can be called | 325 | Removes the specified probe. The unregister function can be called |
320 | at any time after the probe has been registered. | 326 | at any time after the probe has been registered. |
321 | 327 | ||
328 | NOTE: | ||
329 | If the functions find an incorrect probe (ex. an unregistered probe), | ||
330 | they clear the addr field of the probe. | ||
331 | |||
332 | 4.5 register_*probes | ||
333 | |||
334 | #include <linux/kprobes.h> | ||
335 | int register_kprobes(struct kprobe **kps, int num); | ||
336 | int register_kretprobes(struct kretprobe **rps, int num); | ||
337 | int register_jprobes(struct jprobe **jps, int num); | ||
338 | |||
339 | Registers each of the num probes in the specified array. If any | ||
340 | error occurs during registration, all probes in the array, up to | ||
341 | the bad probe, are safely unregistered before the register_*probes | ||
342 | function returns. | ||
343 | - kps/rps/jps: an array of pointers to *probe data structures | ||
344 | - num: the number of the array entries. | ||
345 | |||
346 | NOTE: | ||
347 | You have to allocate(or define) an array of pointers and set all | ||
348 | of the array entries before using these functions. | ||
349 | |||
350 | 4.6 unregister_*probes | ||
351 | |||
352 | #include <linux/kprobes.h> | ||
353 | void unregister_kprobes(struct kprobe **kps, int num); | ||
354 | void unregister_kretprobes(struct kretprobe **rps, int num); | ||
355 | void unregister_jprobes(struct jprobe **jps, int num); | ||
356 | |||
357 | Removes each of the num probes in the specified array at once. | ||
358 | |||
359 | NOTE: | ||
360 | If the functions find some incorrect probes (ex. unregistered | ||
361 | probes) in the specified array, they clear the addr field of those | ||
362 | incorrect probes. However, other probes in the array are | ||
363 | unregistered correctly. | ||
364 | |||
322 | 5. Kprobes Features and Limitations | 365 | 5. Kprobes Features and Limitations |
323 | 366 | ||
324 | Kprobes allows multiple probes at the same address. Currently, | 367 | Kprobes allows multiple probes at the same address. Currently, |