summaryrefslogtreecommitdiffstats
path: root/runtime/docs/html/stp__tasklet_8c-source.html
blob: 93f8b84c542ecb203de2ee574f1e90f43a8e6bac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>SystemTap: probes/tasklet/stp_tasklet.c Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.1 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">probes</a>&nbsp;/&nbsp;<a class="el" href="dir_000002.html">tasklet</a></div>
<h1>stp_tasklet.c</h1><div class="fragment"><pre class="fragment">00001 <span class="comment">/* Framework for putting a jprobe in a tasklet. */</span>
00002 <span class="comment">/* Useful for testing probes in interrupt context. */</span>
00003 <span class="comment">/* Doesn't do anything useful as is.  Put test code in the inst func */</span>
00004 
00005 <span class="preprocessor">#define HASH_TABLE_BITS 8</span>
00006 <span class="preprocessor"></span><span class="preprocessor">#define HASH_TABLE_SIZE (1&lt;&lt;HASH_TABLE_BITS)</span>
00007 <span class="preprocessor"></span><span class="preprocessor">#define BUCKETS 16 </span><span class="comment">/* largest histogram width */</span>
00008 
00009 <span class="preprocessor">#include "runtime.h"</span>
00010 <span class="preprocessor">#include "<a class="code" href="io_8c.html">io.c</a>"</span>
00011 <span class="preprocessor">#include "<a class="code" href="probes_8c.html">probes.c</a>"</span>
00012 
00013 MODULE_DESCRIPTION(<span class="stringliteral">"test jprobes of tasklets"</span>);
00014 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt &lt;hunt@redhat.com&gt;"</span>);
00015 
00016 <span class="keywordtype">void</span> inst__rcu_process_callbacks(<span class="keyword">struct</span> rcu_ctrlblk *rcp,
00017                                  <span class="keyword">struct</span> rcu_state *rsp, <span class="keyword">struct</span> rcu_data *rdp)
00018 {
00019   <a class="code" href="io_8c.html#a4">dlog</a> (<span class="stringliteral">"interrupt=%d\n"</span>, in_interrupt());
00020   jprobe_return();
00021 }
00022 
00023 <span class="keyword">static</span> <span class="keyword">struct </span>jprobe stp_probes[] = {
00024   {
00025     .kp.addr =  (kprobe_opcode_t *)<span class="stringliteral">"__rcu_process_callbacks"</span>,
00026     .entry = (kprobe_opcode_t *) inst__rcu_process_callbacks
00027   },
00028 };
00029 <span class="preprocessor">#define MAX_STP_PROBES (sizeof(stp_probes)/sizeof(struct jprobe))</span>
00030 <span class="preprocessor"></span>
00031 
00032 <span class="keyword">static</span> <span class="keywordtype">int</span> init_stp(<span class="keywordtype">void</span>)
00033 {
00034   <span class="keywordtype">int</span> ret = <a class="code" href="probes_8c.html#a2">_stp_register_jprobes</a> (stp_probes, MAX_STP_PROBES);
00035   <a class="code" href="io_8c.html#a4">dlog</a>(<span class="stringliteral">"instrumentation is enabled...\n"</span>);
00036   <span class="keywordflow">return</span> ret;
00037 }
00038 
00039 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_stp(<span class="keywordtype">void</span>)
00040 {
00041   <a class="code" href="probes_8c.html#a1">_stp_unregister_jprobes</a> (stp_probes, MAX_STP_PROBES);
00042   <a class="code" href="io_8c.html#a4">dlog</a> (<span class="stringliteral">"EXIT\n"</span>);
00043 }
00044 
00045 module_init(init_stp);
00046 module_exit(cleanup_stp);
00047 MODULE_LICENSE(<span class="stringliteral">"GPL"</span>);
00048 
</pre></div><hr size="1"><address style="align: right;"><small>
Generated on Tue Mar 22 10:27:36 2005 for SystemTap.</small></body>
</html>