Skip to contentSkip to conversation

Building perf failed on Linux/SPARC

DISCUSSION 陳韋任 4 participants 7 messages Mar 14, 2011 – Mar 17, 2011 1 message not in the archive

lore
Share & tools
lore

陳韋任

author
#0 lore raw

Hi, folks

I have some problems while building perf on a Linux/SPARC machine.
Here is the system information.

$ uname -a
Linux sparc 2.6.37-rc5-git #1 SMP Tue Dec 21 17:03:53 CST 2010 sparc64 sun4v UltraSparc T2 (Niagara2) GNU/Linux
$ gcc --version
gcc (Gentoo 4.3.4 p1.0, pie-10.1.5) 4.3.4

And here is the error message,
--------------------------------------------------------------------

$ make
<stdin>:1:20: error: libelf.h: No such file or directory
                ......
Makefile:419: *** No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel.  Stop.
--------------------------------------------------------------------

I tried the code which is used to test libelf in the Makefile. But
it seems work correctly. Do I miss something? Or I just have to update the kernel?

Thanks!

Regards,
chenwj

Signature · 4 lines
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
#1 lore raw

Em Mon, Mar 14, 2011 at 05:51:21PM +0800, 陳韋任 escreveu:

Quoted 16 lines

I have some problems while building perf on a Linux/SPARC machine.
Here is the system information.

$ uname -a
Linux sparc 2.6.37-rc5-git #1 SMP Tue Dec 21 17:03:53 CST 2010 sparc64 sun4v UltraSparc T2 (Niagara2) GNU/Linux
$ gcc --version
gcc (Gentoo 4.3.4 p1.0, pie-10.1.5) 4.3.4

And here is the error message,
--------------------------------------------------------------------

$ make
<stdin>:1:20: error: libelf.h: No such file or directory
                ......
Makefile:419: *** No libelf.h/libelf found, please install libelf-dev/elfutils-libelf-devel.  Stop.
--------------------------------------------------------------------
Quoted 3 lines

I tried the code which is used to test libelf in the Makefile. But
it seems work correctly. Do I miss something? Or I just have to update the kernel?

Gentoo, ok, can you make sure the package providing the libelf implementation is elfutils?

There are other libelf implementations that could pass the simple test, but which doesn't provide functions used in perf.

- Arnaldo

author
#2 lore raw

Hi,

After installing elfutils and updating tools/perf, everything is
fine. I guess the old perf source might have a little trouble with configuration in the Makefile.

Thanks.

Regards,
chenwj

Signature · 4 lines
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
#5 lore raw

I am not able to build elfutils-0.152.tar.bz2. The error I am getting is

In file included from xstrndup.c:30:0:
/usr/include/string.h:546:5: error: expected declaration specifiers or '...' before '__locale /usr/include/string.h:547:6: error: nonnull argument with out-of-range operand number (argument 1, operand 3) /usr/include/string.h:550:18: error: expected declaration specifiers or '...' before '__locale_t' /usr/include/string.h:551:6: error: nonnull argument with out-of-range operand number (argument 1, operand 4)
cc1: warnings being treated as errors
xstrndup.c: In function 'xstrndup':
xstrndup.c:41:3: error: implicit declaration of function 'strnlen'
make[2]: *** [xstrndup.o] Error 1
make[2]: Leaving directory `/home/user/ranjitk/elfutils-0.142/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/ranjitk/elfutils-0.142'
make: *** [all] Error 2

I am using the gcc-4.51.

Regards
Ranjit Kumar
System Performance Analysis Group
Freescale Semiconductors
India

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of ???
Sent: Tuesday, March 15, 2011 1:51 PM
To: Kumar Ranjit-B04060
Cc: [email protected]
Subject: Re: Building perf failed on Linux/SPARC

Hi, Kumar

Here is the information of elfutils on gentoo linux,

dev-libs/elfutils
Homepage: https://fedorahosted.org/elfutils

And you might need to update the perf source code.

HTH. :)

Regards,
chenwj

--
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#6 lore raw

Hi, Kumar

I built elfutils-0.152.tar.bz2 successfully on my system.
Maybe you can ask your system administrator to install perf. Or you can consult your colleagues or the elfutils mailing list for help.

Here is the elfutils mailing list,
https://fedorahosted.org/mailman/listinfo/elfutils-devel

Regards,
chenwj

Signature · 4 lines
Wei-Ren Chen (陳韋任)
Parallel Processing Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
#7 lore raw

[kernel.kallsyms] with build id ... not found, continuing without symbols

In reply to Arnaldo Carvalho de Melo

I'm running on 2.6.37.1-1.2, using the following rpm's to build tools/perf:
(OpenSUSE 11.4)

elfutils-devel-0.149-1.x86_64.rpm
elfutils-libs-0.149-1.x86_64.rpm
elfutils-libelf-0.149-1.x86_64.rpm
elfutils-libelf-devel-0.149-1.x86_64.rpm
xz-libs-4.999.9-0.2.beta.20100401git.x86_64.rpm

I' using my own scsi driver - my-driver.

I do:

# perf record -fg fio my_fio_script
# perf annotate -l -k /usr/src/linux/vmlinux -s __lock_acquire
I'm getting:

[my_scsi_driver] with build id bee3bbdcaacc61223b70db093de47efffa26dbc9 not found, continuing without symbols

I see annotated __lock_acquire but if I run:

# perf annotate -l -k /my_driver_path/my_driver.ko -s my_function

I'm getting:
[kernel.kallsyms] with build id 08ba9c1ec15cb50d359428cacb0b490dee51e1a5 not found, continuing without symbols Segmentation fault

However, when doing:

# cat /proc/kallsyms|grep my_function

I'm getting:
ffffffffa0606b90 t my_function [my_driver]

I also built & ran perf code copied from kernel version 2.6.38 (had to disable "attr->sample_id_all" field usage in builtin-record.c & util/header.c to build on 2.6.37 as, unfortunatelly my_driver doesn't work on 2.6.38) with the same results.

When doing:

# perf report --verbose --dso='[my_driver]'

I see:

+     85.05%  fio  0x368f6          K [k] 0x368f6
+     14.95%  fio  0x7fffb9fff614   ! [.] 0x7fffb9fff614

Expanding any of these two, I'm getting many '+' prefixed hex addresses instead of function names (kernel entry names) and I don't see any of the driver's api. If I select to expand/zoom-in an api that doesn't have '+' and select "Zoom into fio DSO" it "Segmentation fault"

What can I do to annotate/resolve symbols for my_functions?

thanks,
John