summaryrefslogtreecommitdiffstats
path: root/runtime/docs/html/test4_2dtr_8c-source.html
diff options
context:
space:
mode:
authorhunt <hunt>2005-03-22 08:57:11 +0000
committerhunt <hunt>2005-03-22 08:57:11 +0000
commitb9c556e44326b40b2c927a0a5b5626332a8c9587 (patch)
treed0497c9323dedcb292d353d79fef769fa6fef210 /runtime/docs/html/test4_2dtr_8c-source.html
parent4a4753cb066f60eb09906a6021997ec280d3fdc5 (diff)
downloadsystemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.tar.gz
systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.tar.xz
systemtap-steved-b9c556e44326b40b2c927a0a5b5626332a8c9587.zip
*** empty log message ***
Diffstat (limited to 'runtime/docs/html/test4_2dtr_8c-source.html')
-rw-r--r--runtime/docs/html/test4_2dtr_8c-source.html117
1 files changed, 117 insertions, 0 deletions
diff --git a/runtime/docs/html/test4_2dtr_8c-source.html b/runtime/docs/html/test4_2dtr_8c-source.html
new file mode 100644
index 00000000..21acb158
--- /dev/null
+++ b/runtime/docs/html/test4_2dtr_8c-source.html
@@ -0,0 +1,117 @@
+<!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/test4/dtr.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_000003.html">test4</a></div>
+<h1>dtr.c</h1><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#define HASH_TABLE_BITS 8</span>
+00002 <span class="preprocessor"></span><span class="preprocessor">#define HASH_TABLE_SIZE (1&lt;&lt;HASH_TABLE_BITS)</span>
+00003 <span class="preprocessor"></span><span class="preprocessor">#define BUCKETS 16 </span><span class="comment">/* largest histogram width */</span>
+00004
+00005 <span class="preprocessor">#include "runtime.h"</span>
+00006 <span class="preprocessor">#include "io.c"</span>
+00007 <span class="preprocessor">#include "<a class="code" href="map_8c.html">map.c</a>"</span>
+00008 <span class="preprocessor">#include "probes.c"</span>
+00009
+00010 MODULE_DESCRIPTION(<span class="stringliteral">"SystemTap probe: test4"</span>);
+00011 MODULE_AUTHOR(<span class="stringliteral">"Martin Hunt &lt;hunt@redhat.com&gt;"</span>);
+00012
+00013 <a class="code" href="structmap__root.html">MAP</a> opens, reads, writes;
+00014
+00015 asmlinkage <span class="keywordtype">long</span> inst_sys_open (<span class="keyword">const</span> <span class="keywordtype">char</span> __user * filename, <span class="keywordtype">int</span> flags, <span class="keywordtype">int</span> mode)
+00016 {
+00017 <a class="code" href="map_8c.html#a13">_stp_map_key_str</a> (opens, current-&gt;comm);
+00018 <a class="code" href="map_8c.html#a18">_stp_map_add_int64</a> (opens, 1);
+00019 jprobe_return();
+00020 <span class="keywordflow">return</span> 0;
+00021 }
+00022
+00023 asmlinkage ssize_t inst_sys_read (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keywordtype">char</span> __user * buf, size_t count)
+00024 {
+00025 <a class="code" href="map_8c.html#a13">_stp_map_key_str</a> (reads, current-&gt;comm);
+00026 <a class="code" href="map_8c.html#a24">_stp_map_stat_add</a> (reads, count);
+00027 jprobe_return();
+00028 <span class="keywordflow">return</span> 0;
+00029 }
+00030
+00031 asmlinkage ssize_t inst_sys_write (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> fd, <span class="keyword">const</span> <span class="keywordtype">char</span> __user * buf, size_t count)
+00032 {
+00033 <a class="code" href="map_8c.html#a13">_stp_map_key_str</a> (writes, current-&gt;comm);
+00034 <a class="code" href="map_8c.html#a24">_stp_map_stat_add</a> (writes, count);
+00035 jprobe_return();
+00036 <span class="keywordflow">return</span> 0;
+00037 }
+00038
+00039 <span class="keyword">static</span> <span class="keyword">struct </span>jprobe dtr_probes[] = {
+00040 {
+00041 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_open"</span>,
+00042 .entry = (kprobe_opcode_t *) inst_sys_open
+00043 },
+00044 {
+00045 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_read"</span>,
+00046 .entry = (kprobe_opcode_t *) inst_sys_read
+00047 },
+00048 {
+00049 .kp.addr = (kprobe_opcode_t *)<span class="stringliteral">"sys_write"</span>,
+00050 .entry = (kprobe_opcode_t *) inst_sys_write
+00051 },
+00052 };
+00053
+00054 <span class="preprocessor">#define MAX_DTR_ROUTINE (sizeof(dtr_probes)/sizeof(struct jprobe))</span>
+00055 <span class="preprocessor"></span>
+00056 <span class="keyword">static</span> <span class="keywordtype">int</span> init_dtr(<span class="keywordtype">void</span>)
+00057 {
+00058 <span class="keywordtype">int</span> ret;
+00059
+00060 opens = <a class="code" href="map_8c.html#a3">_stp_map_new</a> (1000, INT64);
+00061 reads = <a class="code" href="map_8c.html#a3">_stp_map_new</a> (1000, STAT);
+00062 writes = <a class="code" href="map_8c.html#a3">_stp_map_new</a> (1000, STAT);
+00063
+00064 ret = _stp_register_jprobes (dtr_probes, MAX_DTR_ROUTINE);
+00065
+00066 dlog(<span class="stringliteral">"instrumentation is enabled...\n"</span>);
+00067 <span class="keywordflow">return</span> ret;
+00068
+00069 }
+00070
+00071 <span class="keyword">static</span> <span class="keywordtype">void</span> cleanup_dtr(<span class="keywordtype">void</span>)
+00072 {
+00073 <span class="keyword">struct </span>map_node_stat *st;
+00074 <span class="keyword">struct </span>map_node_int64 *ptr;
+00075
+00076 _stp_unregister_jprobes (dtr_probes, MAX_DTR_ROUTINE);
+00077
+00078 <span class="keywordflow">for</span> (ptr = (<span class="keyword">struct</span> map_node_int64 *)<a class="code" href="map_8c.html#a6">_stp_map_start</a>(opens); ptr;
+00079 ptr = (<span class="keyword">struct</span> map_node_int64 *)_stp_map_iter (opens,(<span class="keyword">struct</span> <a class="code" href="structmap__node.html">map_node</a> *)ptr))
+00080 dlog ("opens[%s] = %lld\n", key1str(ptr), ptr-&gt;val);
+00081 dlog ("\n");
+00082
+00083 for (st = (struct map_node_stat *)_stp_map_start(reads); st;
+00084 st = (struct map_node_stat *)_stp_map_iter (reads,(struct <a class="code" href="structmap__node.html">map_node</a> *)st))
+00085 dlog ("reads[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n", key1str(st), st-&gt;stats.count, st-&gt;stats.sum,
+00086 st-&gt;stats.min, st-&gt;stats.max);
+00087 dlog ("\n");
+00088
+00089 for (st = (struct map_node_stat *)_stp_map_start(writes); st;
+00090 st = (struct map_node_stat *)_stp_map_iter (writes,(struct <a class="code" href="structmap__node.html">map_node</a> *)st))
+00091 dlog ("writes[%s] = [count=%lld sum=%lld min=%lld max=%lld]\n", key1str(st), st-&gt;stats.count, st-&gt;stats.sum,
+00092 st-&gt;stats.min, st-&gt;stats.max);
+00093 dlog ("\n");
+00094
+00095 _stp_map_del (opens);
+00096 _stp_map_del (reads);
+00097 _stp_map_del (writes);
+00098
+00099 dlog("EXIT\n");
+00100 }
+00101
+00102 module_init(init_dtr);
+00103 module_exit(cleanup_dtr);
+00104 MODULE_LICENSE("GPL");
+00105
+</pre></div><hr size="1"><address style="align: right;"><small>
+Generated on Tue Mar 22 00:32:02 2005 for SystemTap.</small></body>
+</html>