-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from hpi-swa-lab/feature/flameGraph
Changes layout of Printbugger to resemble a flame graph
- Loading branch information
Showing
27 changed files
with
116 additions
and
139 deletions.
There are no files selected for viewing
8 changes: 5 additions & 3 deletions
8
packages/Babylonian-Core.package/BPTraceValue.class/instance/filterableClassesInStack.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
private | ||
filterableClassesInStack | ||
^ {BlockClosure. | ||
|
||
^ { BlockClosure. | ||
Symbol. | ||
DynamicVariable class. | ||
CSProcessContextInformation. | ||
CSMethodObject. | ||
CSLayeredMethod. | ||
CSPartialMethod. | ||
TestCase. | ||
TestResult.} | ||
TestResult. | ||
BPPrintbuggerTest. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStack.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
private | ||
filteredStack | ||
^ self filteredStackFor: self stack | ||
|
||
^ self stack reject: [:aStackEntry | self shouldBeFiltered: aStackEntry ] | ||
|
||
|
6 changes: 0 additions & 6 deletions
6
packages/Babylonian-Core.package/BPTraceValue.class/instance/filteredStackFor..st
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
packages/Babylonian-Core.package/BPTraceValue.class/instance/oneSidedStackLevelTo..st
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
packages/Babylonian-Core.package/BPTraceValue.class/instance/relativeStackLevelTo..st
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/barWidthFor.relativeTo..st
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/colorFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
private | ||
colorFor: aMethodReference | ||
|
||
^ context colorFor: aMethodReference having: self class barColorScheme |
6 changes: 3 additions & 3 deletions
6
.../instance/lineSubmorphsFor.relativeTo..st → ...ss/instance/lineSubmorphsFor.calledBy..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
private | ||
lineSubmorphsFor: aTraceValue relativeTo: aStackRelation | ||
lineSubmorphsFor: aTraceValue calledBy: aStackOfMethodReferences | ||
|
||
| valueMorph | | ||
valueMorph := self newLabelValuePairMorphFor: aTraceValue. | ||
|
||
^ {self newHaltButtonFor: aTraceValue. | ||
self newBarMorphFor: aTraceValue | ||
relativeTo: aStackRelation | ||
calledBy: aStackOfMethodReferences | ||
withHeight: (valueMorph fullBounds height + 10). | ||
valueMorph.} | ||
|
16 changes: 16 additions & 0 deletions
16
...nian-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.calledBy.withHeight..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
private - ui | ||
newBarMorphFor: aTraceValue calledBy: aStackOfMethodReferences withHeight: aNumber | ||
|
||
|
||
^ Morph new | ||
name: #stackBar; | ||
color: Color transparent; | ||
changeTableLayout; | ||
listDirection: #rightToLeft; | ||
wrapCentering: #center; | ||
hResizing: #shrinkWrap; | ||
vResizing: #shrinkWrap; | ||
cellInset: 1@0; | ||
addAllMorphsBack: (aStackOfMethodReferences collect: [:aStackMethod | | ||
self newStackFrameMorphFor: aStackMethod withHeight: aNumber]); | ||
yourself |
9 changes: 0 additions & 9 deletions
9
...an-Printbugger.package/BPSwimlane.class/instance/newBarMorphFor.relativeTo.withHeight..st
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
...lonian-Printbugger.package/BPSwimlane.class/instance/newStackFrameMorphFor.withHeight..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
private - ui | ||
newStackFrameMorphFor: aMethodReference withHeight: aNumber | ||
|
||
| stackMorph | | ||
stackMorph := Morph new | ||
color: (self colorFor: aMethodReference); | ||
extent: (self stackDepth@aNumber); | ||
balloonText: aMethodReference asString; | ||
setProperty: #stackMethodReference | ||
toValue: aMethodReference; | ||
on: #click | ||
send: #value | ||
to: [ToolSet browse: aMethodReference actualClass | ||
selector: aMethodReference selector]; | ||
yourself. | ||
|
||
stackMorph | ||
on: #mouseEnter | ||
send: #value | ||
to: [stackMorph borderStyle: (BorderStyle width: 2 color: Color black)]; | ||
on: #mouseLeave | ||
send: #value | ||
to: [stackMorph borderStyle: nil]. | ||
|
||
^ stackMorph | ||
|
4 changes: 2 additions & 2 deletions
4
packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepth.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
constants | ||
stackDepth | ||
^ self fontHeight | ||
|
||
^ self fontHeight / 1.25 |
17 changes: 0 additions & 17 deletions
17
packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackDepthsFor..st
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/stackMethodsFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
private | ||
stackMethodsFor: aBPExample | ||
|
||
^ aBPExample traceValues collect: [:aTraceValue | | ||
aTraceValue filteredStack collect: [:aStackEntry | MethodReference class: aStackEntry fourth selector: aStackEntry third]] |
5 changes: 3 additions & 2 deletions
5
packages/Babylonian-Printbugger.package/BPSwimlane.class/instance/updateLayoutToContext.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
change notifications | ||
updateLayoutToContext | ||
|
||
self lineSubMorphs withIndexDo: [:aTraceValueLine :anIndex | | ||
(aTraceValueLine submorphNamed: #stackBar) color: (self colorFor: (example traceValues at: anIndex) in: context)]. | ||
(aTraceValueLine submorphNamed: #stackBar) submorphsDo: [:aStackEntry | | ||
aStackEntry color: (self colorFor: (aStackEntry valueOfProperty: #stackMethodReference))]]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...ts.package/BPPrintbuggerTest.class/instance/testSwimlaneDisplaysTraceValuesForOneProbe.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
tests | ||
testSwimlaneDisplaysTraceValuesForOneProbe | ||
|
||
| swimlane traceValues| | ||
self initExample1WithMethodWithMultipleProbes. | ||
swimlane := printbugger canvasMorph firstSubmorph. | ||
self assert: (swimlane isKindOf: BPSwimlane). | ||
self assert: 6 equals: (swimlane lineSubMorphs size). | ||
traceValues := swimlane allMorphs select: [:aSubmorph | aSubmorph isKindOf: StringMorph] thenCollect: [:aStringMorph | aStringMorph contents]. | ||
traceValues := swimlane allMorphs select: [:aSubmorph | | ||
aSubmorph isKindOf: StringMorph] thenCollect: [:aStringMorph | aStringMorph contents]. | ||
self assert: (traceValues includesAllOf: {'1'. '2'. '2'. '4'. '3'. '6'.}). | ||
|
5 changes: 3 additions & 2 deletions
5
...erTest.class/instance/testSwimlaneDisplaysTraceValuesForTwoProbesChronologicallySorted.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
...ass/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
tests | ||
testTwoTraceValuesInDifferentMethodsGetDifferentColorsInMultipleSwimlanes | ||
|
||
|swimlane1 swimlane2 colors1 colors2| | ||
self initExample1WithMethodWithMultipleProbes. | ||
self initExample2WithSingleProbe. | ||
|
||
swimlane1 := printbugger canvasMorph firstSubmorph. | ||
swimlane2 := printbugger canvasMorph submorphs second. | ||
colors1 := (swimlane1 allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph color]) asSet. | ||
colors2 := (swimlane2 allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph color]) asSet. | ||
colors1 := (swimlane1 allMorphs select: [:aSubmorph | | ||
aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph firstSubmorph color]) asSet. | ||
colors2 := (swimlane2 allMorphs select: [:aSubmorph | | ||
aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph firstSubmorph color]) asSet. | ||
|
||
self assert: colors1 size equals: colors2 size. | ||
self assert: colors1 ~= colors2. |
5 changes: 3 additions & 2 deletions
5
...st.class/instance/testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
tests | ||
testTwoTraceValuesInDifferentMethodsGetDifferentColorsInSameSwimlane | ||
|
||
|swimlane colors| | ||
self initExample1WithMethodWithExampleCallingOnlyProbedMethod. | ||
|
||
swimlane := printbugger canvasMorph firstSubmorph. | ||
colors := (swimlane allMorphs select: [:aSubmorph | aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph color]) asSet. | ||
colors := (swimlane allMorphs select: [:aSubmorph | | ||
aSubmorph knownName = 'stackBar'] thenCollect: [:aBarMorph | aBarMorph firstSubmorph color]) asSet. | ||
|
||
self assert: 2 equals: colors size. |
Oops, something went wrong.