aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrajesh2014-01-15 04:21:07 (EST)
committerRodrigo Fraxino Araujo2014-01-15 13:58:17 (EST)
commit59294cfb0e0f8f131a4c4a1145da1356bb311171 (patch)
tree15080a7b8236c1f1f10cc41ab6b8ea2a08b4b173
parent5aa4af794b947f560a91a13659b1269b0af1d8a8 (diff)
downloadorg.eclipse.linuxtools-59294cfb0e0f8f131a4c4a1145da1356bb311171.zip
org.eclipse.linuxtools-59294cfb0e0f8f131a4c4a1145da1356bb311171.tar.gz
org.eclipse.linuxtools-59294cfb0e0f8f131a4c4a1145da1356bb311171.tar.bz2
oprofile: percentages for operf are not being shown correctly(BZ:425439).refs/changes/44/20644/2
Depending on the program, the total sum of the binary and its dependent images were more than a hundred percent. Fixed the calculation of them. fix oprofile test plugin build issue too. Signed-off-by: Brajesh <brrathor@linux.vnet.ibm.com> Change-Id: Id93ac3d45c01dc682a6dd98624b8c29296e3c29e Reviewed-on: https://git.eclipse.org/r/20644 Tested-by: Hudson CI IP-Clean: Rodrigo Fraxino Araujo <rfaraujo@linux.vnet.ibm.com> Tested-by: Rodrigo Fraxino Araujo <rfaraujo@linux.vnet.ibm.com> Reviewed-by: Roland Grunberg <rgrunber@redhat.com> Reviewed-by: Rodrigo Fraxino Araujo <rfaraujo@linux.vnet.ibm.com>
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui.tests/src/org/eclipse/linuxtools/oprofile/ui/tests/TestUiDataModel.java16
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelDependent.java2
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java4
3 files changed, 11 insertions, 11 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui.tests/src/org/eclipse/linuxtools/oprofile/ui/tests/TestUiDataModel.java b/oprofile/org.eclipse.linuxtools.oprofile.ui.tests/src/org/eclipse/linuxtools/oprofile/ui/tests/TestUiDataModel.java
index a86bd77..31631a0 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui.tests/src/org/eclipse/linuxtools/oprofile/ui/tests/TestUiDataModel.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui.tests/src/org/eclipse/linuxtools/oprofile/ui/tests/TestUiDataModel.java
@@ -495,7 +495,7 @@ public class TestUiDataModel {
assertNotNull(e1_s1_i1_s1_samples[0].toString());
assertNotNull(e1_s1_i1_s1_samples[0].getLabelText());
assertEquals(42, ((UiModelSample)e1_s1_i1_s1_samples[0]).getLine());
- assertEquals(0.6341, ((UiModelSample)e1_s1_i1_s1_samples[0]).getCountPercentage(), 0.0001);
+ assertEquals(0.6190, ((UiModelSample)e1_s1_i1_s1_samples[0]).getCountPercentage(), 0.0001);
assertNull(e1_s1_i1_s1_samples[0].getChildren());
assertFalse(e1_s1_i1_s1_samples[0].hasChildren());
assertEquals(e1_s1_i1_symbols[0], e1_s1_i1_s1_samples[0].getParent());
@@ -504,7 +504,7 @@ public class TestUiDataModel {
assertNotNull(e1_s1_i1_s1_samples[1].toString());
assertNotNull(e1_s1_i1_s1_samples[1].getLabelText());
assertEquals(36, ((UiModelSample)e1_s1_i1_s1_samples[1]).getLine());
- assertEquals(0.1951, ((UiModelSample)e1_s1_i1_s1_samples[1]).getCountPercentage(), 0.0001);
+ assertEquals(0.1904, ((UiModelSample)e1_s1_i1_s1_samples[1]).getCountPercentage(), 0.0001);
assertNull(e1_s1_i1_s1_samples[1].getChildren());
assertFalse(e1_s1_i1_s1_samples[1].hasChildren());
assertEquals(e1_s1_i1_symbols[0], e1_s1_i1_s1_samples[1].getParent());
@@ -513,7 +513,7 @@ public class TestUiDataModel {
assertNotNull(e1_s1_i1_s1_samples[2].toString());
assertNotNull(e1_s1_i1_s1_samples[2].getLabelText());
assertEquals(31, ((UiModelSample)e1_s1_i1_s1_samples[2]).getLine());
- assertEquals(0.0488, ((UiModelSample)e1_s1_i1_s1_samples[2]).getCountPercentage(), 0.0001);
+ assertEquals(0.0476, ((UiModelSample)e1_s1_i1_s1_samples[2]).getCountPercentage(), 0.0001);
assertNull(e1_s1_i1_s1_samples[2].getChildren());
assertFalse(e1_s1_i1_s1_samples[2].hasChildren());
assertEquals(e1_s1_i1_symbols[0], e1_s1_i1_s1_samples[2].getParent());
@@ -531,7 +531,7 @@ public class TestUiDataModel {
assertNotNull(e1_s1_i1_s2_samples[0].toString());
assertNotNull(e1_s1_i1_s2_samples[0].getLabelText());
assertEquals(94, ((UiModelSample)e1_s1_i1_s2_samples[0]).getLine());
- assertEquals(0.0976, ((UiModelSample)e1_s1_i1_s2_samples[0]).getCountPercentage(), 0.0001);
+ assertEquals(0.0952, ((UiModelSample)e1_s1_i1_s2_samples[0]).getCountPercentage(), 0.0001);
assertNull(e1_s1_i1_s2_samples[0].getChildren());
assertFalse(e1_s1_i1_s2_samples[0].hasChildren());
assertEquals(e1_s1_i1_symbols[1], e1_s1_i1_s2_samples[0].getParent());
@@ -558,7 +558,7 @@ public class TestUiDataModel {
assertNotNull(e2_s1_i1_s1_samples[0].toString());
assertNotNull(e2_s1_i1_s1_samples[0].getLabelText());
assertEquals(42, ((UiModelSample)e2_s1_i1_s1_samples[0]).getLine());
- assertEquals(0.6341, ((UiModelSample)e2_s1_i1_s1_samples[0]).getCountPercentage(), 0.0001);
+ assertEquals(0.6190, ((UiModelSample)e2_s1_i1_s1_samples[0]).getCountPercentage(), 0.0001);
assertNull(e2_s1_i1_s1_samples[0].getChildren());
assertFalse(e2_s1_i1_s1_samples[0].hasChildren());
assertEquals(e2_s1_i1_symbols[0], e2_s1_i1_s1_samples[0].getParent());
@@ -567,7 +567,7 @@ public class TestUiDataModel {
assertNotNull(e2_s1_i1_s1_samples[1].toString());
assertNotNull(e2_s1_i1_s1_samples[1].getLabelText());
assertEquals(36, ((UiModelSample)e2_s1_i1_s1_samples[1]).getLine());
- assertEquals(0.1951, ((UiModelSample)e2_s1_i1_s1_samples[1]).getCountPercentage(), 0.0001);
+ assertEquals(0.1904, ((UiModelSample)e2_s1_i1_s1_samples[1]).getCountPercentage(), 0.0001);
assertNull(e2_s1_i1_s1_samples[1].getChildren());
assertFalse(e2_s1_i1_s1_samples[1].hasChildren());
assertEquals(e2_s1_i1_symbols[0], e2_s1_i1_s1_samples[1].getParent());
@@ -576,7 +576,7 @@ public class TestUiDataModel {
assertNotNull(e2_s1_i1_s1_samples[2].toString());
assertNotNull(e2_s1_i1_s1_samples[2].getLabelText());
assertEquals(31, ((UiModelSample)e2_s1_i1_s1_samples[2]).getLine());
- assertEquals(0.0488, ((UiModelSample)e2_s1_i1_s1_samples[2]).getCountPercentage(), 0.0001);
+ assertEquals(0.0476, ((UiModelSample)e2_s1_i1_s1_samples[2]).getCountPercentage(), 0.0001);
assertNull(e2_s1_i1_s1_samples[2].getChildren());
assertFalse(e2_s1_i1_s1_samples[2].hasChildren());
assertEquals(e2_s1_i1_symbols[0], e2_s1_i1_s1_samples[2].getParent());
@@ -594,7 +594,7 @@ public class TestUiDataModel {
assertNotNull(e2_s1_i1_s2_samples[0].toString());
assertNotNull(e2_s1_i1_s2_samples[0].getLabelText());
assertEquals(94, ((UiModelSample)e2_s1_i1_s2_samples[0]).getLine());
- assertEquals(0.0976, ((UiModelSample)e2_s1_i1_s2_samples[0]).getCountPercentage(), 0.0001);
+ assertEquals(0.0952, ((UiModelSample)e2_s1_i1_s2_samples[0]).getCountPercentage(), 0.0001);
assertNull(e2_s1_i1_s2_samples[0].getChildren());
assertFalse(e2_s1_i1_s2_samples[0].hasChildren());
assertEquals(e2_s1_i1_symbols[1], e2_s1_i1_s2_samples[0].getParent());
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelDependent.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelDependent.java
index 73e923b..cce816c 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelDependent.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelDependent.java
@@ -36,7 +36,7 @@ public class UiModelDependent implements IUiModelElement {
this.parent = parent;
this.dataModelDependents = dependents;
this.dependents = null;
- this.totalCount = totalCount;
+ this.totalCount = totalCount+depCount;
this.depCount = depCount;
refreshModel();
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java
index 901f9a1..ab2cb9d 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.ui/src/org/eclipse/linuxtools/oprofile/ui/model/UiModelImage.java
@@ -41,7 +41,7 @@ public class UiModelImage implements IUiModelElement {
this.parent = parent;
this.image = image;
this.symbols = null;
- this.totalCount = totalCount;
+ this.totalCount = totalCount+depCount;//totalCount;
this.depCount = depCount;
refreshModel();
}
@@ -66,7 +66,7 @@ public class UiModelImage implements IUiModelElement {
if (image.getCount() == OpModelImage.IMAGE_PARSE_ERROR) {
return OprofileUiMessages.getString("opxmlParse.error.multipleImages"); //$NON-NLS-1$
} else {
- double countPercentage = (double)(image.getCount() - depCount) / (double)totalCount;
+ double countPercentage = (double)(image.getCount() ) / (double)totalCount;
String percentage = OprofileUiPlugin.getPercentageString(countPercentage);
return percentage + " " + OprofileUiMessages.getString("uimodel.percentage.in") + image.getName(); //$NON-NLS-1$ //$NON-NLS-2$