summaryrefslogtreecommitdiff
blob: cc7bc5132ad6afc0a624e3673ebda60bf310534e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
--- kprof/parseprofile_fnccheck.h	2002-09-09 23:47:13.000000000 +0200
+++ kprof/parseprofile_fnccheck.h	2005-09-02 11:17:00.000000000 +0200
@@ -22,7 +22,7 @@
 #endif
 
 class CProfileInfo;
-class QString;
+class QTextStream;
 
 class CParseProfile_fnccheck : public CParseProfile
 {
--- kprof/parseprofile_gprof.h	2002-07-16 20:32:42.000000000 +0200
+++ kprof/parseprofile_gprof.h	2005-09-02 11:17:39.000000000 +0200
@@ -23,6 +23,7 @@
 #endif
 
 class CProfileInfo;
+class QTextStream;
 
 class CParseProfile_gprof : public CParseProfile
 {
--- kprof/parseprofile_pose.h	2002-09-09 23:47:13.000000000 +0200
+++ kprof/parseprofile_pose.h	2005-09-02 11:17:20.000000000 +0200
@@ -22,7 +22,7 @@
 #endif
 
 class CProfileInfo;
-class QString;
+class QTextStream;
 
 class CParseProfile_pose : public CParseProfile
 {
--- kprof/kprofwidget.cpp	2004-10-28 17:03:05.000000000 +0200
+++ kprof/kprofwidget.cpp	2005-09-02 08:31:22.000000000 +0200
@@ -834,15 +834,7 @@
 void KProfWidget::gprofStdout (KProcess *, char *buffer, int buflen)
 {
 	BEGIN;
-	
-	char* newbuf = new char[buflen];
-	strncpy(newbuf, buffer, buflen);
-	newbuf[buflen] = '\0';
-
-	mGProfStdout += QString::fromLocal8Bit (newbuf, buflen);
-
-	delete [] newbuf;
-
+	mGProfStdout += QString::fromLocal8Bit (buffer, buflen);
 	END;
 }
 
--- kprof/parseprofile_gprof.cpp	2005-08-25 16:08:04.000000000 +0200
+++ kprof/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);