blob: 064ef3f85bdf40b1d90befb252ebff05c7a7899c (
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
<!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: io.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 Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>io.c</h1><a href="io_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="preprocessor">#ifndef _IO_C_</span>
00002 <span class="preprocessor"></span><span class="preprocessor">#define _IO_C_</span>
00003 <span class="preprocessor"></span>
00004 <span class="comment">/* -*- linux-c -*- */</span><span class="comment"></span>
00005 <span class="comment">/** @file io.c</span>
00006 <span class="comment"> * @brief I/O functions</span>
00007 <span class="comment"> */</span><span class="comment"></span>
00008 <span class="comment">/** @addtogroup io I/O</span>
00009 <span class="comment"> * I/O functions</span>
00010 <span class="comment"> * @{</span>
00011 <span class="comment"> */</span>
00012 <span class="comment"></span>
00013 <span class="comment">/** Logs Data.</span>
00014 <span class="comment"> * This function is compatible with printk. In fact it currently</span>
00015 <span class="comment"> * sends all output to vprintk, after sending "STP: ". This allows</span>
00016 <span class="comment"> * us to easily detect SystemTap output in the log file. </span>
00017 <span class="comment"> *</span>
00018 <span class="comment"> * @param fmt A variable number of args.</span>
00019 <span class="comment"> * @bug Lines are limited in length by printk buffer. If there is</span>
00020 <span class="comment"> * no newline in the format string, then other syslog output could</span>
00021 <span class="comment"> * get appended to the SystemTap line.</span>
00022 <span class="comment"> * @todo Either deprecate or redefine this as a way to log debug or </span>
00023 <span class="comment"> * status messages, separate from the normal program output.</span>
00024 <span class="comment"> */</span>
<a name="l00025"></a><a class="code" href="group__io.html#ga0">00025</a> <span class="keywordtype">void</span> <a class="code" href="group__io.html#ga0">dlog</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...)
00026 {
00027 va_list args;
00028 printk(<span class="stringliteral">"STP: "</span>);
00029 va_start(args, fmt);
00030 vprintk(fmt, args);
00031 va_end(args);
00032 }
00033 <span class="comment"></span>
00034 <span class="comment">/** Prints to the trace buffer.</span>
00035 <span class="comment"> * This function uses the same formatting as printk. It currently</span>
00036 <span class="comment"> * writes to the system log. </span>
00037 <span class="comment"> *</span>
00038 <span class="comment"> * @param fmt A variable number of args.</span>
00039 <span class="comment"> * @todo Needs replaced with something much faster that does not</span>
00040 <span class="comment"> * use the system log.</span>
00041 <span class="comment"> */</span>
00042
<a name="l00043"></a><a class="code" href="group__io.html#ga1">00043</a> <span class="keywordtype">void</span> <a class="code" href="group__io.html#ga1">_stp_print</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...)
00044 {
00045 va_list args;
00046 va_start(args, fmt);
00047 vprintk(fmt, args);
00048 va_end(args);
00049 }
00050 <span class="comment"></span>
00051 <span class="comment">/** Prints to the trace buffer.</span>
00052 <span class="comment"> * This function will write a string to the trace buffer. It currently</span>
00053 <span class="comment"> * writes to the system log. </span>
00054 <span class="comment"> *</span>
00055 <span class="comment"> * @param str String.</span>
00056 <span class="comment"> * @todo Needs replaced with something much faster that does not</span>
00057 <span class="comment"> * use the system log.</span>
00058 <span class="comment"> */</span>
00059
<a name="l00060"></a><a class="code" href="group__io.html#ga2">00060</a> <span class="keywordtype">void</span> <a class="code" href="group__io.html#ga2">_stp_print_str</a> (<span class="keywordtype">char</span> *str)
00061 {
00062 printk (<span class="stringliteral">"%s"</span>, str);
00063 }
00064 <span class="comment"></span>
00065 <span class="comment">/** @} */</span>
00066 <span class="preprocessor">#endif </span><span class="comment">/* _IO_C_ */</span>
</pre></div></body></html>
|