SUSE / libpulp

libpulp enables live patching in user space applications.
GNU Lesser General Public License v2.1
55 stars 11 forks source link

Print build id of libraries linked against target process #59

Closed giulianobelinassi closed 3 years ago

giulianobelinassi commented 3 years ago

Now, the patches command can print the build id of each library linked agaist the target process using:

$ ulp patches -p $(pid) -b

Output example:

    PID: 3092
      Global universe: 0
      Live patches:
        (none)
      Loaded libraries:
        in /lib64/ld-linux-x86-64.so.2 (3ad62ce668e64d1f7dddd9386f90129c57cc265e):
        in /lib64/libdl.so.2 (338aa4d16c98dda7af170cc8e2b59d259bd5d4f4):
        in /lib64/libc.so.6 (c3c4f482259e3974d74db18e1cbb52bec0f5094a):
        in libparameters.so.0 (8eadb55ed15e43a6c2ae7f6098179bceb3abda2b):
        in ../lib/.libs/libpulp.so (6e0710119ae02bd80356c2d5cf02d2f31f4025f7):
        in linux-vdso.so.1 (0000000000000000000000000000000000000000):

Retrieving the build id of a certain library is straightforward using grep. For example:

$ ulp patches -b -p $(pid) | grep libdl.so | grep -oEi '([0-9a-f]){40}'

returns 338aa4d16c98dda7af170cc8e2b59d259bd5d4f4

Signed-off-by: Giuliano Belinassi gbelinassi@suse.de