[LU-16746] Convert tracefile to export debug logs via character device Created: 17/Apr/23  Updated: 17/Apr/23

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Thomas Bertschinger Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Gantt End to Start
has to be done after LU-14428 Convert tracefile to use ring_buffer ... Open
Rank (Obsolete): 9223372036854775807

 Description   

Currently the interface provided by the libcfs tracing and debug framework works in a way that makes it challenging for userspace tools to consume the debug log:

  • Past logs are not exported in chronological order but instead are sorted by CPU, meaning that user tools (like "lctl dk") have to sort messages before displaying them.
  • Logs are exported by having kernel threads write to regular files which are then opened and read by user tools. This is an extra step that could be eliminated by having a character device which returns logs directly when read from.

These aspects make new usability features, for example the ability to "follow" the debug log like "dmesg -w", challenging to implement.

Changing the tracefile interface to work like Linux's "/dev/kmsg" interface would make it simpler to improve Lustre's debugging tools.

The biggest challenge is that currently Lustre stores messages in separate per-CPU and per-context buffers. Thus any tool that prints out previously written messages has to sort them. If this is implemented as a character device, that sorting would have to happen in a kernel thread.

Therefore, this will be much simpler to implement after LU-14428: "Convert tracefile to use ring_buffer from linux".


Generated at Sat Feb 10 03:29:39 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.