This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

LD_PROFILE usage


Hi,
  I am sorry for this very stupid question.
I am doing following

QUESTION 1:
-----------
amol@amol tmp]$ pwd
/var/tmp
amol@amol tmp]$ ls
amol@amol tmp]$ 
amol@amol tmp]$ LD_PROFILE=libc.so.6 ls
libc.so.6.profile
[amol@amol tmp]$ ls
libc.so.6.profile
[amol@amol tmp]$ sprof /lib/libc.so.6 libc.so.6.profile
sprof: profiling data file `libc.so.6.profile' does not match shared
object `/lib/libc.so.6'

I don't know what I am missing.(strace output of this command is at end)

QUESTION 2:
-----------
Can I profile my own shared library using the above steps ? Do I need to
do somethng more




My system details are

Redhat 9.0
amol@amol tmp]$ uname -a 
Linux amol 2.4.20-8 #13 Tue Jul 29 18:38:43 IST 2003 i686 i686 i386
GNU/Linux

[amol@amol tmp]$ gcc --version
gcc (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)

[amol@amol tmp]$ ld --version
GNU ld version 2.13.90.0.18 20030206

Please let me know what step I am doing wrong. Please CC me.

Thanks
Amol


STRACE OUTPUT::
---------------
execve("/usr/bin/sprof", ["sprof", "/lib/libc.so.6",
"./libc.so.6.profile"], [/* 38 vars */]) = 0
uname({sys="Linux", node="amol", ...})  = 0
brk(0)                                  = 0x804cb3c
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40016000
open("/etc/ld.so.preload", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("tls/i686/mmx/libdl.so.2", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("tls/i686/libdl.so.2", O_RDONLY)   = -1 ENOENT (No such file or
directory)
open("tls/mmx/libdl.so.2", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("tls/libdl.so.2", O_RDONLY)        = -1 ENOENT (No such file or
directory)
open("i686/mmx/libdl.so.2", O_RDONLY)   = -1 ENOENT (No such file or
directory)
open("i686/libdl.so.2", O_RDONLY)       = -1 ENOENT (No such file or
directory)
open("mmx/libdl.so.2", O_RDONLY)        = -1 ENOENT (No such file or
directory)
open("libdl.so.2", O_RDONLY)            = -1 ENOENT (No such file or
directory)
open("/home/amol/temp/tls/i686/mmx/libdl.so.2", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("/home/amol/temp/tls/i686/mmx", 0xbfffe6a0) = -1 ENOENT (No such
file or directory)
open("/home/amol/temp/tls/i686/libdl.so.2", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/home/amol/temp/tls/i686", 0xbfffe6a0) = -1 ENOENT (No such file
or directory)
open("/home/amol/temp/tls/mmx/libdl.so.2", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/home/amol/temp/tls/mmx", 0xbfffe6a0) = -1 ENOENT (No such file
or directory)
open("/home/amol/temp/tls/libdl.so.2", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/home/amol/temp/tls", 0xbfffe6a0) = -1 ENOENT (No such file or
directory)
open("/home/amol/temp/i686/mmx/libdl.so.2", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/home/amol/temp/i686/mmx", 0xbfffe6a0) = -1 ENOENT (No such file
or directory)
open("/home/amol/temp/i686/libdl.so.2", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/home/amol/temp/i686", 0xbfffe6a0) = -1 ENOENT (No such file or
directory)
open("/home/amol/temp/mmx/libdl.so.2", O_RDONLY) = -1 ENOENT (No such
file or directory)
stat64("/home/amol/temp/mmx", 0xbfffe6a0) = -1 ENOENT (No such file or
directory)
open("/home/amol/temp/libdl.so.2", O_RDONLY) = -1 ENOENT (No such file
or directory)
stat64("/home/amol/temp", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=115232, ...}) = 0
old_mmap(NULL, 115232, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40017000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\360\26"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=15084, ...}) = 0
old_mmap(NULL, 8620, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x40034000
old_mmap(0x40036000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x2000) = 0x40036000
close(3)                                = 0
open("tls/i686/mmx/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("tls/i686/libc.so.6", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("tls/mmx/libc.so.6", O_RDONLY)     = -1 ENOENT (No such file or
directory)
open("tls/libc.so.6", O_RDONLY)         = -1 ENOENT (No such file or
directory)
open("i686/mmx/libc.so.6", O_RDONLY)    = -1 ENOENT (No such file or
directory)
open("i686/libc.so.6", O_RDONLY)        = -1 ENOENT (No such file or
directory)
open("mmx/libc.so.6", O_RDONLY)         = -1 ENOENT (No such file or
directory)
open("libc.so.6", O_RDONLY)             = -1 ENOENT (No such file or
directory)
open("/home/amol/temp/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or
directory)
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`V\1B4\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1531064, ...}) = 0
old_mmap(0x42000000, 1257224, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x42000000
old_mmap(0x4212e000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x12e000) = 0x4212e000
old_mmap(0x42131000, 7944, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x42131000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0x40037000
set_thread_area({entry_number:-1 -> 6, base_addr:0x40037280,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0x40017000, 115232)              = 0
brk(0)                                  = 0x804cb3c
brk(0x804db3c)                          = 0x804db3c
brk(0)                                  = 0x804db3c
brk(0x804e000)                          = 0x804e000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=30301680, ...}) = 0
mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40038000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320Y\1"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1549556, ...}) = 0
old_mmap(NULL, 1281764, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) =
0x40238000
old_mmap(0x4036b000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED,
3, 0x132000) = 0x4036b000
old_mmap(0x4036f000, 7908, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4036f000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
mmap2(NULL, 5364, PROT_READ, MAP_SHARED, 3, 0x179) = 0x40017000
mmap2(NULL, 2921, PROT_READ, MAP_SHARED, 3, 0x179) = 0x40019000
munmap(0x40019000, 2921)                = 0
mmap2(NULL, 227232, PROT_READ, MAP_SHARED, 3, 0x142) = 0x40371000
munmap(0x40017000, 3204)                = 0
close(3)                                = 0
open("./libc.so.6.profile", O_RDONLY)   = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=4181024, ...}) = 0
open("/usr/share/locale/locale.alias", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=2601, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x40017000
read(4, "# Locale name alias data base.\n#"..., 4096) = 2601
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x40017000, 4096)                = 0
brk(0)                                  = 0x804e000
brk(0x804f000)                          = 0x804f000
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT
(No such file or directory)
write(2, "sprof: ", 7sprof: )                  = 7
write(2, "profiling data file `./libc.so.6"..., 87profiling data file
`./libc.so.6.profile' does not match shared object `/lib/libc.so.6') =
87
write(2, "\n", 1
)                       = 1
close(3)                                = 0
munmap(0x40371000, 227232)              = 0
exit_group(1)                           = ?


-- 
Amol Lad <amol@amplewave.com>
Amplewave


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]