~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/inviso/doc/src/inviso_lfm.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype erlref PUBLIC "-//Stork//DTD erlref//EN">
 
2
<erlref>
 
3
  <header>
 
4
    <title>inviso_lfm</title>
 
5
    <prepared></prepared>
 
6
    <docno></docno>
 
7
    <date></date>
 
8
    <rev></rev>
 
9
  </header>
 
10
  <module>inviso_lfm</module>
 
11
  <modulesummary>An Inviso Off-Line Logfile Merger</modulesummary>
 
12
  <description>
 
13
    <p>Implements an off-line logfile merger, merging binary trace-log files from several nodes together in chronological order. The logfile merger can also do pid-to-alias translations.</p>
 
14
 
 
15
    <p>The logfile merger is supposed to be called from the Erlang shell or a higher layer trace tool. For it to work, all logfiles and trace information files (containing the pid-alias associations) must be located in the file system accessible from this node and organized according to the API description.</p>
 
16
 
 
17
    <p>The logfile merger starts a process, the output process, which in its turn starts one reader process for every node it shall merge logfiles from. Note that the reason for a process for each node is not remote communication, the logfile merger is an off-line utility, it is to sort the logfile entries in chronological order.</p>
 
18
 
 
19
    <p>The logfile merger can be customized both when it comes to the implementation of the reader processes and the output the output process shall generate for every logfile entry.</p>
 
20
  </description>
 
21
 
 
22
  <funcs>
 
23
    <func>
 
24
      <name>merge(Files, OutFile) -></name>
 
25
      <name>merge(Files, WorkHFun, InitHandlerData) -></name>
 
26
      <name>merge(Files, BeginHFun, WorkHFun, EndHFun, InitHandlerData)
 
27
        -> {ok, Count} | {error, Reason}</name>
 
28
      <fsummary>Merge logfiles into one file in chronological order
 
29
      </fsummary>
 
30
      <type>
 
31
        <v>Files = [FileDescription]</v>
 
32
        <v>&nbsp;FileDescription = FileSet | {reader,RMod,RFunc,FileSet}
 
33
        </v>
 
34
        <v>&nbsp;&nbsp;FileSet = {Node, LogFiles}</v>
 
35
        <v>&nbsp;&nbsp;&nbsp;Node = atom()</v>
 
36
        <v>&nbsp;&nbsp;&nbsp;LogFiles =
 
37
          [{trace_log, [FileName]} | {ti_log, [FileName]}]</v>
 
38
        <v>&nbsp;&nbsp;&nbsp;&nbsp;FileName = string()</v>
 
39
        <v>&nbsp;&nbsp;RMod = RFunc = atom()</v>
 
40
        <v>OutFile = string()</v>
 
41
        <v>BeginHFun = fun(InitHandlerData) ->
 
42
          {ok, NewHandlerData} | {error, Reason}</v>
 
43
        <v>WorkHFun = fun(Node, LogEntry, PidMappings, HandlerData) ->
 
44
          {ok, NewHandlerData}</v>
 
45
        <v>&nbsp;LogEntry = tuple()</v>
 
46
        <v>&nbsp;PidMappings = term()</v>
 
47
        <v>EndHFun = fun(HandlerData) -> ok | {error, Reason}</v>
 
48
        <v>Count = int()</v>
 
49
        <v>Reason = term()</v>
 
50
      </type>
 
51
      <desc>
 
52
        <p>Merges the logfiles in <c>Files</c> together into one file in chronological order. The logfile merger consists of an output process and one or several reader processes.</p>
 
53
 
 
54
        <p>Returns <c>{ok, Count}</c> where <c>Count</c> is the total number of log entries process, if successful.</p>
 
55
 
 
56
        <p>When specifying <c>LogFiles</c>, currently the standard reader-process only supports:</p>
 
57
        <list>
 
58
          <item>one single file</item>
 
59
          <item>a list of wraplog files, following the naming convention <c>&lt;Prefix&gt;&lt;Nr&gt;&lt;Suffix&gt;</c>.</item>
 
60
        </list>
 
61
 
 
62
        <p><c>FileDescription == {reader,RMod,RFunc,FileSet}</c> indicates that <c>spawn(RMod, RFunc, [OutputPid,LogFiles])</c> shall create a reader process.</p>
 
63
 
 
64
        <p>The output process is customized with <c>BeginHFun</c>, <c>WorkHFun</c> and <c>EndHFun</c>. If using <c>merge/2</c> a default output process configuration is used, basically creating a text file and writing the output line by line. <c>BeginHFun</c> is called once before requesting log entries from the reader processes. <c>WorkHFun</c> is called for every log entry (trace message) <c>LogEntry</c>. Here the log entry typically gets written to the output. <c>PidMappings</c> is the translations produced by the reader process. <c>EndHFun</c> is called when all reader processes have terminated.</p>
 
65
 
 
66
        <p>The standard reader process is implemented in the module <c>inviso_lfm_tpreader</c> (trace port reader). It understands Erlang linked in trace-port driver generated trace-logs and <c>inviso_rt_meta</c> generated trace information files.</p>
 
67
      </desc>
 
68
    </func>
 
69
  </funcs>
 
70
 
 
71
  <section>
 
72
    <title>Writing Your Own Reader Process</title>
 
73
 
 
74
    <p>Writing a reader process is not that difficult. It must:</p>
 
75
    <list>
 
76
      <item>Export an init-like function accepting two arguments, pid of the output process and the <c>LogFiles</c> component. <c>LogFiles</c> is actually only used by the reader processes, making it possible to redefine <c>LogFiles</c> if implementing an own reader process.</item>
 
77
 
 
78
      <item>Respond to <c>{get_next_entry, OutputPid}</c> messages with <c>{next_entry, self(), PidMappings, NowTimeStamp, Term}</c> or <c>{next_entry, self(), {error,Reason}}</c>.</item>
 
79
 
 
80
      <item>Terminate normally when no more log entries are available.</item>
 
81
 
 
82
      <item>Terminate on an incoming EXIT-signal from <c>OutputPid</c>.</item>
 
83
    </list>
 
84
 
 
85
    <p>The reader process must of course understand the format of a logfile written by the runtime component.</p>
 
86
  </section>
 
87
 
 
88
  <authors>
 
89
    <aname>Lennart &Ouml;hman</aname>
 
90
    <email>support@erlang.ericsson.se</email>
 
91
  </authors>
 
92
</erlref>
 
 
b'\\ No newline at end of file'