[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#672490: linux-tools: perf has wrong default lookup path



On Fri, 2012-05-11 at 19:39 +0530, Ritesh Raj Sarraf wrote:
> Package: linux-tools
> Version: 3.2+44
> Severity: normal
> 
> 
> The default lookup path of perf does not align with the debian install
> paths.
> 
> A simple command execution fails:
> 
> rrs@champaran:~$ sudo perf probe -L vfs_read
> Failed to find path of kernel module.
> Failed to open debuginfo file.
>   Error: Failed to show lines. (-2)
> 
> 
> The lookup path for debuginfo is:
> stat("/lib/modules/3.3.0-trunk-amd64/kernel/.", {st_mode=S_IFDIR|0755,
> st_size=4096, ...}) = 0
> getdents(3, /* 0 entries */, 32768)     = 0
> close(3)                                = 0
> open("/root/.debug/.build-id/3d/849bc6ecd394dc55a22756b1da531a7b856d03",
> O_RDONLY) = -1 ENOENT (No such file or directory)
> open("vmlinux", O_RDONLY)               = -1 ENOENT (No such file or
> directory)
> open("/boot/vmlinux", O_RDONLY)         = -1 ENOENT (No such file or
> directory)
> open("/boot/vmlinux-3.3.0-trunk-amd64", O_RDONLY) = -1 ENOENT (No such
> file or directory)
> open("/lib/modules/3.3.0-trunk-amd64/build/vmlinux", O_RDONLY) = -1
> ENOENT (No such file or directory)
> open("/usr/lib/debug/lib/modules/3.3.0-trunk-amd64/vmlinux", O_RDONLY) =
> -1 ENOENT (No such file or directory)
> write(2, "Failed to find path of kernel mo"..., 38Failed to find path of
> kernel module.
> ) = 38
> write(2, "Failed to open debuginfo file.\n", 31Failed to open debuginfo
> file.
> 
> 
> 
> The vmlinux file resides under as /usr/lib/debug/boot/vmlinux-`uname -r`
> Adding a symlink works. So the path lookup needs to be fixed here.

In bug #582810 you reported that SystemTap couldn't find it, and the
conflusion was that it belonged in /usr/lib/debug/boot/.  So I wonder
why perf and SystemTap disagree on this.

I think we should look at what other distributions are doing and try to
be consistent (so long as we also comply with Debian policy).

> Similary for the source lookup:
> 
> access("/build/buildd-linux-2.6_3.3.4-1~experimental.1-amd64-_y3OdD/linux-2.6-3.3.4/debian/build/source_amd64_none/fs/read_write.c",
> R_OK) = -1 ENOENT (No such file or directory)
> write(2, "Failed to find source file. (-2)"..., 33Failed to find source
> file. (-2)
> ) = 33
> write(2, "  Error: Failed to show lines. ("..., 36  Error: Failed to
> show lines. (-2)
> 
> 
> It should try for: /usr/src/linux-source-`uname -r`
[...]

It's looking at the absolute path to the source during build, because
that's what's in the debug info.

I agree that it ought to read from some other path where the user could
reasonably unpack the source.  But I think this is a problem with *all*
debuginfo packages at present and should have a general solution, not
just a fix for perf and the kernel.

Ben.

-- 
Ben Hutchings
Life is what happens to you while you're busy making other plans.
                                                               - John Lennon

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: