Thread: Question about Gprof

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    15

    Question about Gprof

    I just got through playing around with Gprof and my results seem to be nonsensical. The program, a directory lister, ran for about ten seconds and then exited normally. The gmon.out file appeared and I ran it through Gprof. The problem is that the results only show the program running for 0.02 seconds. I am doing all of this under windows and I was wondering if that perhaps is the problem.

    Thanks in advance for the help,

    PetrolMan

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by PetrolMan View Post
    I just got through playing around with Gprof and my results seem to be nonsensical. The program, a directory lister, ran for about ten seconds and then exited normally. The gmon.out file appeared and I ran it through Gprof. The problem is that the results only show the program running for 0.02 seconds. I am doing all of this under windows and I was wondering if that perhaps is the problem.

    Thanks in advance for the help,

    PetrolMan
    Sounds about right. Compared to the glacially slow rate of reading from disk, your program did practically nothing at all. Instead it twiddled its thumbs for ten seconds.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 01:47 AM