Instrumentign Linux binaries made by icc

Instrumentign Linux binaries made by icc

I am trying to build a call graph for a binary made on Linux platform with an Intel compiler (icc). My version of vtune is 2.0 and icc reports itself as being 8.1. I can successfully build callgraph for applications built with gcc (3.2.2) but whenever i build the same application with icc, vtl doesn' seem to be able to run it.
It goes through usual "static instrumentation" messages and then just exits like so:
Thu Oct 14 12:26:12 2004 Static instrumentation done
Thu Oct 14 12:26:13 2004 Data collection started...
Thu Oct 14 12:26:16 2004 Data collection finished...
The Activity has finished running.

The actual program is not being executed at all. Any help with this would be appreciated.

23 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

No takers? It just seems strange that gcc would be supported while Intel's own compiler would not. This also makes us unable to use vtune at all since our project is compiled entirely under Intel's icc.

Mrxonix, a very interesting scenario you're describing!

Of course in theory, if the application is RUNNING our processor, vtune should be able to callgraph it, plain and simple.

Consider repeating your experiment with the icc code, but this time, a few moments in, while things still appear to be working, run the ActivityController and try to stop the activity:

$ ActivityController

If there is an activity, and if this stops it, do you see a callgraph result? If there is no real activity at all, that is, the app isn't running ever, the ActivityController will tell you that no activities are running, and you won't be given the opportunity to act on one.

Can you run a 20-second sampling session on the exact same code, compiled by icc? (If yes, that would limit the issue to the callgraph functionality itself.)

If neither of these tests reveals anything of interest, now would be a great time to open a case at premier.intel.com. If you include a pack of the project that shows the failure, it could speed things up.

Regardless, please report back here once you've been able to try the above.

cheers
jdg

First, the time interval between "data collection started" and "data collection finished" is pretty short for icc compiled application (even though the real runtime is made fairly long for test purposes). So it does look as though application is never started.

I was able to run ActivityController and stop the running activity (takes a very quick hand movement :) but still, no call graph was produced. The results of "vtl view" command are: "The Activity Result was not found", while "vtl show" returns only this: "a1__Activity1" and nothing more, no results saved for it.

Everything works fine as soon as I recompile same source file with gcc.

I would certainly like to post a suppot case, however for reasons well outside my control, we are still running on demo license (and procurement is doing what it does best - wasting a few months buying the real license). So I don't have access to premier support, AFAIK.

mrxonix, thanks for speedy reply.

1) will continue to investigate here, if a bug in icc or vtune or elsewhere even

2) ANY CHANCE at all, you could duplicate the experiment on our extremely mature vtune 3.0 for linux beta, which is currently scheduled to be generally available late DEC or very early JAN?

I'd strongly suggest you give it a try. Register to download (fast and free) here:

http://www.intel.com/software/products/vtune/beta/vt_pa_linux_beta_external.htm

3) After you register, you will get a confirmation email with a beta software license that is good until the end of DEC 2004. You will also get download instructions. Mix the license with the untarred archive before installing.

4) Also, before installing the new, you'll needto "uninstall" the current vtl 2.0 install, default location /opt/intel/vtune/bin/uninstall.sh, if memory serves

5) Run the new install, and repeat the experiment, report back here

By registering for the beta, you AUTOMATICALLY get Intel Premier support for the beta software, and can open any case issues you might wish.

cheers
jdg

Message Edited by jdgallag on 10-20-2004 10:18 AM

We are planning to try vtune 3.0, but this is in hands of our sysadmins which may take a long time.

I registered for the 3.0 beta download but my premier support page does not allow me to select it as a product to report problems with.Perhaps I should download a file to get the option of support, not sure.

Registration is email based: whatever email you registered for the beta software, that's the email address that has a premier account.

I can explore your email registration: email it to me at vtune.sales@intel.com, and I'll report what I find back to you.

cheers
jdg

I have observed this, too... exes compiled with icc 7.0, icc 8.0, gcc 3.3.x, gcc 3.4.x all can be profiled just fine, but icc 8.1 doesn't seem to work at all with vtune 2.0.

Can you describe what you're seeing, Diyige? Have you opened a premier case, and if so, what is its number?

cheers
jdg

jd, I have sent you an email at vtune.sales, however it seems to have bounced back. i resent it this morning - tell me if you get it?

Thanks!

I haven't opened a case, but the symptoms are exactly the same as described by the original poster, so I guess I don't have much to add there.

GOT IT, Mrxonix! Perhaps even by the time you read this, you'll have gotten my email confirming receipt. Stay tuned!

