---
name: "babeltrace2-source.text.dmesg"
section: "7"
platform: "linux"
package: "babeltrace2"
version: "2.1.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/babeltrace2-source.text.dmesg"
---

# babeltrace2-source.text.dmesg(7)

Babeltrace 2: Linux kernel ring buffer source component class

## NAME

babeltrace2-source.text.dmesg - Babeltrace 2: Linux kernel ring buffer source component class

## DESCRIPTION

A Babeltrace 2 **source.text.dmesg** message iterator reads the lines of a Linux kernel ring buffer, as printed by the [**dmesg**(1)](/dmesg/1.md) tool, and emits corresponding event messages.

```
Linux kernel ring buffer
lines (file or standard input)
  |
  |   +----------------+
  |   | src.text.dmesg |
  '-->|                |
      |            out @--> Messages (single stream)
      +----------------+
```

See [**babeltrace2-intro**(7)](/babeltrace2-intro/7.md) to learn more about the Babeltrace 2 project and its core concepts.

A **source.text.dmesg** message iterator names the events it creates **string**. Each event contain a single payload string field named **str** which contains the corresponding ring buffer line.

By default, a **source.text.dmesg** message iterator reads the lines of the standard input stream. You can make the message iterator read the lines of a text file instead with the **path** parameter.

By default, the message iterator tries to extract the timestamps of the kernel ring buffer lines and use them as the timestamps of the created events. A typical [**dmesg**(1)](/dmesg/1.md) line looks like this:

```
[87166.510937] PM: Finishing wakeup.
```

The **\[87166.510937\]** part is the timestamp to extract. When this information is available, the component creates a clock class which does NOT have the Unix epoch as its origin.

You can make the message iterator not extract timestamps from lines with the **no-extract-timestamp** parameter.

**Note**\

It’s possible that the output of [**dmesg**(1)](/dmesg/1.md) contains unsorted lines, that is, their timestamps go back in time. You can see this with the **--show-delta** option of [**dmesg**(1)](/dmesg/1.md): some time differences can be negative.

This is due to a 2019 change (see \<https://lwn.net/Articles/780556/\>) to the API of the kernel ring buffer.

As of this version, a **source.text.dmesg** message iterator requires that the input kernel ring buffer lines be sorted by timestamp (when they have timestamps), failing otherwise.

## INITIALIZATION PARAMETERS

**no-extract-timestamp**=*VAL* \[optional boolean\]

If *VAL* is true, then do NOT extract timestamps from the kernel ring buffer lines: set the **str** payload field of the created event to the whole line, including any timestamp prefix.

Default: false.

**path**=*PATH* \[optional string\]

Read the kernel ring buffer lines from the file *PATH* instead of the standard input stream.

## PORTS

```
+----------------+
| src.text.dmesg |
|                |
|            out @
+----------------+
```

### Output

**out**

Single output port.

## BUGS

If you encounter any issue or usability problem, please report it on the Babeltrace bug tracker (see \<https://bugs.lttng.org/projects/babeltrace\>).

## RESOURCES

The Babeltrace project shares some communication channels with the LTTng project (see \<https://lttng.org/\>).

• Babeltrace website (see \<https://babeltrace.org/\>)

• Mailing list (see \<https://lists.lttng.org\>) for support and development: **lttng-dev@lists.lttng.org**

• IRC channel (see \<irc://irc.oftc.net/lttng\>): **#lttng** on **irc.oftc.net**

• Bug tracker (see \<https://bugs.lttng.org/projects/babeltrace\>)

• Git repository (see \<https://git.efficios.com/?p=babeltrace.git\>)

• GitHub project (see \<https://github.com/efficios/babeltrace\>)

• Continuous integration (see \<https://ci.lttng.org/view/Babeltrace/\>)

• Code review (see \<https://review.lttng.org/q/project:babeltrace\>)

## AUTHORS

The Babeltrace 2 project is the result of hard work by many regular developers and occasional contributors.

The current project maintainer is Jérémie Galarneau \<mailto:jeremie.galarneau@efficios.com\>.

## COPYRIGHT

This component class is part of the Babeltrace 2 project.

Babeltrace is distributed under the MIT license (see \<https://opensource.org/licenses/MIT\>).

## SEE ALSO

[**babeltrace2-plugin-text**(7)](/babeltrace2-plugin-text/7.md), [**babeltrace2-intro**(7)](/babeltrace2-intro/7.md)
