diff options
author | David Vrabel <david.vrabel@csr.com> | 2009-01-02 08:17:13 -0500 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2009-01-02 08:17:13 -0500 |
commit | b21a207141d83a06abc5f492b80204602e02ca44 (patch) | |
tree | f0152cde543008c72d7eb5c12c18095ad92785e6 /Documentation/markers.txt | |
parent | 3af373021fa32f8f787bfbdcc1a9277a287bde4e (diff) | |
parent | b58602a4bac012b5f4fc12fe6b46ab237b610d5d (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream
Conflicts:
drivers/uwb/wlp/eda.c
Diffstat (limited to 'Documentation/markers.txt')
-rw-r--r-- | Documentation/markers.txt | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/Documentation/markers.txt b/Documentation/markers.txt index 089f6138fcd9..d2b3d0e91b26 100644 --- a/Documentation/markers.txt +++ b/Documentation/markers.txt | |||
@@ -51,11 +51,16 @@ to call) for the specific marker through marker_probe_register() and can be | |||
51 | activated by calling marker_arm(). Marker deactivation can be done by calling | 51 | activated by calling marker_arm(). Marker deactivation can be done by calling |
52 | marker_disarm() as many times as marker_arm() has been called. Removing a probe | 52 | marker_disarm() as many times as marker_arm() has been called. Removing a probe |
53 | is done through marker_probe_unregister(); it will disarm the probe. | 53 | is done through marker_probe_unregister(); it will disarm the probe. |
54 | marker_synchronize_unregister() must be called before the end of the module exit | 54 | |
55 | function to make sure there is no caller left using the probe. This, and the | 55 | marker_synchronize_unregister() must be called between probe unregistration and |
56 | fact that preemption is disabled around the probe call, make sure that probe | 56 | the first occurrence of |
57 | removal and module unload are safe. See the "Probe example" section below for a | 57 | - the end of module exit function, |
58 | sample probe module. | 58 | to make sure there is no caller left using the probe; |
59 | - the free of any resource used by the probes, | ||
60 | to make sure the probes wont be accessing invalid data. | ||
61 | This, and the fact that preemption is disabled around the probe call, make sure | ||
62 | that probe removal and module unload are safe. See the "Probe example" section | ||
63 | below for a sample probe module. | ||
59 | 64 | ||
60 | The marker mechanism supports inserting multiple instances of the same marker. | 65 | The marker mechanism supports inserting multiple instances of the same marker. |
61 | Markers can be put in inline functions, inlined static functions, and | 66 | Markers can be put in inline functions, inlined static functions, and |
@@ -70,6 +75,20 @@ a printk warning which identifies the inconsistency: | |||
70 | 75 | ||
71 | "Format mismatch for probe probe_name (format), marker (format)" | 76 | "Format mismatch for probe probe_name (format), marker (format)" |
72 | 77 | ||
78 | Another way to use markers is to simply define the marker without generating any | ||
79 | function call to actually call into the marker. This is useful in combination | ||
80 | with tracepoint probes in a scheme like this : | ||
81 | |||
82 | void probe_tracepoint_name(unsigned int arg1, struct task_struct *tsk); | ||
83 | |||
84 | DEFINE_MARKER_TP(marker_eventname, tracepoint_name, probe_tracepoint_name, | ||
85 | "arg1 %u pid %d"); | ||
86 | |||
87 | notrace void probe_tracepoint_name(unsigned int arg1, struct task_struct *tsk) | ||
88 | { | ||
89 | struct marker *marker = &GET_MARKER(kernel_irq_entry); | ||
90 | /* write data to trace buffers ... */ | ||
91 | } | ||
73 | 92 | ||
74 | * Probe / marker example | 93 | * Probe / marker example |
75 | 94 | ||