From: Manoj S P <spm...@ya...> - 2005-11-10 13:33:13
|
Hi, I have created a small shared library and linked the same with an C executable. If i execute the C program it works fine. Even 'ldd <c program>' shows me that the c program uses the shared library. ~/tests # ldd test_lib libmatrix.so.0 => /root/tests/libmatrix.so.0 (0x000002000001b000) libc.so.6 => /lib64/tls/libc.so.6 (0x0000020000033000) /lib/ld64.so.1 => /lib/ld64.so.1 (0x0000020000000000) Next step, started OProfile and executed the 'C' program. But OPreport doesnot show any sign of the c programs execution. I created the shared library using the following 1. gcc -fPIC -Wall -g -c libmatrix.c 2. gcc -g -shared -Wl,-soname,libmatrix.so.0 -o libmatrix.so.0.0 libmatrix.o -lc 3. /sbin/ldconfig -n . 4. ln -sf libmatrix.so.0 libmatrix.so 5. gcc -Wall -g -c demo_use.c -o demo_use.o 6. gcc -g -o demo_use demo_use.o -L. -lhello 7. LD_LIBRARY_PATH="." 8. ./demo_use The opreport data are below (without any sign of the C program or the Library) :~/tests # opreport CPU: CPU with timer interrupt, speed 0 MHz (estimated) Profiling through timer interrupt TIMER:0| samples| %| ------------------ 5467 99.8539 vmlinux 4 0.0731 bash 1 0.0183 ld-2.3.3.so 1 0.0183 libc.so.6 1 0.0183 libcrypto.so.0.9.7 1 0.0183 oprofiled S.P.MANOJ IBM Software Labs Gloden Towers,Bangalore Ph : 5044205 ____________________________________________________________ Obstacles are things a person sees when he takes his eyes off his goal. ____________________________________________________________ __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com |