cheers
jdg

Thanks diyige, I'll keep you in the loop, post what we find here asap.

cheers
jdg

I just tried again, using

Intel C++ Compiler for 32-bit applications, Version 8.1 Build 20041019Z Package ID: l_cc_pu_8.1.024

and

VTune Performance Analyzer 3.0 for Linux*
Build: 814

on vtundemo

I changed the Makefile to

CC=/opt/intel/intel_cc_80/bin/icpc
CFLAGS=-g
LIBS=-static -lm -cxxlib-icc -static-libcxa
and it compiles and runs, but when I run an activity, I get

vtl run a2
VTune Performance Analyzer 3.0 for Linux*
Copyright (C) 2000-2004 Intel Corporation. All rights reserved.
The Activity is running.
Fri Mar 25 11:42:58 2005 Reading property files started...
Fri Mar 25 11:42:58 2005 Reading property files done.
Fri Mar 25 11:42:58 2005 Static instrumentation started
Fri Mar 25 11:42:58 2005 All functions instrumentation of module "vtundemo" could not be done (see error description below).
Fri Mar 25 11:42:58 2005 Exports instrumentation of module "libc.so.6" was skipped.
Fri Mar 25 11:42:58 2005 All functions instrumentation of module "libm.so.6" was skipped.
Fri Mar 25 11:42:59 2005 Static instrumentation done
Fri Mar 25 11:42:59 2005 Error in module "/var/vtune/users/f350984/vtundemo/vtundemo" - Can not run / close / wait on instrumentor process.
Fri Mar 25 11:42:59 2005 Data collection halted...
Fri Mar 25 11:42:59 2005 No module from the activity was loaded
The Activity has finished running.
and the activity never actually runs. It works fine with the default cc (/usr/lib/gcc-lib/i486-suse-linux/3.2.2)

diyige

What do the makefiles look like? What compiler options are you using for each case?

I am running RH AS4 (linux 2.6.9) on a dual-CPU Itanium2 m/c and I am facing a similar situation with postgresql-8.0.1 (compiled with icc 8.1.028)-

======================START=====================================
VTune Performance Analyzer 3.0 for Linux*. FOR NON-COMMERCIAL USE ONLY
The Activity is running.
Wed Mar 30 23:29:18 2005 Reading property files started...
Wed Mar 30 23:29:18 2005 error: the property 'buffer size' was not set in the property file.
Wed Mar 30 23:29:18 2005 Reading property files failed.
Wed Mar 30 23:29:18 2005 Static instrumentation started
Wed Mar 30 23:29:23 2005 All functions instrumentation of module "postgres" could not be done (see error description below).
Wed Mar 30 23:29:23 2005 Static instrumentation done
Wed Mar 30 23:29:23 2005 Error in module "/home/vkalsi/dbms/pgsql/bin/postgres" - Can not run / close / wait on instrumentor process.
Wed Mar 30 23:29:23 2005 Data collection halted...
Wed Mar 30 23:29:23 2005 No module from the activity was loaded
The Activity has finished running.
========================END=====================================

A simple C program produces the correct callgraph, so the vtune installation as such is good.

Elsewhere on this forum I read that vtune callgraph cannot attach to already running processes and this seems to be the case with pgsql, since my "module of interest" was the background postgres process which is spawned by the already running postmaster process. Also, to be noted that postmaster is spawned by pg_ctl. So, pg_ctl --> postmaster --> postgres

So, my questions are-
1) If I start vtune callgraph on the startup process i.e. pg_ctl, will vtune profile the spawned processes i.e. postgres?
2) Is there some way to start-stop Activities from inside applications being profiled?

All suggestions welcome,
Thanks,

I am running RH AS4 (linux 2.6.9) on a dual-CPU Itanium2 m/c and I am facing a similar situation with postgresql-8.0.1 (compiled with icc 8.1.028)-

======================START=====================================
VTune Performance Analyzer 3.0 for Linux*. FOR NON-COMMERCIAL USE ONLY
The Activity is running.
Wed Mar 30 23:29:18 2005 Reading property files started...
Wed Mar 30 23:29:18 2005 error: the property 'buffer size' was not set in the property file.
Wed Mar 30 23:29:18 2005 Reading property files failed.
Wed Mar 30 23:29:18 2005 Static instrumentation started
Wed Mar 30 23:29:23 2005 All functions instrumentation of module "postgres" could not be done (see error description below).
Wed Mar 30 23:29:23 2005 Static instrumentation done
Wed Mar 30 23:29:23 2005 Error in module "/home/vkalsi/dbms/pgsql/bin/postgres" - Can not run / close / wait on instrumentor process.
Wed Mar 30 23:29:23 2005 Data collection halted...
Wed Mar 30 23:29:23 2005 No module from the activity was loaded
The Activity has finished running.
========================END=====================================

