Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeneviève Bastien2018-04-04 16:46:06 -0400
committerGenevieve Bastien2018-04-05 10:16:18 -0400
commit34f2442794563003eb969cee1022a51c7f6593af (patch)
tree55cff5d9a8260de47f65ba54755f90ba99d6f640
parent353422029712a019f6e706beb4fdad68a562abdd (diff)
downloadorg.eclipse.tracecompass.incubator-34f2442794563003eb969cee1022a51c7f6593af.tar.gz
org.eclipse.tracecompass.incubator-34f2442794563003eb969cee1022a51c7f6593af.tar.xz
org.eclipse.tracecompass.incubator-34f2442794563003eb969cee1022a51c7f6593af.zip
callstack: Remove the depth from the function classes
The depth value is not used, the caller usually already have this information, so no need for the function to pass it around. Change-Id: Id40792c0cb9c48c630fe047c010bcf619160d762 Signed-off-by: Geneviève Bastien <gbastien+lttng@versatic.net> Reviewed-on: https://git.eclipse.org/r/120743 Tested-by: CI Bot Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/callgraph/CalledFunctionTest.java46
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/flamechart/CallStackTest.java42
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java6
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/ICalledFunction.java7
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java2
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java35
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunction.java6
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunctionFactory.java22
-rw-r--r--callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledStringFunction.java6
9 files changed, 62 insertions, 110 deletions
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/callgraph/CalledFunctionTest.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/callgraph/CalledFunctionTest.java
index b06f1c93..19e6cc53 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/callgraph/CalledFunctionTest.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/callgraph/CalledFunctionTest.java
@@ -48,12 +48,12 @@ public class CalledFunctionTest {
*/
@Before
public void setup() {
- ICalledFunction fixture = CalledFunctionFactory.create(10, 1010, 0, TmfStateValue.newValueString("Hello"), 0, 0, null, fModel);
+ ICalledFunction fixture = CalledFunctionFactory.create(10, 1010, TmfStateValue.newValueString("Hello"), 0, 0, null, fModel);
assertTrue(fixture instanceof CalledStringFunction);
fFixture = (CalledStringFunction) fixture;
- ICalledFunction fixture42 = CalledFunctionFactory.create(400, 500, 1, TmfStateValue.newValueLong(0x42), 0, 0, fFixture, fModel);
+ ICalledFunction fixture42 = CalledFunctionFactory.create(400, 500, TmfStateValue.newValueLong(0x42), 0, 0, fFixture, fModel);
f42Fixture = fixture42;
- ICalledFunction hiFixture = CalledFunctionFactory.create(20, 50, 1, "Hi", 0, 0, fFixture, fModel);
+ ICalledFunction hiFixture = CalledFunctionFactory.create(20, 50, "Hi", 0, 0, fFixture, fModel);
fHiFixture = hiFixture;
}
@@ -62,9 +62,9 @@ public class CalledFunctionTest {
* value
*/
public void createValid() {
- assertNotNull(CalledFunctionFactory.create(0, 0, 0, TmfStateValue.newValueLong(0), 0, 0, null, fModel));
- assertNotNull(CalledFunctionFactory.create(0, 0, 0, TmfStateValue.newValueInt(0), 0, 0, null, fModel));
- assertNotNull(CalledFunctionFactory.create(0, 0, 0, TmfStateValue.newValueString(""), 0, 0, null, fModel));
+ assertNotNull(CalledFunctionFactory.create(0, 0, TmfStateValue.newValueLong(0), 0, 0, null, fModel));
+ assertNotNull(CalledFunctionFactory.create(0, 0, TmfStateValue.newValueInt(0), 0, 0, null, fModel));
+ assertNotNull(CalledFunctionFactory.create(0, 0, TmfStateValue.newValueString(""), 0, 0, null, fModel));
}
/**
@@ -72,7 +72,7 @@ public class CalledFunctionTest {
*/
@Test(expected = IllegalArgumentException.class)
public void createInvalidDouble() {
- CalledFunctionFactory.create(0, 0, 0, TmfStateValue.newValueDouble(3.14), 0, 0, null, fModel);
+ CalledFunctionFactory.create(0, 0, TmfStateValue.newValueDouble(3.14), 0, 0, null, fModel);
}
/**
@@ -80,7 +80,7 @@ public class CalledFunctionTest {
*/
@Test(expected = IllegalArgumentException.class)
public void createInvalidNull() {
- CalledFunctionFactory.create(0, 0, 0, TmfStateValue.nullValue(), 0, 0, null, fModel);
+ CalledFunctionFactory.create(0, 0, TmfStateValue.nullValue(), 0, 0, null, fModel);
}
/**
@@ -88,7 +88,7 @@ public class CalledFunctionTest {
*/
@Test(expected = IllegalArgumentException.class)
public void createInvalidTimeRange() {
- CalledFunctionFactory.create(10, -10, 0, "", 0, 0, null, fModel);
+ CalledFunctionFactory.create(10, -10, "", 0, 0, null, fModel);
}
/**
@@ -96,7 +96,7 @@ public class CalledFunctionTest {
*/
@Test(expected = IllegalArgumentException.class)
public void createInvalidTimeRangeStateLong() {
- CalledFunctionFactory.create(10, -10, 0, TmfStateValue.newValueLong(42), 0, 0, null, fModel);
+ CalledFunctionFactory.create(10, -10, TmfStateValue.newValueLong(42), 0, 0, null, fModel);
}
/**
@@ -104,7 +104,7 @@ public class CalledFunctionTest {
*/
@Test(expected = IllegalArgumentException.class)
public void createInvalidTimeRangeStateInteger() {
- CalledFunctionFactory.create(10, -10, 0, TmfStateValue.newValueInt(42), 0, 0, null, fModel);
+ CalledFunctionFactory.create(10, -10, TmfStateValue.newValueInt(42), 0, 0, null, fModel);
}
/**
@@ -112,7 +112,7 @@ public class CalledFunctionTest {
*/
@Test(expected = IllegalArgumentException.class)
public void createInvalidTimeRangeStateString() {
- CalledFunctionFactory.create(10, -10, 0, TmfStateValue.newValueString("42"), 0, 0, null, fModel);
+ CalledFunctionFactory.create(10, -10, TmfStateValue.newValueString("42"), 0, 0, null, fModel);
}
/**
@@ -121,7 +121,7 @@ public class CalledFunctionTest {
@Test
public void testAddChildOk1() {
assertNotNull(fFixture);
- CalledFunction newchild = (CalledFunction) CalledFunctionFactory.create(100, 200, 1, TmfStateValue.newValueInt(0x64), 0, 0, fFixture, fModel);
+ CalledFunction newchild = (CalledFunction) CalledFunctionFactory.create(100, 200, TmfStateValue.newValueInt(0x64), 0, 0, fFixture, fModel);
ICalledFunction hiFixture = fHiFixture;
ICalledFunction fixture42 = f42Fixture;
assertNotNull(hiFixture);
@@ -137,7 +137,7 @@ public class CalledFunctionTest {
@Test
public void testAddChildOk2() {
assertNotNull(fFixture);
- CalledStringFunction newchild = CalledFunctionFactory.create(450, 490, 1, "OK", 0, 0, f42Fixture, fModel);
+ CalledStringFunction newchild = CalledFunctionFactory.create(450, 490, "OK", 0, 0, f42Fixture, fModel);
ICalledFunction hiFixture = fHiFixture;
ICalledFunction fixture42 = f42Fixture;
assertNotNull(hiFixture);
@@ -153,7 +153,7 @@ public class CalledFunctionTest {
@Test
public void testAddChildOk3() {
assertNotNull(fFixture);
- CalledStringFunction newchild = CalledFunctionFactory.create(450, 490, 1, "OK", 0, 0, fHiFixture, fModel);
+ CalledStringFunction newchild = CalledFunctionFactory.create(450, 490, "OK", 0, 0, fHiFixture, fModel);
ICalledFunction hiFixture = fHiFixture;
ICalledFunction fixture42 = f42Fixture;
assertNotNull(hiFixture);
@@ -189,7 +189,7 @@ public class CalledFunctionTest {
@Test
public void testEquals() {
assertEquals(fFixture, fFixture);
- assertEquals(fHiFixture, CalledFunctionFactory.create(20, 50, 1, "Hi", 0, 0, fFixture, fModel));
+ assertEquals(fHiFixture, CalledFunctionFactory.create(20, 50, "Hi", 0, 0, fFixture, fModel));
assertNotEquals(fFixture, f42Fixture);
assertNotEquals(fFixture, fHiFixture);
assertNotEquals(fFixture, null);
@@ -211,16 +211,6 @@ public class CalledFunctionTest {
}
/**
- * Test get depth
- */
- @Test
- public void testGetDepth() {
- assertEquals(0, fFixture.getDepth());
- assertEquals(1, fHiFixture.getDepth());
- assertEquals(1, f42Fixture.getDepth());
- }
-
- /**
* Test get end. Simple getter test
*/
@Test
@@ -278,10 +268,10 @@ public class CalledFunctionTest {
@Test
public void testHashCode() {
assertEquals(f42Fixture.hashCode(), f42Fixture.hashCode());
- ICalledFunction calledFunction = CalledFunctionFactory.create(400, 500, 1, TmfStateValue.newValueLong(0x42), 0, 0, fFixture, fModel);
+ ICalledFunction calledFunction = CalledFunctionFactory.create(400, 500, TmfStateValue.newValueLong(0x42), 0, 0, fFixture, fModel);
assertEquals(f42Fixture, calledFunction);
assertEquals(f42Fixture.hashCode(), calledFunction.hashCode());
- calledFunction = CalledFunctionFactory.create(20, 50, 1, "Hi", 0, 0, fFixture, fModel);
+ calledFunction = CalledFunctionFactory.create(20, 50, "Hi", 0, 0, fFixture, fModel);
assertEquals(fHiFixture, calledFunction);
assertEquals(fHiFixture.hashCode(), calledFunction.hashCode());
}
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/flamechart/CallStackTest.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/flamechart/CallStackTest.java
index 0b9439cf..c258ce36 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/flamechart/CallStackTest.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core.tests/src/org/eclipse/tracecompass/incubator/callstack/core/tests/flamechart/CallStackTest.java
@@ -108,18 +108,18 @@ public class CallStackTest extends CallStackTestBase {
/* Check the first level */
List<ICalledFunction> callList = callStack.getCallListAtDepth(1, START_TIME, END_TIME, 1, MONITOR);
assertEquals(2, callList.size());
- assertEquals(CalledFunctionFactory.create(1L, 10L, 1, "op1", 1, 2, null, model), callList.get(0));
- assertEquals(CalledFunctionFactory.create(12L, 20L, 1, "op4", 1, 2, null, model), callList.get(1));
+ assertEquals(CalledFunctionFactory.create(1L, 10L, "op1", 1, 2, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(12L, 20L, "op4", 1, 2, null, model), callList.get(1));
/* Check the second level */
callList = callStack.getCallListAtDepth(2, START_TIME, END_TIME, 1, MONITOR);
assertEquals(1, callList.size());
- assertEquals(CalledFunctionFactory.create(3L, 7L, 2, "op2", 1, 2, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(3L, 7L, "op2", 1, 2, null, model), callList.get(0));
/* Check the third level */
callList = callStack.getCallListAtDepth(3, START_TIME, END_TIME, 1, MONITOR);
assertEquals(1, callList.size());
- assertEquals(CalledFunctionFactory.create(4L, 5L, 3, "op3", 1, 2, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(4L, 5L, "op3", 1, 2, null, model), callList.get(0));
/* Check the host thread */
assertEquals(new HostThread(trace.getHostId(), 2), callStack.getHostThread(1L));
@@ -137,13 +137,13 @@ public class CallStackTest extends CallStackTestBase {
/* Check the first level */
List<ICalledFunction> callList = callStack.getCallListAtDepth(1, START_TIME, END_TIME, 1, MONITOR);
assertEquals(1, callList.size());
- assertEquals(CalledFunctionFactory.create(3L, 20L, 1, "op2", 1, 3, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(3L, 20L, "op2", 1, 3, null, model), callList.get(0));
/* Check the second level */
callList = callStack.getCallListAtDepth(2, START_TIME, END_TIME, 1, MONITOR);
assertEquals(2, callList.size());
- assertEquals(CalledFunctionFactory.create(5L, 6L, 2, "op3", 1, 3, null, model), callList.get(0));
- assertEquals(CalledFunctionFactory.create(7L, 13L, 2, "op2", 1, 3, null, model), callList.get(1));
+ assertEquals(CalledFunctionFactory.create(5L, 6L, "op3", 1, 3, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(7L, 13L, "op2", 1, 3, null, model), callList.get(1));
/* Check the host thread */
assertEquals(new HostThread(trace.getHostId(), 3), callStack.getHostThread(1L));
@@ -179,20 +179,20 @@ public class CallStackTest extends CallStackTestBase {
/* Check the first level */
List<ICalledFunction> callList = callStack.getCallListAtDepth(1, START_TIME, END_TIME, 1, MONITOR);
assertEquals(1, callList.size());
- assertEquals(CalledFunctionFactory.create(1L, 20L, 1, "op1", 1, 6, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(1L, 20L, "op1", 1, 6, null, model), callList.get(0));
/* Check the second level */
callList = callStack.getCallListAtDepth(2, START_TIME, END_TIME, 1, MONITOR);
assertEquals(3, callList.size());
- assertEquals(CalledFunctionFactory.create(2L, 7L, 2, "op3", 1, 6, null, model), callList.get(0));
- assertEquals(CalledFunctionFactory.create(8L, 11L, 2, "op2", 1, 6, null, model), callList.get(1));
- assertEquals(CalledFunctionFactory.create(12L, 20L, 2, "op4", 1, 6, null, model), callList.get(2));
+ assertEquals(CalledFunctionFactory.create(2L, 7L, "op3", 1, 6, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(8L, 11L, "op2", 1, 6, null, model), callList.get(1));
+ assertEquals(CalledFunctionFactory.create(12L, 20L, "op4", 1, 6, null, model), callList.get(2));
/* Check the third level */
callList = callStack.getCallListAtDepth(3, START_TIME, END_TIME, 1, MONITOR);
assertEquals(2, callList.size());
- assertEquals(CalledFunctionFactory.create(4L, 6L, 3, "op1", 1, 6, null, model), callList.get(0));
- assertEquals(CalledFunctionFactory.create(9L, 10L, 3, "op3", 1, 6, null, model), callList.get(1));
+ assertEquals(CalledFunctionFactory.create(4L, 6L, "op1", 1, 6, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(9L, 10L, "op3", 1, 6, null, model), callList.get(1));
/* Check the host thread */
assertEquals(new HostThread(trace.getHostId(), 6), callStack.getHostThread(1L));
@@ -210,19 +210,19 @@ public class CallStackTest extends CallStackTestBase {
/* Check the first level */
List<ICalledFunction> callList = callStack.getCallListAtDepth(1, START_TIME, END_TIME, 1, MONITOR);
assertEquals(1, callList.size());
- assertEquals(CalledFunctionFactory.create(1L, 20L, 1, "op5", 1, 6, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(1L, 20L, "op5", 1, 6, null, model), callList.get(0));
/* Check the second level */
callList = callStack.getCallListAtDepth(2, START_TIME, END_TIME, 1, MONITOR);
assertEquals(3, callList.size());
- assertEquals(CalledFunctionFactory.create(2L, 6L, 2, "op2", 1, 6, null, model), callList.get(0));
- assertEquals(CalledFunctionFactory.create(9L, 13L, 2, "op2", 1, 6, null, model), callList.get(1));
- assertEquals(CalledFunctionFactory.create(15L, 19L, 2, "op2", 1, 6, null, model), callList.get(2));
+ assertEquals(CalledFunctionFactory.create(2L, 6L, "op2", 1, 6, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(9L, 13L, "op2", 1, 6, null, model), callList.get(1));
+ assertEquals(CalledFunctionFactory.create(15L, 19L, "op2", 1, 6, null, model), callList.get(2));
/* Check the third level */
callList = callStack.getCallListAtDepth(3, START_TIME, END_TIME, 1, MONITOR);
assertEquals(1, callList.size());
- assertEquals(CalledFunctionFactory.create(10L, 11L, 3, "op3", 1, 6, null, model), callList.get(0));
+ assertEquals(CalledFunctionFactory.create(10L, 11L, "op3", 1, 6, null, model), callList.get(0));
/* Check the host thread */
assertEquals(new HostThread(trace.getHostId(), 7), callStack.getHostThread(1L));
@@ -323,15 +323,15 @@ public class CallStackTest extends CallStackTestBase {
ICalledFunction function = element.getNextFunction(START_TIME, 2);
assertNotNull(function);
- assertEquals(CalledFunctionFactory.create(2L, 6L, 2, "op2", 1, 6, null, model), function);
+ assertEquals(CalledFunctionFactory.create(2L, 6L, "op2", 1, 6, null, model), function);
function = element.getNextFunction(function.getEnd(), 2);
assertNotNull(function);
- assertEquals(CalledFunctionFactory.create(9L, 13L, 2, "op2", 1, 6, null, model), function);
+ assertEquals(CalledFunctionFactory.create(9L, 13L, "op2", 1, 6, null, model), function);
function = element.getNextFunction(function.getEnd(), 2);
assertNotNull(function);
- assertEquals(CalledFunctionFactory.create(15L, 19L, 2, "op2", 1, 6, null, model), function);
+ assertEquals(CalledFunctionFactory.create(15L, 19L, "op2", 1, 6, null, model), function);
function = element.getNextFunction(function.getEnd(), 2);
assertNull(function);
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java
index 77783421..6564c87b 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/flamechart/CallStack.java
@@ -120,7 +120,7 @@ public class CallStack {
}
if (!callInterval.getStateValue().isNull()) {
int threadId = getThreadId(callInterval.getStartTime());
- callList.add(CalledFunctionFactory.create(callInterval.getStartTime(), callInterval.getEndTime() + 1, depth, callInterval.getStateValue(), getSymbolKeyAt(callInterval.getStartTime()), threadId,
+ callList.add(CalledFunctionFactory.create(callInterval.getStartTime(), callInterval.getEndTime() + 1, callInterval.getStateValue(), getSymbolKeyAt(callInterval.getStartTime()), threadId,
null, ModelManager.getModelFor(getHostId(callInterval.getStartTime()))));
}
}
@@ -187,7 +187,7 @@ public class CallStack {
interval = fStateSystem.querySingleState(interval.getEndTime() + 1, fQuarks.get(depth - 1));
}
if (!interval.getStateValue().isNull() && interval.getStartTime() >= time) {
- return CalledFunctionFactory.create(interval.getStartTime(), interval.getEndTime() + 1, depth, interval.getStateValue(), getSymbolKeyAt(interval.getStartTime()), getThreadId(interval.getStartTime()), null,
+ return CalledFunctionFactory.create(interval.getStartTime(), interval.getEndTime() + 1, interval.getStateValue(), getSymbolKeyAt(interval.getStartTime()), getThreadId(interval.getStartTime()), null,
ModelManager.getModelFor(getHostId(time)));
}
} catch (StateSystemDisposedException e) {
@@ -233,7 +233,7 @@ public class CallStack {
interval = fStateSystem.querySingleState(interval.getEndTime() + 1, fQuarks.get(depth - 1));
}
if (!interval.getStateValue().isNull() && interval.getStartTime() < end) {
- return CalledFunctionFactory.create(Math.max(start, interval.getStartTime()), Math.min(end, interval.getEndTime() + 1), depth, interval.getStateValue(), getSymbolKeyAt(interval.getStartTime()), getThreadId(interval.getStartTime()), parent, model);
+ return CalledFunctionFactory.create(Math.max(start, interval.getStartTime()), Math.min(end, interval.getEndTime() + 1), interval.getStateValue(), getSymbolKeyAt(interval.getStartTime()), getThreadId(interval.getStartTime()), parent, model);
}
} catch (StateSystemDisposedException e) {
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/ICalledFunction.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/ICalledFunction.java
index e1f8fa0f..74cc57cb 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/ICalledFunction.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/ICalledFunction.java
@@ -67,13 +67,6 @@ public interface ICalledFunction extends INamedSegment {
long getCpuTime();
/**
- * The depth in the call stack of a function
- *
- * @return The depth of a function
- */
- int getDepth();
-
- /**
* The process ID of the traced application
*
* @return The process ID
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java
index 7eee6d9c..a9224cf6 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/callstack/core/instrumented/statesystem/CallStackSeries.java
@@ -574,7 +574,7 @@ public class CallStackSeries implements ISegmentStore<ISegment> {
if (hostThread == null) {
hostThread = new HostThread(StringUtils.EMPTY, IHostModel.UNKNOWN_TID);
}
- return CalledFunctionFactory.create(interval.getStartTime(), interval.getEndTime() + 1, 0, interval.getStateValue(), -1, hostThread.getTid(),
+ return CalledFunctionFactory.create(interval.getStartTime(), interval.getEndTime() + 1, interval.getStateValue(), -1, hostThread.getTid(),
null, ModelManager.getModelFor(hostThread.getHost()));
};
return Iterables.transform(query2d, fct);
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java
index 5977b1d2..cc6ef2ec 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/AbstractCalledFunction.java
@@ -51,7 +51,6 @@ abstract class AbstractCalledFunction implements ICalledFunction {
protected final long fStart;
protected final long fEnd;
- protected final int fDepth;
private final List<ICalledFunction> fChildren = new ArrayList<>();
private final @Nullable ICalledFunction fParent;
protected long fSelfTime = 0;
@@ -61,13 +60,12 @@ abstract class AbstractCalledFunction implements ICalledFunction {
private final transient IHostModel fModel;
private transient long fCpuTime = Long.MIN_VALUE;
- public AbstractCalledFunction(long start, long end, int depth, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
+ public AbstractCalledFunction(long start, long end, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
if (start > end) {
throw new IllegalArgumentException(Messages.TimeError + "[" + start + "," + end + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
fStart = start;
fEnd = end;
- fDepth = depth;
fParent = parent;
// It'll be modified once we add a child to it
fSelfTime = fEnd - fStart;
@@ -146,11 +144,6 @@ abstract class AbstractCalledFunction implements ICalledFunction {
}
@Override
- public int getDepth() {
- return fDepth;
- }
-
- @Override
public int getProcessId() {
return fProcessId;
}
@@ -175,7 +168,7 @@ abstract class AbstractCalledFunction implements ICalledFunction {
@Override
public int hashCode() {
- return Objects.hash(fDepth, fEnd, fParent, fSelfTime, fStart, getSymbol());
+ return Objects.hash(fEnd, fParent, fSelfTime, fStart, getSymbol());
}
@Override
@@ -190,25 +183,11 @@ abstract class AbstractCalledFunction implements ICalledFunction {
return false;
}
AbstractCalledFunction other = (AbstractCalledFunction) obj;
- if (fDepth != other.fDepth) {
- return false;
- }
- if (fEnd != other.fEnd) {
- return false;
- }
- if (fSelfTime != other.fSelfTime) {
- return false;
- }
- if (fStart != other.fStart) {
- return false;
- }
- if (!Objects.equals(fParent, other.getParent())) {
- return false;
- }
- if (!Objects.equals(getSymbol(), other.getSymbol())) {
- return false;
- }
- return true;
+ return (fEnd == other.fEnd &&
+ fSelfTime == other.fSelfTime &&
+ fStart == other.fStart &&
+ Objects.equals(fParent, other.getParent()) &&
+ Objects.equals(getSymbol(), other.getSymbol()));
}
} \ No newline at end of file
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunction.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunction.java
index 6ca46196..7785a5cf 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunction.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunction.java
@@ -39,8 +39,6 @@ public class CalledFunction extends AbstractCalledFunction {
* End position of the segment
* @param symbol
* The symbol of the call stack function
- * @param depth
- * The depth in the call stack of a function
* @param processId
* The process ID of the traced application
* @param threadId
@@ -50,8 +48,8 @@ public class CalledFunction extends AbstractCalledFunction {
* @param model
* The operating system model to provide CPU times
*/
- protected CalledFunction(long start, long end, long symbol, int depth, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
- super(start, end, depth, processId, threadId, parent, model);
+ protected CalledFunction(long start, long end, long symbol, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
+ super(start, end, processId, threadId, parent, model);
fSymbol = symbol;
}
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunctionFactory.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunctionFactory.java
index b09ce26c..e7205f17 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunctionFactory.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledFunctionFactory.java
@@ -35,8 +35,6 @@ public final class CalledFunctionFactory {
* the start time
* @param end
* the end time
- * @param depth
- * the depth
* @param stateValue
* the symbol
* @param processId
@@ -50,14 +48,14 @@ public final class CalledFunctionFactory {
* The operating system model this function is a part of
* @return an ICalledFunction with the specified properties
*/
- public static AbstractCalledFunction create(long start, long end, int depth, ITmfStateValue stateValue, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
+ public static AbstractCalledFunction create(long start, long end, ITmfStateValue stateValue, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
switch (stateValue.getType()) {
case INTEGER:
- return create(start, end, depth, stateValue.unboxInt(), processId, threadId, parent, model);
+ return create(start, end, stateValue.unboxInt(), processId, threadId, parent, model);
case LONG:
- return create(start, end, depth, stateValue.unboxLong(), processId, threadId, parent, model);
+ return create(start, end, stateValue.unboxLong(), processId, threadId, parent, model);
case STRING:
- return create(start, end, depth, stateValue.unboxStr(), processId, threadId, parent, model);
+ return create(start, end, stateValue.unboxStr(), processId, threadId, parent, model);
case CUSTOM:
// Fall through
case DOUBLE:
@@ -77,8 +75,6 @@ public final class CalledFunctionFactory {
* the start time
* @param end
* the end time
- * @param depth
- * the depth
* @param value
* the symbol
* @param processId
@@ -87,11 +83,11 @@ public final class CalledFunctionFactory {
* the parent node
* @return an ICalledFunction with the specified propertiess
*/
- private static CalledFunction create(long start, long end, int depth, long value, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
+ private static CalledFunction create(long start, long end, long value, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
if (start > end) {
throw new IllegalArgumentException(Messages.TimeError + '[' + start + ',' + end + ']');
}
- return new CalledFunction(start, end, value, depth, processId, threadId, parent, model);
+ return new CalledFunction(start, end, value, processId, threadId, parent, model);
}
/**
@@ -102,8 +98,6 @@ public final class CalledFunctionFactory {
* the start time
* @param end
* the end time
- * @param depth
- * the depth
* @param value
* the symbol
* @param processId
@@ -117,11 +111,11 @@ public final class CalledFunctionFactory {
* The operating system model this function is a part of
* @return an ICalledFunction with the specified properties
*/
- public static CalledStringFunction create(long start, long end, int depth, String value, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
+ public static CalledStringFunction create(long start, long end, String value, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
if (start > end) {
throw new IllegalArgumentException(Messages.TimeError + '[' + start + ',' + end + ']');
}
- return new CalledStringFunction(start, end, value, depth, processId, threadId, parent, model);
+ return new CalledStringFunction(start, end, value, processId, threadId, parent, model);
}
}
diff --git a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledStringFunction.java b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledStringFunction.java
index dbf6936d..aa31688d 100644
--- a/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledStringFunction.java
+++ b/callstack/org.eclipse.tracecompass.incubator.callstack.core/src/org/eclipse/tracecompass/incubator/internal/callstack/core/instrumented/callgraph/CalledStringFunction.java
@@ -41,8 +41,6 @@ public class CalledStringFunction extends AbstractCalledFunction {
* End position of the segment
* @param symbol
* The symbol of the call stack function
- * @param depth
- * The depth in the call stack of a function
* @param processId
* The process ID of the traced application
* @param threadId
@@ -52,8 +50,8 @@ public class CalledStringFunction extends AbstractCalledFunction {
* @param model
* The model for the host the traced application is running on
*/
- protected CalledStringFunction(long start, long end, String symbol, int depth, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
- super(start, end, depth, processId, threadId, parent, model);
+ protected CalledStringFunction(long start, long end, String symbol, int processId, int threadId, @Nullable ICalledFunction parent, IHostModel model) {
+ super(start, end, processId, threadId, parent, model);
fSymbol = symbol;
}

Back to the top