On 2023/05/24 16:10, lijiang wrote:
On Thu, May 11, 2023 at 12:35 PM HAGIO KAZUHITO(萩尾 一仁)
<k-hagio-ab(a)nec.com>
wrote:
> To "sym -m" print the symbols of a module in address order.
> (but "sym -l" and "sym -M" still print modules in text address
order.)
>
>
The current text address order is better to me, basically it can keep the
same order with the definition mod_mem_type, which looks more natural. For
example:
crash> sym -m kvm |grep MODULE
ffffffffc136e000 MODULE TEXT START: kvm
ffffffffc13e0000 MODULE TEXT END: kvm
ffffffffc1ceb000 MODULE DATA START: kvm
ffffffffc1d6b000 MODULE DATA END: kvm
ffffffffc291a000 MODULE RODATA START: kvm
ffffffffc296c000 MODULE RODATA END: kvm
ffffffffc11cf000 MODULE RO_AFTER_INIT START: kvm
ffffffffc11d1000 MODULE RO_AFTER_INIT END: kvm
And the internal output in each module memory type is sorted by address as
below:
crash> sym -m kvm
ffffffffc136e000 MODULE TEXT START: kvm
ffffffffc136e000 (T) __pfx___traceiter_kvm_userspace_exit
ffffffffc136e010 (T) __traceiter_kvm_userspace_exit
ffffffffc136e050 (T) __pfx___traceiter_kvm_vcpu_wakeup
ffffffffc136e060 (T) __traceiter_kvm_vcpu_wakeup
ffffffffc136e0b0 (T) __pfx___traceiter_kvm_set_irq
ffffffffc136e0c0 (T) __traceiter_kvm_set_irq
ffffffffc136e110 (T) __pfx___traceiter_kvm_ioapic_set_irq
ffffffffc136e120 (T) __traceiter_kvm_ioapic_set_irq
ffffffffc136e170 (T) __pfx___traceiter_kvm_ioapic_delayed_eoi_inj
...
ffffffffc13df650 (t) kvm_x86_exit
ffffffffc13df650 (T) cleanup_module
ffffffffc13e0000 MODULE TEXT END: kvm
In addition, the sym -m option will be consistent with the styles of sym
-l/-M options, and really simplify the code. Given that, I tend to print
modules in *text address order* and do not need to change it.
ok, thanks. If we need to sort all of module symbols, we can use sort
command as I wrote in 0/15.
crash> sym -M | grep MODULE | sort # displayed in address order
Thanks,
Kazu