Operating System - HP-UX
1748136 Members
3780 Online
108758 Solutions
New Discussion юеВ

Re: problem of profile based optimization

 
SOLVED
Go to solution
yangk
Frequent Advisor

problem of pofile based optimization

Dear All,

I just want to use the profile-based optimization to optimize my programs.

I use the option "+I and +P" of cc like this:

-W b,-a +I +P

But in the link time, it says that:

cc: warning 401: +I/+Oprofile=collect and +P/+Oprofile=use are mutually exclusive, +I/+Oprofile=collect ignored.
ucomp :
Error : Could not open profile database flow.data. Check file permissions. (6375)

So could you some give some advices about this?

Thanks in advance!

Kevin
11 REPLIES 11
Dennis Handly
Acclaimed Contributor

Re: problem of profile based optimization

Is this for PA or Integrity?
You must first build by using +Oprofile=collect. Then you run the instrumented executable to collect the data in flow.data. Then you rebuild by using +Oprofile=use.

yangk
Frequent Advisor

Re: problem of pofile based optimization

Hi,

My machine is PA 11.31 OS.

It seems that the +Oprofile=collect and +Oprofile=use is used in IA machine.

Thanks!
Dennis Handly
Acclaimed Contributor

Re: problem of profile based optimization

>It seems that the +Oprofile=collect and +Oprofile=use is used in IA machine.

Yes and these simplified options were back ported to PA.

Anyway, use one of +I or +P at a time.
And I'm not sure why you are using an internal option -Wb,-a?

yangk
Frequent Advisor

Re: problem of pofile based optimization

Hi Dennis,

Because in my project there are some codes writen by assembly language.So i use the
-W d,-a option of cc.

But i have tried use "+I" or "+P" option to do the profile based optimization to the cc command, but it also has some problem about the permisson of flow.date.

Thanks!

Steven Schweda
Honored Contributor

Re: problem of pofile based optimization

> but it also has some problem about the
> permisson of flow.date.

Believe it or not, sometimes showing an
actual command with its actual error message
can be more helpful than a vague description.

Or were you hoping to get help from some
psychic who already knows what "some problem
about the permisson of flow.date" means?
Dennis Handly
Acclaimed Contributor
Solution

Re: problem of profile based optimization

>there are some codes written by assembly language. So I use the -W d,-a option.

(You had -Wb not -Wd. Also, you shouldn't have a space there.)

>I have tried use +I or +P option to do the profile based optimization to the cc command, but it also has some problem about the permission of flow.data.

You don't try "use +I OR +P option". You first do +I, then run your executable.
What step is failing?

Have you read the documentation?
http://docs.hp.com/en/7763/5991-4871/summ_opt.html#RN.CVT.NN418
http://docs.hp.com/en/14672/Help/options.htm#opt+capsI

In order to understand the PBO process, you should try a simple hello world program.

What directory are you in? What is the permission of flow.data?
Have you exported FLOW_DATA to point to your flow.data file?

yangk
Frequent Advisor

Re: problem of pofile based optimization

Hi Dennis,

Yeah, I should delete the space between the -W d.

Now "+I" is added to the cc compiler command.


The error is during to create a dynamic library from a static library.
The command is like this:

/usr/bin/ld +vnocompatwarnings -b -z +s -o libcrypto.sl.1 +h libcrypto.sl.1 -Fl libcrypto.a -ldld -lc

The error is like this:
ucomp :
Error at line 0 : File I/O error while reading dyn_lck.o()

dyn_lck.o is packed in the static library libcrypto.a

ar -t libcrypto.a |grep dyn_lck.o
dyn_lck.o

So the error seems so strange to me.

Dennis Handly
Acclaimed Contributor

Re: problem of profile based optimization

>Now +I is added to the cc compiler command.

What version of the C compiler are you using?

>The error is during to create a dynamic library from a static library.

(The proper HP-UX terminology is shared and archive libs.)

>ld -b +s -Fl libcrypto.a -ldld -lc

You shouldn't add -lc to shlibs, you should depend on the one on the executable.
You should also be using cc to link, not ld directly. It seems you are missing ld's -I option?

>ucomp: File I/O error while reading dyn_lck.o

Can you extract dyn_lck.o from libcrypto.a?
You may also want to try extracting all of the objects in the archive and then passing the objects directly to ld.

yangk
Frequent Advisor

Re: problem of pofile based optimization

Hi Dennis,

Yes i can extract all the ".o" file from
the libcrypto.a.

how can i use all the "*.o" to create a
dynamic libcrypto?

Thanks!