Commit | Line | Data |
---|---|---|
2facbdc3 | 1 | = babeltrace2-source.text.dmesg(7) |
838dd456 | 2 | :manpagetype: component class |
2facbdc3 | 3 | :revdate: 14 September 2019 |
838dd456 PP |
4 | |
5 | ||
2facbdc3 PP |
6 | == NAME |
7 | ||
8 | babeltrace2-source.text.dmesg - Babeltrace 2's Linux kernel ring buffer | |
838dd456 PP |
9 | source component class |
10 | ||
11 | ||
2facbdc3 PP |
12 | == DESCRIPTION |
13 | ||
14 | A Babeltrace~2 compcls:source.text.dmesg message iterator reads the | |
838dd456 | 15 | lines of a Linux kernel ring buffer, as printed by the man:dmesg(1) |
2facbdc3 PP |
16 | tool, and emits corresponding event messages. |
17 | ||
18 | ---- | |
19 | Linux kernel ring buffer | |
20 | lines (file or standard input) | |
21 | | | |
22 | | +----------------+ | |
23 | | | src.text.dmesg | | |
24 | '-->| | | |
25 | | out @--> Messages (single stream) | |
26 | +----------------+ | |
27 | ---- | |
838dd456 | 28 | |
2facbdc3 | 29 | include::common-see-babeltrace2-intro.txt[] |
838dd456 | 30 | |
2facbdc3 PP |
31 | A compcls:source.text.dmesg message iterator names the events it creates |
32 | `string`. Each event contain a single payload string field named `str` | |
33 | which contains the corresponding ring buffer line. | |
838dd456 | 34 | |
2facbdc3 PP |
35 | By default, a compcls:source.text.dmesg message iterator reads the lines |
36 | of the standard input stream. You can make the message iterator read the | |
37 | lines of a text file instead with the param:path parameter. | |
38 | ||
39 | By default, the message iterator tries to extract the timestamps of the | |
40 | kernel ring buffer lines and use them as the created events's | |
41 | timestamps. A typical man:dmesg(1) line looks like this: | |
838dd456 PP |
42 | |
43 | ---- | |
44 | [87166.510937] PM: Finishing wakeup. | |
45 | ---- | |
46 | ||
2facbdc3 PP |
47 | The `[87166.510937]` part is the timestamp to extract. When this |
48 | information is available, the component creates a clock class which does | |
49 | :not: have the Unix epoch as its origin. | |
50 | ||
51 | You can make the message iterator not extract timestamps from lines with | |
52 | the param:no-extract-timestamp parameter. | |
838dd456 | 53 | |
2facbdc3 PP |
54 | [NOTE] |
55 | ==== | |
56 | It is possible that the output of man:dmesg(1) contains unsorted lines, | |
57 | that is, their timestamps go back in time. You can see this with the | |
58 | nlopt:--show-delta option of man:dmesg(1): some time differences can be | |
59 | negative. | |
838dd456 | 60 | |
2facbdc3 PP |
61 | This is due to a https://lwn.net/Articles/780556/[2019 change] to the |
62 | kernel's ring buffer API. | |
838dd456 | 63 | |
2facbdc3 PP |
64 | As of this version, a compcls:source.text.dmesg message iterator |
65 | requires that the input kernel ring buffer lines be sorted by timestamp | |
66 | (when they have timestamps), failing otherwise. | |
67 | ==== | |
68 | ||
69 | ||
70 | == INITIALIZATION PARAMETERS | |
71 | ||
72 | param:no-extract-timestamp=`yes` vtype:[optional boolean]:: | |
838dd456 PP |
73 | Do :not: extract timestamps from the kernel ring buffer lines: set |
74 | the created event's payload's `str` field to the whole line, | |
75 | including any timestamp prefix. | |
76 | ||
2facbdc3 | 77 | param:path='PATH' vtype:[optional string]:: |
838dd456 PP |
78 | Read the kernel ring buffer lines from the file 'PATH' instead of |
79 | the standard input stream. | |
80 | ||
81 | ||
2facbdc3 | 82 | == PORTS |
838dd456 | 83 | |
2facbdc3 PP |
84 | ---- |
85 | +----------------+ | |
86 | | src.text.dmesg | | |
87 | | | | |
88 | | out @ | |
89 | +----------------+ | |
90 | ---- | |
838dd456 | 91 | |
838dd456 | 92 | |
2facbdc3 | 93 | === Output |
838dd456 | 94 | |
2facbdc3 PP |
95 | `out`:: |
96 | Single output port. | |
838dd456 PP |
97 | |
98 | ||
99 | include::common-footer.txt[] | |
100 | ||
101 | ||
2facbdc3 PP |
102 | == SEE ALSO |
103 | ||
c1f82f3b MJ |
104 | man:babeltrace2-plugin-text(7), |
105 | man:babeltrace2-intro(7) |