Skip to content

Reduce tracing payload size.

David Sharp kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 54 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15tracing: Add a 'buffer_overwrite' debugfs fileDocumentation/trace/ftrace.txt include/linux/ring_buffer.h kernel/trace/ring_buffer.c +1 more+74 -46 replies
2/15ring_buffer.c: Remove unused #include <linux/trace_irq.h>kernel/trace/ring_buffer.c+0 -11 reply
3/15ring_buffer: Align buffer_page struct allocations only to fit the flags.kernel/trace/ring_buffer.c+12 -82 replies
4/15ftrace: pack event structures.include/trace/ftrace.h kernel/trace/trace.h+4 -37 replies
5/15ftrace: fix event alignment: ftrace:context_switch and ftrace:wakeupkernel/trace/trace_entries.h+3 -31 reply
6/15ftrace: fix event alignment: module:module_requestinclude/trace/events/module.h+2 -33 replies
7/15ftrace: fix event alignment: kvm:kvm_hv_hypercallarch/x86/kvm/trace.h+4 -411 replies
8/15ftrace: fix event alignment: mce:mce_recordinclude/trace/events/mce.h+4 -43 replies
9/15ftrace: fix event alignment: skb:kfree_skbinclude/trace/events/skb.h+2 -23 replies
10/15ftrace: fix event alignment: jbd2:*include/trace/events/jbd2.h+4 -44 replies
11/15ftrace: fix event alignment: ext4:*include/trace/events/ext4.h+35 -352 replies
12/15trace_output.c: adjust conditional expression formatting.kernel/trace/trace_output.c+15 -111 reply
13/15small_traces: Add config option to shrink trace events.kernel/trace/Kconfig+12 -08 replies
14/15small_traces: Remove trace output of large fields.kernel/trace/trace.c kernel/trace/trace_output.c+24 -00 replies
15/15small_traces: Remove 8 bytes from trace_entry.include/linux/ftrace_event.h kernel/trace/trace.c kernel/trace/trace_events.c+14 -10 replies

Reviews trailers per patch

3 of 15 patches have a Reviewed-by or Acked-by.

PatchNeil HormanLi ZefanAvi Kivity
1/15
2/15
3/15
4/15
5/15
6/15A-b A-b
7/15A-b
8/15
9/15A-b A-b
10/15
11/15
12/15
13/15
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [Patch 00/15] Reduce tracing payload size.

This is a series of patches for tracing aiming to reduce the size of events in the trace buffer. For some tracing tasks, the machine is so heavily loaded such that events are produced much faster than they can be written to disk or network. In this situation, the sizes of the trace events and the ring buffer are the primary factors limiting the length of time that can be traced. Even with ktrace (which has significantly smaller event sizes), a fairly minimal set of enabled events, and a 16MB buffer per cpu, we are finding we can only get about 20 seconds of tracing. This is not enough when the problem being diagnosed only occurs at greater timescales and cannot be easily detected at runtime.

These patches are just a start to shrinking the size of trace events. I am planning to also make small versions of trace events that are used when CONFIG_SMALL_TRACES is enabled. I'm also open to discussion of other ways to shrink event sizes.

The patches can be divided into three major groups.

The first group is self explanitory patches, not actually related to shrinking events:

tracing: Add a 'buffer_overwrite' debugfs file ring_buffer.c: Remove unused #include <linux/trace_irq.h>
ring_buffer: Align buffer_page struct allocations only to fit the flags.

The second group is patches to adjust packing and alignment of tracing event structures:

ftrace: pack event structures.
ftrace: fix event alignment: ftrace:context_switch and ftrace:wakeup
ftrace: fix event alignment: module:module_request
ftrace: fix event alignment: kvm:kvm_hv_hypercall
ftrace: fix event alignment: mce:mce_record
ftrace: fix event alignment: skb:kfree_skb
ftrace: fix event alignment: jbd2:*
ftrace: fix event alignment: ext4:*

The third group are patches to remove 8 bytes from struct trace_entry:

trace_output.c: adjust conditional expression formatting.
small_traces: Add config option to shrink trace events.
small_traces: Remove trace output of large fields.
small_traces: Remove 8 bytes from trace_entry.

Thanks,
d#