This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gprof skips std::ofstream methods


Hello,
 
I'm new to gprof so sorry if this is a basic question.
 
gprof does not seem to include std::ofstream methods when profiling.
 
Consider the following program in test.cpp:
 
#include <fstream>
using namespace std;
int main()
{
    unsigned long data = 1;
    ofstream fout("test.txt", ios_base::out | ios_base::binary);
    fout.write(reinterpret_cast<const char*>(&data), sizeof(data));
    fout.close();
}

I then compile like this: g++ -pg -otest test.cpp
and run gprof like this: gprof test
 
The only function that appears in the profiling results is
 
std::operator|(std::_Ios_Openmode, std::_Ios_Openmode)
 
Neither of ofstream::ofstream(), ofstream::write(), or ofstream::close()
appear. Am I missing some options perhaps that would make these appear?
 
Many thanks,
Nate. 		 	   		  
_________________________________________________________________
Hotmail & Messenger are available on your phone. Try now.
http://go.microsoft.com/?linkid=9724461


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]