Ask a Question related to UNIX Programming, Design and Development.
-
Alex #1
gprof with C and C++ not working
Hello,
Need your help, second day can't get this working.
I need to compile a program with gprof.
Program compiles, but doesnt generate information I need.
Program consists of C and C++ code, and is compiled on SunOS 2.6.
For C compiler we use "cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2"
For C++ compiler we use "gcc version 2.95.2 19991024 (release)"
The link stage we use the same C++ compiler (gcc).
I am not compiling entire souce with gprof options. Only the major
part of what I want to analize.
For cc I used -xpg option
and for gcc I used -pg option
link line does: gcc -pg
and links C and C++ code.
To me it looks like only the C++ code gets profiled. I see some
references to "main", but nothing I am interested in.
The program creates children processes, so I figured to set PROFDIR.
When I set it, no profile file gets generated at all (I tried a simple
a.out, that generates a file exactly where I want it).
So something bad is happening.
Please let me know if you have any suggestions.
Thank you.
Alex
Alex Guest
-
HELP PLEASE ITS NOT WORKING
After you uninstall Flash Player from all user accounts make sure that all files from C:\WINDOWS\system32\Macromed\ are removed. Instructions for... -
#38816 [Opn]: PHP code that was working perfectly recently stopped working.
ID: 38816 User updated by: mtoohee at gmail dot com -Summary: PHP code that was working perfectly recently stopped.... -
Macromedia Flash Player installed and working properly suddenlys stops working..
No idea what has caused the Flash player to stop working. This is not my machine but a relatives who has asked for help over the T'giving... -
Data not working on Label but is working in Datagrid
I am creating a simple website in Flex. I want to show different content from the database for home, about us, contact us, etc. I am using a CFC as... -
Working TableStyle Not Working on a Second DataGrid
I am having difficulty getting Tablestyles to work on a datagrid. I have 2 datasets, 1 filled and the other not. The first contains customer, stock... -
llewelly #2
Re: gprof with C and C++ not working
[email]abeylin@yahoo.com[/email] (Alex) writes:
> Hello,
> Need your help, second day can't get this working.
> I need to compile a program with gprof.
> Program compiles, but doesnt generate information I need.
>
> Program consists of C and C++ code, and is compiled on SunOS 2.6.
> For C compiler we use "cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2"
> For C++ compiler we use "gcc version 2.95.2 19991024 (release)"
> The link stage we use the same C++ compiler (gcc).>
> I am not compiling entire souce with gprof options. Only the major
> part of what I want to analize.
> For cc I used -xpg option
> and for gcc I used -pg option
> link line does: gcc -pg
> and links C and C++ code.IIRC, the profiling info generated by using Sun cc -xpg is not>
> To me it looks like only the C++ code gets profiled. I see some
> references to "main", but nothing I am interested in.
> The program creates children processes, so I figured to set PROFDIR.
> When I set it, no profile file gets generated at all (I tried a simple
> a.out, that generates a file exactly where I want it).
readable by gprof. My only suggestion is to use gcc -pg to compile
your C code instead of Sun cc.
llewelly Guest
-
Alex #3
Re: gprof with C and C++ not working
Oleg Goldshmidt <pub@NOSPAM.goldshmidt.org> wrote in message news:<m3fzlmrn4u.fsf@zaphod.goldshmidt.org>...
Yes, sorry I am compiling C++ code with g++.> llewelly <llewelly.at@xmission.dot.com> writes:
>>> > [email]abeylin@yahoo.com[/email] (Alex) writes:
> >> > > Hello,
> > > Need your help, second day can't get this working.
> > > I need to compile a program with gprof.
> > > Program compiles, but doesnt generate information I need.
> > >
> > > Program consists of C and C++ code, and is compiled on SunOS 2.6.
> > > For C compiler we use "cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2"
> > > For C++ compiler we use "gcc version 2.95.2 19991024 (release)"
> > > The link stage we use the same C++ compiler (gcc).>> > >
> > > I am not compiling entire souce with gprof options. Only the major
> > > part of what I want to analize.
> > > For cc I used -xpg option
> > > and for gcc I used -pg option
> > > link line does: gcc -pg
> > > and links C and C++ code.>> >> > >
> > > To me it looks like only the C++ code gets profiled. I see some
> > > references to "main", but nothing I am interested in.
> > > The program creates children processes, so I figured to set PROFDIR.
> > > When I set it, no profile file gets generated at all (I tried a simple
> > > a.out, that generates a file exactly where I want it).
> > IIRC, the profiling info generated by using Sun cc -xpg is not
> > readable by gprof. My only suggestion is to use gcc -pg to compile
> > your C code instead of Sun cc.
> Also, hopefully you use g++ to compile C++, not gcc.
I just wrote gcc, because doing g++ -v produced messages about gcc.
I got a little farther, by compiling more code with profiling.
But now if I compile one of our C libraries with profiling and run
routines from it, the whole thing coredumps. Running same library
without profiling works fine.
I will try compiling with gcc, I was using cc.
Thank you.
Alex
Alex Guest
-
Wim Lauwers #4
Re: gprof with C and C++ not working
Alex wrote:
Is it a shared library? Might not work, try linking it as a static one (.a).> Oleg Goldshmidt <pub@NOSPAM.goldshmidt.org> wrote in message news:<m3fzlmrn4u.fsf@zaphod.goldshmidt.org>...
>>>>llewelly <llewelly.at@xmission.dot.com> writes:
>>
>>>>>>>abeylin@yahoo.com (Alex) writes:
>>>
>>>
>>>>Hello,
>>>>Need your help, second day can't get this working.
>>>>I need to compile a program with gprof.
>>>>Program compiles, but doesnt generate information I need.
>>>>
>>>>Program consists of C and C++ code, and is compiled on SunOS 2.6.
>>>>For C compiler we use "cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2"
>>>>For C++ compiler we use "gcc version 2.95.2 19991024 (release)"
>>>>The link stage we use the same C++ compiler (gcc).
>>
>>>>>>>>I am not compiling entire souce with gprof options. Only the major
>>>>part of what I want to analize.
>>>>For cc I used -xpg option
>>>>and for gcc I used -pg option
>>>>link line does: gcc -pg
>>>>and links C and C++ code.
>>
>>>>>>>>To me it looks like only the C++ code gets profiled. I see some
>>>>references to "main", but nothing I am interested in.
>>>>The program creates children processes, so I figured to set PROFDIR.
>>>>When I set it, no profile file gets generated at all (I tried a simple
>>>>a.out, that generates a file exactly where I want it).
>>>
>>>IIRC, the profiling info generated by using Sun cc -xpg is not
>>> readable by gprof. My only suggestion is to use gcc -pg to compile
>>> your C code instead of Sun cc.
>>Also, hopefully you use g++ to compile C++, not gcc.
>
> Yes, sorry I am compiling C++ code with g++.
> I just wrote gcc, because doing g++ -v produced messages about gcc.
> I got a little farther, by compiling more code with profiling.
> But now if I compile one of our C libraries with profiling and run
> routines from it, the whole thing coredumps. Running same library
> without profiling works fine.
> I will try compiling with gcc, I was using cc.
>
> Thank you.
> Alex
Wim
Wim Lauwers Guest
-
Alex #5
Re: gprof with C and C++ not working
I have another problem now.
I was able to build and run with gprof on the machine successfully.
Problem occurs when I try to run the program from a different machine.
I build on SunOS 2.6, and try to run on 2.8.
I get lots of these lines:
libc: warning: libc/libthread interface mismatch: unknown tag value
ignored
than it coredumps.
I tried something crazy: I copied the whole /usr/lib from my 2.6
machine to 2.8 machine, and set LD_LIBRARY_PATH to first point there.
The program starts, but it seems that the threads fail, and everything
which is not threaded works.
Do you know if building with gprof and then compying to a different
machine (and OS level) is supported?
Thank you.
Alex
Alex Guest



Reply With Quote

