Home » Eclipse Projects » Linux Tools Project » opxml installation(oprofiler plugin: opxml not working)
opxml installation [message #536664] |
Sat, 29 May 2010 13:52 |
Robert Simpson Messages: 11 Registered: May 2010 |
Junior Member |
|
|
Hi,
Having got eclipse installed and working and oprofiler running from the command line, I've been trying to install the plugin.
(I think) I've followed the instructions in http://wiki.eclipse.org/Linux_Tools_Project/OProfile/User_Gu ide, including building opxml and installing it as it wasn't on my system at all.
When I try to profile c++ in Eclipse I get the error: "An error occurred with opxml The xml output could not be read..."
Running opxml info gives:
"oprofile: could not open unit mask description file /usr/local/share/oprofile//x64-64/hammer/unit masks"
and indeed there is no oprofile directory in /usr/local/share.
Any ideas how to proceed? What have I missed?
[Updated on: Sat, 29 May 2010 15:03] Report message to a moderator
|
|
| | |
Re: opxml installation [message #537771 is a reply to message #537587] |
Thu, 03 June 2010 15:26 |
Roland Grunberg Messages: 27 Registered: December 2009 |
Junior Member |
|
|
Robert Simpson wrote on Thu, 03 June 2010 00:22 | It works fine from the command line (except I had to 'sudo' the opcontrol commands).
I think I did a make install but can you tell me the directory? If I missed it out can I just go back and do a make install or do I need to recompile everything?
|
There should be an oprofile directory created in /usr/local/share by default after running make install. You could try looking on your system if by any chance it may be somewhere else, but if you did just a basic ./configure, without adding any flags like --prefix, or --datadir then there's no reason for it to be anywhere else. In fact, I think that even if you did, oprofile should use the values you specified when searching.
Also, after starting opcontrol, executing your binary, then stopping it, does running 'opxml sessions' show a session named "current" under some event name in the xml. If so, then does running opxml model-data [event_name] [session_name] output xml data on that session?
|
|
| |
Re: opxml installation [message #538919 is a reply to message #537771] |
Wed, 09 June 2010 05:59 |
Robert Simpson Messages: 11 Registered: May 2010 |
Junior Member |
|
|
Roland Grunberg wrote on Thu, 03 June 2010 11:26 | Robert Simpson wrote on Thu, 03 June 2010 00:22 | It works fine from the command line (except I had to 'sudo' the opcontrol commands).
I think I did a make install but can you tell me the directory? If I missed it out can I just go back and do a make install or do I need to recompile everything?
|
There should be an oprofile directory created in /usr/local/share by default after running make install. You could try looking on your system if by any chance it may be somewhere else, but if you did just a basic ./configure, without adding any flags like --prefix, or --datadir then there's no reason for it to be anywhere else. In fact, I think that even if you did, oprofile should use the values you specified when searching.
Also, after starting opcontrol, executing your binary, then stopping it, does running 'opxml sessions' show a session named "current" under some event name in the xml. If so, then does running opxml model-data [event_name] [session_name] output xml data on that session?
|
Yes, opxml sessions gives a session called 'current'
Running opxml model-data CPU_CLK_UNHALTED current gives a seg fault.
|
|
| | |
Re: opxml installation [message #556597 is a reply to message #539693] |
Thu, 02 September 2010 02:17 |
Patrick Haller Messages: 6 Registered: July 2009 |
Junior Member |
|
|
After manually building opxml, I also encountered a segfault.
Used system: gentoo linux on amd64, using binutils-2.20.1-r1.
Root cause is that a sample for " /var/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64. cache-3 " is attempted to be examined. opxml seemingly doesn't handle errors properly here.
opxml of org.eclipse.linuxtools-0.20 crashes on "opxml model-data CPU_CLK_UNHALTED current"
with a running oprofile daemon instance.
Stacktrace:
opxml Debug [C/C++ Application]
/local/patrick/workspace/opxml/opxml [9237]
Thread [1] (Suspended : Signal : SIGSEGV:Segmentation fault)
_bfd_elf_get_symtab_upper_bound() at 0x385c6553d2
symboltable::read_symbols() at /local/patrick/workspace/opxml/stable.cc:96 0x40c16a
samplefile::get_samples() at /local/patrick/workspace/opxml/samplefile.cc:190 0x416290
operator<<() at /local/patrick/workspace/opxml/profileimage.cc:144 0x420a94
model_data() at /local/patrick/workspace/opxml/opxml.cc:383 0x40678b
main() at /local/patrick/workspace/opxml/opxml.cc:245 0x405d05
gdb
opxml
Affected source:
bool
symboltable::read_symbols ()
{
if (_open_bfd ())
{
long storage_needed = bfd_get_symtab_upper_bound (_abfd);
if (storage_needed > 0)
{
Variables:
this symboltable * const 0x2c7c830
_boring_symbols const char *[0] [0]
_symbols std::vector<symbol*, std::allocator<symbol*> > {...}
_filename char * 0x350d9c0 "/var/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-3"
_abfd bfd * 0x350da10
_symbol_table asymbol ** 0x0
_start_vma bfd_vma 0
_text_offset bfd_vma 3345167787871972912
_cache_symbol symbol * 0x0
Analysis:
_open_bfd has actually opened the file
" /var/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64. cache-3 " which is
not a valid elf image. However, the next call inside libbdf,
bfd_get_symtab_upper_bound, eventually fails on analysing this "image".
bool
symboltable::_open_bfd (void)
{
if (_abfd == NULL)
{
bfd_init ();
int fd = open (_filename, O_RDONLY); // bfd_close will close fd
_abfd = bfd_fdopenr (_filename, NULL, fd);
if (_abfd != NULL)
{
char** matches;
if (bfd_check_format_matches (_abfd, bfd_object, &matches))
==> bfd_check_format_matches returns false
Contents of _abfd:
_abfd bfd * 0x3ef0dc0
id unsigned int 147
filename const char * 0x3ef0d70 "/var/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64.cache-3"
xvec const bfd_target * 0x385c8d9440
iostream void * 0x3b671a0
iovec const struct bfd_iovec * 0x385c8d09c0
lru_prev bfd * 0xdc6ae0
lru_next bfd * 0xf9c3d0
where ufile_ptr 9
mtime long 0
ifd int 0
format bfd_format bfd_unknown
direction bfd_direction read_direction
flags flagword 0
origin ufile_ptr 0
proxy_origin ufile_ptr 0
section_htab bfd_hash_table {...}
sections bfd_section * 0x0
section_last bfd_section * 0x0
section_count unsigned int 0
start_address bfd_vma 0
symcount unsigned int 0
outsymbols bfd_symbol ** 0x0
dynsymcount unsigned int 0
arch_info const bfd_arch_info * 0x385c8d7ca0
arelt_data void * 0x0
my_archive bfd * 0x0
archive_next bfd * 0x0
archive_head bfd * 0x0
nested_archives bfd * 0x0
link_next bfd * 0x0
archive_pass int 0
tdata bfd::<anonymous union> {...}
usrdata void * 0x0
memory void * 0x3ef0ef0
cacheable unsigned int 0
target_defaulted unsigned int 1
opened_once unsigned int 1
mtime_set unsigned int 0
no_export unsigned int 0
output_has_begun unsigned int 0
has_armap unsigned int 0
is_thin_archive unsigned int 0
==> Likely, the _abfd.format == bfd_unknown should be taken into account, not
only "return (_abfd != NULL);".
Proposed Fix:
bool
symboltable::_open_bfd (void)
{
if (_abfd == NULL)
{
bfd_init ();
int fd = open (_filename, O_RDONLY); // bfd_close will close fd
_abfd = bfd_fdopenr (_filename, NULL, fd);
if (_abfd != NULL)
{
char** matches;
if (bfd_check_format_matches (_abfd, bfd_object, &matches))
{
asection const* sect;
sect = bfd_get_section_by_name(_abfd, ".text");
if (sect != NULL) {
_text_offset = sect->filepos;
} else {
return false;
}
// //fail: this might not get the text section because
// // other sections may also have the SEC_CODE flag
// for (sect = _abfd->sections; sect != NULL; sect = sect->next)
// {
// if (sect->flags & SEC_CODE)
// {
// _text_offset = sect->filepos;
// break;
// }
// }
}
else
{
// 2010-09-03 hallerp: format match failed
return false;
}
_start_vma = bfd_get_start_address (_abfd);
}
}
// 2010-09-03 hallerp changed success conditions
if( NULL == _abfd )
return false;
if( _abfd->format == bfd_unknown )
return false;
return true;
}
[Updated on: Thu, 02 September 2010 02:18] Report message to a moderator
|
|
| | | |
Re: opxml installation [message #569158 is a reply to message #537771] |
Wed, 09 June 2010 05:59 |
Robert Simpson Messages: 11 Registered: May 2010 |
Junior Member |
|
|
Roland Grunberg wrote on Thu, 03 June 2010 11:26
> Robert Simpson wrote on Thu, 03 June 2010 00:22
> > It works fine from the command line (except I had to 'sudo' the opcontrol commands).
> >
> > I think I did a make install but can you tell me the directory? If I missed it out can I just go back and do a make install or do I need to recompile everything?
>
>
> There should be an oprofile directory created in /usr/local/share by default after running make install. You could try looking on your system if by any chance it may be somewhere else, but if you did just a basic ./configure, without adding any flags like --prefix, or --datadir then there's no reason for it to be anywhere else. In fact, I think that even if you did, oprofile should use the values you specified when searching.
>
> Also, after starting opcontrol, executing your binary, then stopping it, does running 'opxml sessions' show a session named "current" under some event name in the xml. If so, then does running opxml model-data [event_name] [session_name] output xml data on that session?
Yes, opxml sessions gives a session called 'current'
Running opxml model-data CPU_CLK_UNHALTED current gives a seg fault.
|
|
| |
Re: opxml installation [message #570043 is a reply to message #569244] |
Thu, 02 September 2010 02:17 |
Patrick Haller Messages: 6 Registered: July 2009 |
Junior Member |
|
|
After manually building opxml, I also encountered a segfault.
Used system: gentoo linux on amd64, using binutils-2.20.1-r1.
Root cause is that a sample for " /var/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64. cache-3 " is attempted to be examined. opxml seemingly doesn't handle errors properly here.
opxml of org.eclipse.linuxtools-0.20 crashes on "opxml model-data CPU_CLK_UNHALTED current"
with a running oprofile daemon instance.
Stacktrace:
opxml Debug [C/C++ Application]
/local/patrick/workspace/opxml/opxml [9237]
Thread [1] (Suspended : Signal : SIGSEGV:Segmentation fault)
_bfd_elf_get_symtab_upper_bound() at 0x385c6553d2
symboltable::read_symbols() at /local/patrick/workspace/opxml/stable.cc:96 0x40c16a
samplefile::get_samples() at /local/patrick/workspace/opxml/samplefile.cc:190 0x416290
operator<<() at /local/patrick/workspace/opxml/profileimage.cc:144 0x420a94
model_data() at /local/patrick/workspace/opxml/opxml.cc:383 0x40678b
main() at /local/patrick/workspace/opxml/opxml.cc:245 0x405d05
gdb
opxml
Offending source:
bool
symboltable::read_symbols ()
{
if (_open_bfd ())
{
long storage_needed = bfd_get_symtab_upper_bound (_abfd);
if (storage_needed > 0)
{
Variables:
this symboltable * const 0x2c7c830
_boring_symbols const char *[0] [0]
_symbols std::vector<symbol*, std::allocator<symbol*> > {...}
_filename char * 0x350d9c0 " /var/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64. cache-3 "
_abfd bfd * 0x350da10
_symbol_table asymbol ** 0x0
_start_vma bfd_vma 0
_text_offset bfd_vma 3345167787871972912
_cache_symbol symbol * 0x0
Analysis:
_open_bfd has actually opened the file
" /var/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64. cache-3 " which is
not a valid elf image. However, the next call inside libbdf,
bfd_get_symtab_upper_bound, eventually fails on analysing this "image".
bool
symboltable::_open_bfd (void)
{
if (_abfd == NULL)
{
bfd_init ();
int fd = open (_filename, O_RDONLY); // bfd_close will close fd
_abfd = bfd_fdopenr (_filename, NULL, fd);
if (_abfd != NULL)
{
char** matches;
if (bfd_check_format_matches (_abfd, bfd_object, &matches))
==> bfd_check_format_matches returns false
Contents of _abfd:
_abfd bfd * 0x3ef0dc0
id unsigned int 147
filename const char * 0x3ef0d70 " /var/cache/fontconfig/3830d5c3ddfd5cd38a049b759396e72e-le64. cache-3 "
xvec const bfd_target * 0x385c8d9440
iostream void * 0x3b671a0
iovec const struct bfd_iovec * 0x385c8d09c0
lru_prev bfd * 0xdc6ae0
lru_next bfd * 0xf9c3d0
where ufile_ptr 9
mtime long 0
ifd int 0
format bfd_format bfd_unknown
direction bfd_direction read_direction
flags flagword 0
origin ufile_ptr 0
proxy_origin ufile_ptr 0
section_htab bfd_hash_table {...}
sections bfd_section * 0x0
section_last bfd_section * 0x0
section_count unsigned int 0
start_address bfd_vma 0
symcount unsigned int 0
outsymbols bfd_symbol ** 0x0
dynsymcount unsigned int 0
arch_info const bfd_arch_info * 0x385c8d7ca0
arelt_data void * 0x0
my_archive bfd * 0x0
archive_next bfd * 0x0
archive_head bfd * 0x0
nested_archives bfd * 0x0
link_next bfd * 0x0
archive_pass int 0
tdata bfd::<anonymous union> {...}
usrdata void * 0x0
memory void * 0x3ef0ef0
cacheable unsigned int 0
target_defaulted unsigned int 1
opened_once unsigned int 1
mtime_set unsigned int 0
no_export unsigned int 0
output_has_begun unsigned int 0
has_armap unsigned int 0
is_thin_archive unsigned int 0
==> Likely, the _abfd.format == bfd_unknown should be taken into account, not
only "return (_abfd != NULL);".
Proposed Fix:
bool
symboltable::_open_bfd (void)
{
if (_abfd == NULL)
{
bfd_init ();
int fd = open (_filename, O_RDONLY); // bfd_close will close fd
_abfd = bfd_fdopenr (_filename, NULL, fd);
if (_abfd != NULL)
{
char** matches;
if (bfd_check_format_matches (_abfd, bfd_object, &matches))
{
asection const* sect;
sect = bfd_get_section_by_name(_abfd, ".text");
if (sect != NULL) {
_text_offset = sect->filepos;
} else {
return false;
}
// //fail: this might not get the text section because
// // other sections may also have the SEC_CODE flag
// for (sect = _abfd->sections; sect != NULL; sect = sect->next)
// {
// if (sect->flags & SEC_CODE)
// {
// _text_offset = sect->filepos;
// break;
// }
// }
}
else
{
// 2010-09-03 hallerp: format match failed
return false;
}
_start_vma = bfd_get_start_address (_abfd);
}
}
// 2010-09-03 hallerp changed success conditions
if( NULL == _abfd )
return false;
if( _abfd->format == bfd_unknown )
return false;
return true;
}
|
|
| | | |
Re: opxml installation [message #641729 is a reply to message #570113] |
Sat, 27 November 2010 09:46 |
Robert Simpson Messages: 11 Registered: May 2010 |
Junior Member |
|
|
An update on my attempts to get the plugin working:
Upgraded Ubuntu to 10.10. This stopped the existing Eclipse installation working completely (no default text editor, compile & run did absolutely nothing). Seems it couldn't find the CDT (which I'd had to reinstall as 10.10 had removed it).
Anyway, removed the eclipse installation. Downloaded the Helios version and manually installed it. Likewise with Oprofile. Eclipse works again.
Oprofile gave an error about a missing qt library. I have both qt3 and qt4 installed. Qt4 definitely works. Don't have anything to test qt3.
Tried installing the plugin using http://wiki.eclipse.org/Linux_Tools_Project/PluginInstallHel p. It gave the following errors:
An error occurred while collecting items to be installed
session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.core,0.3.0.20100 8261754
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.core.linux.x86_6 4,0.3.0.201008261754
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.doc,0.3.0.201008 261754
No repository found containing: org.eclipse.update.feature,org.eclipse.linuxtools.oprofile,0 .3.0.201008261754
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.launch,0.3.0.201 008261754
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.ui,0.3.0.2010082 61754
I tried the suggestions here: http://stackoverflow.com/questions/511367/error-when-updatin g-eclipse
No luck. Still the same error.
The wiki at http://wiki.eclipse.org/Linux_Tools_Project/PluginInstallHel p talks about manually installing 'zip' files. But there doesn't seem to be a zip file, only bz2 files and the repository archive dialog will only accept .zip or .jar.
I also tried extracting the bz2 file to the eclipse directory but it's not recognized. I wasn't sure exactly which directory it should be in (plugin, top level, other). I'm not sure if manual installation is even allowed although some websites e.g. http://agile.csc.ncsu.edu/SEMaterials/tutorials/install_plug in/index_v35.html suggest it is (but then miss out important details).
There seem to be a _lot_ of reports of errors when installing the plugin so should I just wait (another) few months or is there anything I can do to get it working now?
Thanks,
Rob.
|
|
|
Re: opxml installation [message #642242 is a reply to message #641729] |
Tue, 30 November 2010 14:45 |
Severin Gehwolf Messages: 40 Registered: June 2010 |
Member |
|
|
Robert Simpson wrote on Sat, 27 November 2010 04:46 | An update on my attempts to get the plugin working:
Upgraded Ubuntu to 10.10. This stopped the existing Eclipse installation working completely (no default text editor, compile & run did absolutely nothing). Seems it couldn't find the CDT (which I'd had to reinstall as 10.10 had removed it).
|
This is a known Ubuntu/Debian bug. There is a work-around for this, but I don't recall what it was. Could you drop by #eclipse-linux on irc.freenode.net (IRC). There are usually Ubuntu/Debian maintainers for Eclipse around. They would be happy to help you. Sorry about that.
Robert Simpson wrote on Sat, 27 November 2010 04:46 |
Anyway, removed the eclipse installation. Downloaded the Helios version and manually installed it. Likewise with Oprofile. Eclipse works again.
Oprofile gave an error about a missing qt library. I have both qt3 and qt4 installed. Qt4 definitely works. Don't have anything to test qt3.
Tried installing the plugin using http://wiki.eclipse.org/Linux_Tools_Project/PluginInstallHel p. It gave the following errors:
An error occurred while collecting items to be installed
session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.core,0.3.0.20100 8261754
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.core.linux.x86_6 4,0.3.0.201008261754
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.doc,0.3.0.201008 261754
No repository found containing: org.eclipse.update.feature,org.eclipse.linuxtools.oprofile,0 .3.0.201008261754
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.launch,0.3.0.201 008261754
No repository found containing: osgi.bundle,org.eclipse.linuxtools.oprofile.ui,0.3.0.2010082 61754
I tried the suggestions here: http://stackoverflow.com/questions/511367/error-when-updatin g-eclipse
No luck. Still the same error.
The wiki at http://wiki.eclipse.org/Linux_Tools_Project/PluginInstallHel p talks about manually installing 'zip' files. But there doesn't seem to be a zip file, only bz2 files and the repository archive dialog will only accept .zip or .jar.
I also tried extracting the bz2 file to the eclipse directory but it's not recognized. I wasn't sure exactly which directory it should be in (plugin, top level, other). I'm not sure if manual installation is even allowed although some websites e.g. http://agile.csc.ncsu.edu/SEMaterials/tutorials/install_plug in/index_v35.html suggest it is (but then miss out important details).
There seem to be a _lot_ of reports of errors when installing the plugin so should I just wait (another) few months or is there anything I can do to get it working now?
|
There is an EPP package which includes CDT, Linuxtools (i.e. also the oprofile plug-in). It's available here:
http://www.eclipse.org/downloads/
The package you are looking for is called "Eclipse IDE for C/C++ Linux Developers". Could you try using that? When you try to use the oprofile plugin the first time you will need to compile opxml first, but instructions for that should pop up once the plugin notices that there is no opxml where it looks for it. Feel free to get back to us should you have problems compiling that. Either here or in #eclipse-linux on Freenode.
Cheers,
Severin
|
|
| | | |
Goto Forum:
Current Time: Thu Apr 25 19:35:50 GMT 2024
Powered by FUDForum. Page generated in 0.04813 seconds
|