C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 04-27-2002, 01:12 AM   #1
geek
 
SilentStrike's Avatar
 
Join Date: Aug 2001
Location: NJ
Posts: 1,141
Profiler for g++

Does anyone have any recommendations for a free profiler for code generated by g++? I searched google for g++ and profiler, but I didn't come up with anything.
__________________
Prove you can code in C++ or C# at TopCoder, referrer rrenaud
Read my livejournal
SilentStrike is offline   Reply With Quote
Old 04-27-2002, 07:48 AM   #2
Fingerstyle Guitarist
 
taylorguitarman's Avatar
 
Join Date: Aug 2001
Posts: 564
Have you tried the GNU one yet? You probably even have it already.
http://www.gnu.org/manual/gprof-2.9....gprof_toc.html
taylorguitarman is offline   Reply With Quote
Old 04-27-2002, 12:11 PM   #3
geek
 
SilentStrike's Avatar
 
Join Date: Aug 2001
Location: NJ
Posts: 1,141
I tried it, but it's weird. It doesn't work for my game. I compile it with the -pg flag and then run it, but instead of the game working like normal, it's just all black. The profiler output is obviously erroroneoss as well, the first few lines...

Code:
Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total
 time   seconds   seconds    calls  us/call  us/call  name
 33.33      0.01     0.01      902    11.09    11.09  _Rb_tree<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >, pair<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > const, SDL_Surface *>, _Select1st<pair<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > const, SDL_Surface *> >, less<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > >, allocator<SDL_Surface *> >::end(void)
 33.33      0.02     0.01      321    31.15    31.15  basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::replace(unsigned int, unsigned int, char const *, unsigned int)
 33.33      0.03     0.01       83   120.48   120.48  _Rb_tree<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >, pair<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > const, Parse::ParseAction *>, _Select1st<pair<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > const, Parse::ParseAction *> >, less<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > >, allocator<Parse::ParseAction *> >::find(basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > const &)
  0.00      0.03     0.00   103503     0.00     0.00  basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::rep(void) const
  0.00      0.03     0.00    37913     0.00     0.00  Util::Matrix<Game::GameMap::MapTile *>::numCols(void) const
  0.00      0.03     0.00    30129     0.00     0.00  basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::length(void) const
  0.00      0.03     0.00    29801     0.00     0.00  basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::Rep::data(void)
  0.00      0.03     0.00    18840     0.00     0.00  Util::Matrix<Game::GameMap::MapTile *>::operator()(int, int)
  0.00      0.03     0.00    17762     0.00     0.00  basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >::data(void) const
  0.00      0.03     0.00    17408     0.00     0.00  Game::Flame::drawAt(SDL_Surface *, SDL_Rect *)
  0.00      0.03     0.00    15640     0.00     0.00  Graphics::SingleFrameImage::drawAt(SDL_Surface *, SDL_Rect *)
__________________
Prove you can code in C++ or C# at TopCoder, referrer rrenaud
Read my livejournal
SilentStrike is offline   Reply With Quote
Old 04-27-2002, 08:14 PM   #4
Fingerstyle Guitarist
 
taylorguitarman's Avatar
 
Join Date: Aug 2001
Posts: 564
Are you looking for something more like CPU monitors and stuff where you can see the realtime stats? Perhaps just build a small class to output what you need to the screen, like FPS and stuff.
__________________
If a tree falls in the forest, and no one is around to see it, do the other trees make fun of it?
taylorguitarman is offline   Reply With Quote
Old 04-27-2002, 09:27 PM   #5
geek
 
SilentStrike's Avatar
 
Join Date: Aug 2001
Location: NJ
Posts: 1,141
I was looking for a profiler, one that shows the time spent in each function, etc, but using gprof and the -pg flag makes the program not work.
__________________
Prove you can code in C++ or C# at TopCoder, referrer rrenaud
Read my livejournal
SilentStrike is offline   Reply With Quote
Old 04-29-2002, 11:01 PM   #6
geek
 
SilentStrike's Avatar
 
Join Date: Aug 2001
Location: NJ
Posts: 1,141
Same black screen odd behavior with the profiler from MSVC, guess I gotta start hunting for memory errors .
__________________
Prove you can code in C++ or C# at TopCoder, referrer rrenaud
Read my livejournal
SilentStrike is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for free c++ simple profiler umen242 C++ Programming 3 05-25-2008 02:38 AM
Code profiler? h3ro Tech Board 5 04-07-2008 09:16 AM
How can I make a .NET profiler? honeysting C# Programming 0 03-26-2006 06:30 AM
Memory profiler for PHP alphaoide Tech Board 2 01-27-2005 04:18 PM
Visual C++ Profiler robquigley C++ Programming 2 01-17-2003 09:17 AM


All times are GMT -6. The time now is 02:31 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22