• Steven Rostedt's avatar
    tracing/fgraph: Have fgraph handle previous boot function addresses · 4c57d0be
    Steven Rostedt authored
    Update the function graph code to modify the function addresses for a
    previous boot buffer so that it matches the current kallsyms (note this
    does not handle module addresses, yet).
    
    After a reboot, instead of seeing:
    
     # trace-cmd show -B boot_mapped | tail -n30
           swapper/0-1       [000] d..2.    56.286470:  0)   0.481 us    |                    0xffffffff925da5c4();
           swapper/0-1       [000] d....    56.286471:  0)   4.065 us    |                  }
           swapper/0-1       [000] d....    56.286471:  0)   4.920 us    |                }
           swapper/0-1       [000] d..1.    56.286472:  0)               |                0xffffffff92536254() {
           swapper/0-1       [000] d..1.    56.286472:  0) + 28.974 us   |                  0xffffffff92534e30();
           swapper/0-1       [000] d....    56.286516:  0) + 43.881 us   |                }
           swapper/0-1       [000] d..1.    56.286517:  0)               |                0xffffffff925136c4() {
           swapper/0-1       [000] d..1.    56.286518:  0)               |                  0xffffffff92514a14() {
           swapper/0-1       [000] d..1.    56.286518:  0)   6.003 us    |                    0xffffffff92514200();
           swapper/0-1       [000] d....    56.286529:  0) + 11.510 us   |                  }
           swapper/0-1       [000] d....    56.286529:  0) + 12.895 us   |                }
           swapper/0-1       [000] d....    56.286530:  0) ! 382.884 us  |              }
           swapper/0-1       [000] d..1.    56.286530:  0)               |              0xffffffff92536444() {
           swapper/0-1       [000] d..1.    56.286531:  0)               |                0xffffffff92536254() {
           swapper/0-1       [000] d..1.    56.286531:  0) + 26.335 us   |                  0xffffffff92534e30();
           swapper/0-1       [000] d....    56.286560:  0) + 29.511 us   |                }
           swapper/0-1       [000] d....    56.286561:  0) + 30.452 us   |              }
           swapper/0-1       [000] d..1.    56.286562:  0)               |              0xffffffff9253c014() {
           swapper/0-1       [000] d..1.    56.286562:  0)               |                0xffffffff9253bed4() {
           swapper/0-1       [000] d..1.    56.286563:  0) + 13.465 us   |                  0xffffffff92536684();
           swapper/0-1       [000] d....    56.286577:  0) + 14.651 us   |                }
           swapper/0-1       [000] d....    56.286577:  0) + 15.821 us   |              }
           swapper/0-1       [000] d..1.    56.286578:  0)   0.667 us    |              0xffffffff92547074();
           swapper/0-1       [000] d..1.    56.286579:  0)   0.453 us    |              0xffffffff924f35c4();
           swapper/0-1       [000] d....    56.286580:  0) # 3906.348 us |            }
           swapper/0-1       [000] d..1.    56.286581:  0)               |            0xffffffff92531a14() {
           swapper/0-1       [000] d..1.    56.286581:  0)   0.518 us    |              0xffffffff92505cb4();
           swapper/0-1       [000] d..1.    56.286595:  0)               |              0xffffffff92db83c4() {
           swapper/0-1       [000] d..1.    56.286596:  0)               |                0xffffffff92dec2e4() {
           swapper/0-1       [000] d..1.    56.286597:  0)               |                  0xffffffff92db5304() {
    
    It now shows:
    
     # trace-cmd show -B boot_mapped | tail -n30
           swapper/0-1       [000] d..2.   363.079099:  0)   0.483 us    |                    preempt_count_sub();
           swapper/0-1       [000] d....   363.079100:  0)   4.112 us    |                  }
           swapper/0-1       [000] d....   363.079101:  0)   4.979 us    |                }
           swapper/0-1       [000] d..1.   363.079101:  0)               |                disable_local_APIC() {
           swapper/0-1       [000] d..1.   363.079102:  0) + 29.153 us   |                  clear_local_APIC.part.0();
           swapper/0-1       [000] d....   363.079148:  0) + 46.517 us   |                }
           swapper/0-1       [000] d..1.   363.079149:  0)               |                mcheck_cpu_clear() {
           swapper/0-1       [000] d..1.   363.079149:  0)               |                  mce_intel_feature_clear() {
           swapper/0-1       [000] d..1.   363.079150:  0)   5.871 us    |                    lmce_supported();
           swapper/0-1       [000] d....   363.079161:  0) + 11.340 us   |                  }
           swapper/0-1       [000] d....   363.079161:  0) + 12.638 us   |                }
           swapper/0-1       [000] d....   363.079162:  0) ! 383.518 us  |              }
           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() {
    
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Ross Zwisler <zwisler@google.com>
    Cc: Vincent Donnefort <vdonnefort@google.com>
    Link: https://lore.kernel.org/20240813171257.478901820@goodmis.orgSigned-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    4c57d0be
trace_functions_graph.c 35.2 KB