--- parseprofile_gprof.cpp.orig	2005-08-25 16:08:04.000000000 +0200
+++ parseprofile_gprof.cpp	2005-08-25 16:11:07.000000000 +0200
@@ -119,8 +119,6 @@
 			{
 				CProfileInfo *p = new CProfileInfo;
 				p->ind				= profile.count ();
-				p->cumPercent		= fields[0].toFloat ();
-				p->cumSeconds		= fields[1].toFloat ();
 				p->selfSeconds		= fields[2].toFloat ();
 				if (fields[3][0].isDigit ())
 				{
@@ -221,6 +219,17 @@
 
 				if (e->primary == true && count.find ('+') != -1)
 					e->recursive = true;
+				
+				// if this is a primary entry, get the total time and percentage
+				if (e->primary == true)
+				{
+					CProfileInfo *tPrimary = locateProfileEntry (e->name, profile);
+					if (tPrimary != NULL)
+					{
+						tPrimary->cumPercent		= fields[1].toFloat ();
+						tPrimary->cumSeconds		= tPrimary->selfSeconds + fields[3].toFloat ();
+					}
+				}
 
 				if (callGraphBlock.count () == callGraphBlock.size ())
 					callGraphBlock.resize (callGraphBlock.size () + 32);
