Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2012-06-07 18:55:12 +0000
committerRoland Grunberg2012-06-07 18:55:12 +0000
commit34f0668cfd694a717ef7f80be08d8ea2fedf6c22 (patch)
treee18340abf8cdd1e95e1d32454ef23665439fac0b /perf/org.eclipse.linuxtools.perf
parent5e55f17311147f6d9ffea1ef3ff37158a1afa83e (diff)
downloadorg.eclipse.linuxtools-34f0668cfd694a717ef7f80be08d8ea2fedf6c22.tar.gz
org.eclipse.linuxtools-34f0668cfd694a717ef7f80be08d8ea2fedf6c22.tar.xz
org.eclipse.linuxtools-34f0668cfd694a717ef7f80be08d8ea2fedf6c22.zip
Suppress output to stdout/stderr and set PMCommand percentage to 100.
Diffstat (limited to 'perf/org.eclipse.linuxtools.perf')
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java10
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMCommand.java7
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/TreeParent.java3
3 files changed, 13 insertions, 7 deletions
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
index 95b8aaa65f..fcb575a0c0 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java
@@ -50,8 +50,6 @@ public class PerfCore {
if (!str.trim().equals("")) {
if (print != null) {
print.println(blockTitle + ": \n" +str + "\n END OF " + blockTitle);
- } else {
- System.out.println(blockTitle + ": \n" +str + "\n END OF " + blockTitle);
}
}
return str;
@@ -339,7 +337,9 @@ public class PerfCore {
// contains profiled information
} else {
items = line.trim().split(""+(char)1); // using custom field separator. for default whitespace use " +"
- if (items.length != 5) { if (!line.trim().equals("")) { System.err.println("Err INVALID: " + line + "//length:" + items.length); }; continue; }
+ if (items.length != 5) {
+ continue;
+ }
percent = Float.parseFloat(items[0]); //percent column
samples = Double.parseDouble(items[1].trim()); //samples column
comm = items[2].trim(); //command column
@@ -456,7 +456,9 @@ public class PerfCore {
} else if (grabBlock && blockStarted) {
//process the line.
items = line.trim().split(" +");
- if (items.length != 2) { if (!line.trim().equals("")) { System.err.println("Err INVALID: " + line); }; continue; }
+ if (items.length != 2) {
+ continue;
+ }
percent = Float.parseFloat(items[0]);
lineRef = items[1];
items = lineRef.split(":");
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMCommand.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMCommand.java
index b0954159b6..3f3ee12482 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMCommand.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/PMCommand.java
@@ -13,7 +13,12 @@ package org.eclipse.linuxtools.internal.perf.model;
public class PMCommand extends TreeParent {
public PMCommand(String name) {
- super(name, 0);
+ super(name, 100);
+ /*
+ * The underlying report truncates percentages in some cases
+ * so taking a sum will not always give 100, but we know that
+ * the only command that could have run is the binary we specified.
+ */
}
public String toString() {
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/TreeParent.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/TreeParent.java
index bc60400b06..9aabcb9648 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/TreeParent.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/model/TreeParent.java
@@ -91,8 +91,7 @@ public class TreeParent {
}
public void recalculatePercentage() {
- if (getPercent() != -1 && (this instanceof PMDso || this instanceof PMFile
- || this instanceof PMCommand)){
+ if (getPercent() != -1 && (this instanceof PMDso || this instanceof PMFile)){
percent = 0;
// Re-sum its children percentages
for (TreeParent c : getChildren()) {

Back to the top