aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@redhat.com>2008-04-28 05:14:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:32 -0400
commit3b0cb4caefeca6fe6b05c6c5a76e9c633b44c58f (patch)
treecf7072f0a2a3f53b1eb36b23c17db8d4a74369c9 /Documentation
parent26b31c1908e02a316edfba08080373342e662c14 (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.txt51
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
37the probe is to be inserted and what handler is to be called when 37the probe is to be inserted and what handler is to be called when
38the probe is hit. 38the probe is hit.
39 39
40There are also register_/unregister_*probes() functions for batch
41registration/unregistration of a group of *probes. These functions
42can speed up unregistration process when you have to unregister
43a lot of probes at once.
44
40The next three subsections explain how the different types of 45The next three subsections explain how the different types of
41probes work. They explain certain things that you'll need to 46probes work. They explain certain things that you'll need to
42know in order to make the best use of Kprobes -- e.g., the 47know in order to make the best use of Kprobes -- e.g., the
@@ -190,10 +195,11 @@ code mapping.
1904. API Reference 1954. API Reference
191 196
192The Kprobes API includes a "register" function and an "unregister" 197The Kprobes API includes a "register" function and an "unregister"
193function for each type of probe. Here are terse, mini-man-page 198function for each type of probe. The API also includes "register_*probes"
194specifications for these functions and the associated probe handlers 199and "unregister_*probes" functions for (un)registering arrays of probes.
195that you'll write. See the files in the samples/kprobes/ sub-directory 200Here are terse, mini-man-page specifications for these functions and
196for examples. 201the associated probe handlers that you'll write. See the files in the
202samples/kprobes/ sub-directory for examples.
197 203
1984.1 register_kprobe 2044.1 register_kprobe
199 205
@@ -319,6 +325,43 @@ void unregister_kretprobe(struct kretprobe *rp);
319Removes the specified probe. The unregister function can be called 325Removes the specified probe. The unregister function can be called
320at any time after the probe has been registered. 326at any time after the probe has been registered.
321 327
328NOTE:
329If the functions find an incorrect probe (ex. an unregistered probe),
330they clear the addr field of the probe.
331
3324.5 register_*probes
333
334#include <linux/kprobes.h>
335int register_kprobes(struct kprobe **kps, int num);
336int register_kretprobes(struct kretprobe **rps, int num);
337int register_jprobes(struct jprobe **jps, int num);
338
339Registers each of the num probes in the specified array. If any
340error occurs during registration, all probes in the array, up to
341the bad probe, are safely unregistered before the register_*probes
342function returns.
343- kps/rps/jps: an array of pointers to *probe data structures
344- num: the number of the array entries.
345
346NOTE:
347You have to allocate(or define) an array of pointers and set all
348of the array entries before using these functions.
349
3504.6 unregister_*probes
351
352#include <linux/kprobes.h>
353void unregister_kprobes(struct kprobe **kps, int num);
354void unregister_kretprobes(struct kretprobe **rps, int num);
355void unregister_jprobes(struct jprobe **jps, int num);
356
357Removes each of the num probes in the specified array at once.
358
359NOTE:
360If the functions find some incorrect probes (ex. unregistered
361probes) in the specified array, they clear the addr field of those
362incorrect probes. However, other probes in the array are
363unregistered correctly.
364
3225. Kprobes Features and Limitations 3655. Kprobes Features and Limitations
323 366
324Kprobes allows multiple probes at the same address. Currently, 367Kprobes allows multiple probes at the same address. Currently,