Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2012-03-26 20:09:33 +0000
committerRoland Grunberg2012-03-28 20:12:31 +0000
commit5b2032f696836687d9564ba3145711eafe56be97 (patch)
tree8c9c526786e7c912150218f794590d345c52a2fa /perf/org.eclipse.linuxtools.perf
parent83948aed4e8179d0ae8326fc8a9f3bb70f397e84 (diff)
downloadorg.eclipse.linuxtools-5b2032f696836687d9564ba3145711eafe56be97.tar.gz
org.eclipse.linuxtools-5b2032f696836687d9564ba3145711eafe56be97.tar.xz
org.eclipse.linuxtools-5b2032f696836687d9564ba3145711eafe56be97.zip
Fix BZ #375112
We now call perf with the "-i" flag and the perf.data file's location.
Diffstat (limited to 'perf/org.eclipse.linuxtools.perf')
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfCore.java12
-rw-r--r--perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java1
2 files changed, 8 insertions, 5 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 c817b2673c..317dbc07ac 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
@@ -288,11 +288,11 @@ public class PerfCore {
if (monitor != null && monitor.isCanceled()) { RefreshView(); return; }
try {
- // Alternatively can try with -i flag
if (workingDir == null) {
p = Runtime.getRuntime().exec(getReportString(config, perfDataLoc));
} else {
- p = Runtime.getRuntime().exec(getReportString(config, perfDataLoc), environ, workingDir); //runs with a specific working dir and environment.
+ String perfDefaultDataLoc = workingDir + "/" + PerfPlugin.PERF_DEFAULT_DATA;
+ p = Runtime.getRuntime().exec(getReportString(config, perfDefaultDataLoc));
}
//p.waitFor();
input = new BufferedReader(new InputStreamReader(p.getInputStream()));
@@ -422,12 +422,14 @@ public class PerfCore {
currentSym = (PMSymbol)s;
try {
- final String[] annotateCmd = getAnnotateString(config, currentDso.getName(), currentSym.getName().substring(4), perfDataLoc, OldPerfVersion);
+ String[] annotateCmd;
if (workingDir == null) {
- p = Runtime.getRuntime().exec(annotateCmd);
+ annotateCmd = getAnnotateString(config, currentDso.getName(), currentSym.getName().substring(4), perfDataLoc, OldPerfVersion);
} else {
- p = Runtime.getRuntime().exec(annotateCmd, environ, workingDir);
+ String perfDefaultDataLoc = workingDir + "/" + PerfPlugin.PERF_DEFAULT_DATA;
+ annotateCmd = getAnnotateString(config, currentDso.getName(), currentSym.getName().substring(4), perfDefaultDataLoc, OldPerfVersion);
}
+ p = Runtime.getRuntime().exec(annotateCmd);
//p.waitFor(); // actually, readLine() in the while later automatically 'waits' when theres nothing left to read but not terminated yet but if we wait in rare occurances perf never exits as the buffer fills up apparently
input = new BufferedReader(new InputStreamReader(p.getInputStream()));
error = new BufferedReader(new InputStreamReader(p.getErrorStream()));
diff --git a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java
index 828ce43691..2494278aae 100644
--- a/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java
+++ b/perf/org.eclipse.linuxtools.perf/src/org/eclipse/linuxtools/internal/perf/PerfPlugin.java
@@ -81,6 +81,7 @@ public class PerfPlugin extends AbstractUIPlugin {
public static final String STRINGS_MultipleFilesForSymbol = "Symbols conflicting in multiple files";
public static final String PERF_COMMAND = "perf";
+ public static final String PERF_DEFAULT_DATA = "perf.data";
public static final boolean DEBUG_ON = false; //Spew debug messages or not.

Back to the top