mbox series

[0/2] tracing: Have boot instance use reserve_mem option and use fgraph tracer

Message ID 20240813171104.950972475@goodmis.org (mailing list archive)
Headers show
Series tracing: Have boot instance use reserve_mem option and use fgraph tracer | expand

Message

Steven Rostedt Aug. 13, 2024, 5:11 p.m. UTC
Now that "reserve_mem" kernel command line option is upstream, add a patch
to use it with the ring buffer boot up mappings. That is:

  reserve_mem=12M:4096:trace trace_instance=boot_mapped@trace

Will allocate 12 megabytes at boot up that is aligned by 4096 bytes and
label it with "trace". A trace_instance with the name "boot_mapped" will be
created on top of that memory.

Documentation has been updated about this and it states that KASLR can make
it somewhat unreliable for every boot as well as the layout of the memory
for the ring buffer may change with new kernel versions which will clear the
previous buffer.

Also, now that function graph tracing can be used by trace instances,
update its code to be able to be used by this boot process. This can give a
nicer trace of a reboot:

           swapper/0-1       [000] d..1.   363.079162:  0)               |              lapic_shutdown() {
           swapper/0-1       [000] d..1.   363.079163:  0)               |                disable_local_APIC() {
           swapper/0-1       [000] d..1.   363.079163:  0) + 26.144 us   |                  clear_local_APIC.part.0();
           swapper/0-1       [000] d....   363.079192:  0) + 29.424 us   |                }
           swapper/0-1       [000] d....   363.079192:  0) + 30.376 us   |              }
           swapper/0-1       [000] d..1.   363.079193:  0)               |              restore_boot_irq_mode() {
           swapper/0-1       [000] d..1.   363.079194:  0)               |                native_restore_boot_irq_mode() {
           swapper/0-1       [000] d..1.   363.079194:  0) + 13.863 us   |                  disconnect_bsp_APIC();
           swapper/0-1       [000] d....   363.079209:  0) + 14.933 us   |                }
           swapper/0-1       [000] d....   363.079209:  0) + 16.009 us   |              }
           swapper/0-1       [000] d..1.   363.079210:  0)   0.694 us    |              hpet_disable();
           swapper/0-1       [000] d..1.   363.079211:  0)   0.511 us    |              iommu_shutdown_noop();
           swapper/0-1       [000] d....   363.079212:  0) # 3980.260 us |            }
           swapper/0-1       [000] d..1.   363.079212:  0)               |            native_machine_emergency_restart() {
           swapper/0-1       [000] d..1.   363.079213:  0)   0.495 us    |              tboot_shutdown();
           swapper/0-1       [000] d..1.   363.079230:  0)               |              acpi_reboot() {
           swapper/0-1       [000] d..1.   363.079231:  0)               |                acpi_reset() {
           swapper/0-1       [000] d..1.   363.079232:  0)               |                  acpi_os_write_port() {

This is based on top of:

  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
     branch: ring-buffer/for-next

Which was supposed to go in the last merge window, but due to
miscommunication, it did not. As it has been in linux-next, I do not want to
rebase it, so instead I merged in v6.11-rc1 to get access to the
reserve_mem kernel command line parameter and applied these patches on top.


Steven Rostedt (1):
      tracing/fgraph: Have fgraph handle previous boot function addresses

Steven Rostedt (Google) (1):
      tracing: Allow boot instances to use reserve_mem boot memory

----
 Documentation/admin-guide/kernel-parameters.txt | 13 +++++++++++++
 kernel/trace/trace.c                            | 19 +++++++++++++------
 kernel/trace/trace_functions_graph.c            | 23 ++++++++++++++++++-----
 3 files changed, 44 insertions(+), 11 deletions(-)