A simple C program produces the correct callgraph, so the vtune installation as such is good.

Elsewhere on this forum I read that vtune callgraph cannot attach to already running processes and this seems to be the case with pgsql, since my "module of interest" was the background postgres process which is spawned by the already running postmaster process. Also, to be noted that postmaster is spawned by pg_ctl.

So, pg_ctl --> postmaster --> postgres

So, my questions are-
1) If I start vtune callgraph on the startup process i.e. pg_ctl, will vtune profile the spawned processes i.e. postgres?
2) Is there some way to start-stop Activities from inside applications being profiled?

All suggestions welcome,
Thanks,

I am running RH AS4 (linux 2.6.9) on a dual-CPU Itanium2 m/c and I am facing a similar situation with postgresql-8.0.1 (compiled with icc 8.1.028)-

vtl activity -c callgraph
-app /home/vkalsi/var/pgsql/runLineitem.sh
-moi /home/vkalsi/dbms/pgsql/bin/postgres

======================START=====================================
VTune Performance Analyzer 3.0 for Linux*. FOR NON-COMMERCIAL USE ONLY
The Activity is running.
Wed Mar 30 23:29:18 2005 Reading property files started...
Wed Mar 30 23:29:18 2005 error: the property 'buffer size' was not set in the property file.
Wed Mar 30 23:29:18 2005 Reading property files failed.
Wed Mar 30 23:29:18 2005 Static instrumentation started
Wed Mar 30 23:29:23 2005 All functions instrumentation of module "postgres" could not be done (see error description below).
Wed Mar 30 23:29:23 2005 Static instrumentation done
Wed Mar 30 23:29:23 2005 Error in module "/home/vkalsi/dbms/pgsql/bin/postgres" - Can not run / close / wait on instrumentor process.
Wed Mar 30 23:29:23 2005 Data collection halted...
Wed Mar 30 23:29:23 2005 No module from the activity was loaded
The Activity has finished running.
========================END=====================================
The app runLineitem.sh is never executed, but a simple C program produces the correct callgraph, so the vtune installation as such is good.

Elsewhere on this forum I read that vtune callgraph cannot attach to already running processes and this seems to be the case with pgsql, since my "module of interest" was the background postgres process which is spawned by the already running postmaster process. Also, to be noted that postmaster is spawned by pg_ctl.

So, pg_ctl --> postmaster --> postgres

So, my questions are-
1) If I start vtune callgraph on the startup process i.e. pg_ctl, will vtune profile the spawned processes i.e. postgres?
2) Is there some way to start-stop Activities from inside applications being profiled?

All suggestions welcome,
Thanks,

Hey vikram_kalsi

Do you see that OS in the release notes under the supported OS list?

Hey jdg,

Actually, Premier Support gave me an updated (internal) version of the Vtune driver and vtl which works on the RHEL 2.6 kernel, and besides that, callgraph of a simple C program works correctly.

Also, I looked through the source of postgres and finally was able to launch just postgress (with appropriate cmd line args) and also specify postgres as my module of interest.

So, my activity looks like-
vtl -start-paused -c callgraph
-app /home/vkalsi/dbms/pgsql/bin/postgres," -D $PGDATA tpcd"

-moi /home/vkalsi/dbms/pgsql/bin/postgres

However, vtune still doesn't work, and I guess it fails in the first step itself where it inserts some code into the binary.

I can also see that postgres has some fork() cmds where it daemonizes itself and also uses that to service client requests.

Can anybody confirm if vtune callgraph works in the presence of fork()?

Should I try to recompile with gcc and see if it works?

Thanks in anticipation,

Double check me: that internal only VDK which supports 2.6? That's sampling only, not callgraph. Is there a readme in your install that confirms my memory here?

cheers
jdg

The README is attached, and you are right that it doesn't say anything about Callgraph. Seems my assumption was wrong that the update was for Sampling and Callgraph!

Should I check with Premier support if they have an update to make callgraph work?

Thanks,

Yes, so that we don't lose track of your getting it, once EM64T callgraph is supported. (That's probably going to happen in the summer.)

cheers
jdg

Message Edited by jdgallag on 04-04-2005 07:42 AM

Leave a Comment

Please sign in to add a comment. Not a member? Join today