• Stephane Eranian's avatar
    perf buildid-list: Work better with pipe mode · 299c3452
    Stephane Eranian authored
    In order for perf buildid-list to work with pipe-mode files, it needs to
    process buildids and event attr structs.
    
    $ perf record -o - noploop 2 | ./perf inject -b | perf buildid-list -i - -H
    noploop for 2 seconds
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.084 MB - (~3678 samples) ]
    0000000000000000000000000000000000000000 [kernel.kallsyms]
    3a0d0629efe74a8da3eeba372cdbd74ad9b8f5d5 /usr/local/bin/noploop
    
    The reason [kernel.kallsyms] shows a 0 build-id comes from the
    way buildids are injected in the stream.
    
    The buildid for the kernel is provided by a BUILD_ID record. The
    [kernel.kallsyms] is provided by a MMAP record. There is no clean and
    obvious way to link the two, unfortunately.
    
    In regular mode, the kernel buildid is generated from reading the ELF
    image or kallsyms and perf knows to associate [kernel.kallsyms] to it.
    Later on, when perf processes the [kernel.kallsyms] MMAP record, it will
    already have a dso for it.
    
    So for now, make sure perf buildid-list shows the buildids for
    everything but the kernel image.
    Signed-off-by: default avatarStephane Eranian <eranian@google.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Link: http://lkml.kernel.org/r/1337081295-10303-6-git-send-email-eranian@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    299c3452
build-id.c 2.22 KB