Skip to content

Commit 0625ba4

Browse files
committed
Adds a simple callgraph browser without icons for the instrumentation status. Makes the selection of colors in the probe morphs more resilient
1 parent 4b270b7 commit 0625ba4

File tree

56 files changed

+96
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+96
-54
lines changed

packages/Babylonian-Core.package/BPByteCodeCallgraphTracer.class/instance/enter.invocation..st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ enter: aString invocation: aNumber
55
events nextPut: #enter.
66
events nextPut: aString.
77
events nextPut: aNumber.
8-
senderContext := thisContext sender sender sender.
8+
"senderContext := thisContext sender sender sender.
99
events nextPut: senderContext pc.
10-
events nextPut: senderContext method.
10+
events nextPut: senderContext method."

packages/Babylonian-Core.package/BPByteCodeCallgraphTracer.class/instance/eventsForTree.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ eventsForTree
4646
blockIdx := parts third asInteger.
4747
"invocation count of the surrounding method. In other words: 'Id' of the context of this block/method, unique per method"
4848
invocationCount := eventStream next.
49-
senderPC := eventStream next.
50-
senderMethod := eventStream next.
49+
"senderPC := eventStream next.
50+
senderMethod := eventStream next."
5151

5252
entry := BPCallgraphEntryEnter new.
5353
entry class: class selector: selector blockIdx: blockIdx invocationCount: invocationCount senderPC: senderPC senderMethod: senderMethod.

packages/Babylonian-Core.package/BPByteCodeCallgraphTracer.class/instance/eventsToString.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ eventsToString
2626
blockIdx := parts third asInteger.
2727
"invocation count of the surrounding method. In other words: 'Id' of the context of this block/method, unique per method"
2828
invocationCount := eventStream next.
29-
senderPC := eventStream next.
30-
senderMethod := eventStream next.
29+
"senderPC := eventStream next.
30+
senderMethod := eventStream next."
3131

3232
stringStream
3333
nextPutAll: class;

packages/Babylonian-Core.package/BPByteCodeCallgraphTracer.class/methodProperties.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
"instance" : {
1212
"blockIdxFromContext:" : "cmfcmf 1/4/2021 12:37",
1313
"customEvent:data:" : "cmfcmf 10/23/2020 14:56",
14-
"enter:invocation:" : "pre 1/21/2021 15:14",
14+
"enter:invocation:" : "pre 2/15/2021 10:52",
1515
"eventStream" : "cmfcmf 10/20/2020 13:49",
16-
"eventsForTree" : "pre 1/20/2021 17:46",
17-
"eventsToString" : "pre 1/20/2021 17:47",
16+
"eventsForTree" : "pre 2/15/2021 10:53",
17+
"eventsToString" : "pre 2/15/2021 10:53",
1818
"eventsToStringForTest" : "cmfcmf 10/7/2020 14:07",
1919
"exit:invocation:returns:" : "cmfcmf 10/20/2020 13:47",
2020
"initialize" : "cmfcmf 12/5/2020 14:15",

packages/Babylonian-Core.package/BPByteCodeRewriter.class/class/shouldNeverInstrument.selector..st

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ shouldNeverInstrument: aClass selector: aSymbol
44
"largely copied from MwMethodWrapper class >> #canWrap:inClass:"
55
| class method |
66
(aClass category beginsWith: 'Babylonian-') ifTrue: [
7-
aClass category ~= 'Babylonian-Tests-Callgraph-ByteCode-Fixtures' ifTrue: [^ true]].
7+
({'Babylonian-Tests-Callgraph-ByteCode-Fixtures' . 'Babylonian-Demo-TreeScene'} includes: aClass category)
8+
ifFalse: [^ true]].
89

910
{{CompiledMethod . {#valueWithReceiver:arguments:}}.
1011
{BlockClosure . {#value . #ensure}}.
11-
{WriteStream . {#nextPut:}}} anySatisfy: [:tuple |
12+
{WriteStream . {#nextPut:}}} do: [:tuple |
1213
((aClass includesBehavior: tuple first) and: [tuple second anySatisfy: [:excludedSelector |
1314
excludedSelector == aSymbol]]) ifTrue: [^ true]].
1415

@@ -18,7 +19,7 @@ shouldNeverInstrument: aClass selector: aSymbol
1819
{DynamicVariable . {"only check for the class ;)"}}.
1920
{BPByteCodeMethodState . {"only check for the class ;)"}}.
2021
{BPByteCodeAssociation . {"only check for the class ;)"}}
21-
} anySatisfy: [:tuple |
22+
} do: [:tuple |
2223
((aClass theNonMetaClass includesBehavior: tuple first) and: [tuple second isEmpty or:
2324
[tuple second anySatisfy: [:excludedSelector | excludedSelector == aSymbol]]])
2425
ifTrue: [^ true]].

packages/Babylonian-Core.package/BPByteCodeRewriter.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"rewriteClosureCreationByteCodeFor:withEncoder:numArgs:numTemps:" : "cmfcmf 10/11/2020 11:27",
4141
"rewriteHeaderOf:numTemps:" : "cmfcmf 10/12/2020 18:22",
4242
"setup" : "cmfcmf 10/7/2020 15:34",
43-
"shouldNeverInstrument:selector:" : "pre 1/22/2021 16:40",
43+
"shouldNeverInstrument:selector:" : "pre 2/15/2021 10:45",
4444
"teardown" : "cmfcmf 10/7/2020 15:31",
4545
"uninstallWrapper:" : "cmfcmf 10/29/2020 13:06",
4646
"uninstrumentAll" : "cmfcmf 12/10/2020 12:43",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
enumerating
22
detect: aBlock
33

4-
^ self detect: aBlock ifFound: [:entry | ^ entry] ifNone: [self errorNotFound: aBlock]
4+
^ self detect: aBlock ifFound: [:entry | ^ entry] ifNone: [self error: aBlock asString]

packages/Babylonian-Core.package/BPCallgraph.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"allInvocationsOf:" : "cmfcmf 11/3/2020 13:57",
77
"babylonianEntries" : "cmfcmf 10/28/2020 11:01",
88
"commonAncestorOf:ignoringInvocationCounts:" : "cmfcmf 1/4/2021 13:26",
9-
"detect:" : "cmfcmf 11/2/2020 14:20",
9+
"detect:" : "pre 2/15/2021 10:21",
1010
"detect:after:" : "cmfcmf 10/27/2020 16:26",
1111
"detect:after:ifFound:ifNone:" : "cmfcmf 10/27/2020 16:25",
1212
"detect:before:" : "cmfcmf 1/4/2021 19:22",

packages/Babylonian-Core.package/BPExampleTraceInformation.class/instance/callgraph.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ callgraph
44
callgraph ifNotNil: [^ callgraph].
55
^ callgraphTracer ifNotNil: [
66
callgraph := callgraphTracer eventsForTree.
7-
callgraphTracer := nil]
7+
"callgraphTracer := nil"]

packages/Babylonian-Core.package/BPExampleTraceInformation.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"class" : {
33
},
44
"instance" : {
5-
"callgraph" : "pre 2/15/2021 10:04",
5+
"callgraph" : "pre 2/15/2021 10:27",
66
"callgraphTracer" : "cmfcmf 11/9/2020 15:09",
77
"callgraphTracer:" : "cmfcmf 11/9/2020 15:32",
88
"terminateTracingProcess" : "cmfcmf 11/9/2020 17:00",
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
tracing
22
run
33

4-
^ self newReceiver
4+
| receiver arguments |
5+
BPByteCodeCallgraphTracer deactivateDuring: [#bpInstrumented withoutLayerDo: [
6+
receiver := self newReceiver.
7+
arguments := self newArguments]].
8+
9+
^ receiver
510
perform: self method selector
6-
withArguments: self newArguments
11+
withArguments: arguments

packages/Babylonian-Core.package/BPMethodExample.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
"receiverConstructor:" : "pre 5/17/2019 14:06",
2323
"receiverConstructorString" : "pre 9/28/2020 12:03",
2424
"resolveLiveSpecimen:" : "jb 12/1/2020 14:22",
25-
"run" : "pre 1/21/2021 17:18" } }
25+
"run" : "pre 2/15/2021 11:13" } }

packages/Babylonian-Core.package/BlockNode.extension/methodProperties.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"class" : {
33
},
44
"instance" : {
5-
"additionalSize:" : "2/15/2021 09:53:45",
6-
"additionalSizeBeforeBlock:" : "2/15/2021 09:53:45",
7-
"emitCodeForEvaluatedClosureValue:encoder:" : "2/15/2021 09:53:45",
8-
"emitCodeForEvaluatedFullClosureValue:encoder:" : "2/15/2021 09:53:45",
9-
"emitCodeForEvaluatedValue:encoder:" : "2/15/2021 09:53:45",
10-
"emitCodeForValue:encoder:" : "2/15/2021 09:53:45",
11-
"isRootBlock:" : "2/15/2021 09:53:45",
12-
"litIndexBlockIdentifier:" : "2/15/2021 09:53:45",
13-
"sizeCodeForEvaluatedClosureValue:" : "2/15/2021 09:53:45",
14-
"sizeCodeForEvaluatedFullClosureValue:" : "2/15/2021 09:53:45",
15-
"sizeCodeForEvaluatedValue:" : "2/15/2021 09:53:45",
16-
"sizeCodeForValue:" : "2/15/2021 09:53:45" } }
5+
"additionalSize: (bpCallgraph)" : "1/22/2021 16:40:39",
6+
"additionalSizeBeforeBlock: (bpCallgraph)" : "1/22/2021 16:40:39",
7+
"emitCodeForEvaluatedClosureValue:encoder: (bpCallgraph)" : "1/22/2021 16:40:39",
8+
"emitCodeForEvaluatedFullClosureValue:encoder: (bpCallgraph)" : "1/22/2021 16:40:39",
9+
"emitCodeForEvaluatedValue:encoder: (bpCallgraph)" : "1/22/2021 16:40:39",
10+
"emitCodeForValue:encoder: (bpCallgraph)" : "1/22/2021 16:40:39",
11+
"isRootBlock: (bpCallgraph)" : "1/22/2021 16:40:39",
12+
"litIndexBlockIdentifier: (bpCallgraph)" : "1/22/2021 16:40:39",
13+
"sizeCodeForEvaluatedClosureValue: (bpCallgraph)" : "1/22/2021 16:40:39",
14+
"sizeCodeForEvaluatedFullClosureValue: (bpCallgraph)" : "1/22/2021 16:40:39",
15+
"sizeCodeForEvaluatedValue: (bpCallgraph)" : "1/22/2021 16:40:39",
16+
"sizeCodeForValue: (bpCallgraph)" : "1/22/2021 16:40:39" } }

packages/Babylonian-Core.package/BytecodeEncoder.extension/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
},
44
"instance" : {
55
"genNops:" : "cmfcmf 11/27/2020 13:40",
6-
"generateMethodOfClass:trailer:from:" : "2/15/2021 09:53:45" } }
6+
"generateMethodOfClass:trailer:from: (bpCallgraph)" : "1/22/2021 16:40:39" } }

packages/Babylonian-Core.package/MethodNode.extension/methodProperties.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"class" : {
33
},
44
"instance" : {
5-
"generate:using:" : "2/15/2021 09:53:45",
6-
"rememberNOPs:range:blockId:" : "2/15/2021 09:53:45" } }
5+
"generate:using: (bpCallgraph)" : "1/22/2021 16:40:39",
6+
"rememberNOPs:range:blockId: (bpCallgraph)" : "1/22/2021 16:40:39" } }

packages/Babylonian-Core.package/ParseNode.extension/methodProperties.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
"class" : {
33
},
44
"instance" : {
5-
"additionalReturnSize:returns:" : "2/15/2021 09:53:45",
6-
"emitCodeForReturn:encoder:" : "2/15/2021 09:53:45",
7-
"emitNOPs:stack:n:type:" : "2/15/2021 09:53:45",
8-
"findEnclosingNonOptimizedBlock:" : "2/15/2021 09:53:45",
9-
"findEnclosingNonOptimizedBlockId:" : "2/15/2021 09:53:45",
10-
"invocationTempIndex:" : "2/15/2021 09:53:45",
11-
"litIndexBlockIdentifier:" : "2/15/2021 09:53:45",
12-
"litIndexEnterInvocation:" : "2/15/2021 09:53:45",
13-
"litIndexExitInvocation:" : "2/15/2021 09:53:45",
14-
"litIndexInvocationCount:" : "2/15/2021 09:53:45",
15-
"litIndexTracerClass:" : "2/15/2021 09:53:45",
16-
"sizeCodeForReturn:" : "2/15/2021 09:53:45" } }
5+
"additionalReturnSize:returns: (bpCallgraph)" : "1/22/2021 16:40:39",
6+
"emitCodeForReturn:encoder: (bpCallgraph)" : "1/22/2021 16:40:39",
7+
"emitNOPs:stack:n:type: (bpCallgraph)" : "1/22/2021 16:40:39",
8+
"findEnclosingNonOptimizedBlock: (bpCallgraph)" : "1/22/2021 16:40:39",
9+
"findEnclosingNonOptimizedBlockId: (bpCallgraph)" : "1/22/2021 16:40:39",
10+
"invocationTempIndex: (bpCallgraph)" : "1/22/2021 16:40:39",
11+
"litIndexBlockIdentifier: (bpCallgraph)" : "1/22/2021 16:40:39",
12+
"litIndexEnterInvocation: (bpCallgraph)" : "1/22/2021 16:40:39",
13+
"litIndexExitInvocation: (bpCallgraph)" : "1/22/2021 16:40:39",
14+
"litIndexInvocationCount: (bpCallgraph)" : "1/22/2021 16:40:39",
15+
"litIndexTracerClass: (bpCallgraph)" : "1/22/2021 16:40:39",
16+
"sizeCodeForReturn: (bpCallgraph)" : "1/22/2021 16:40:39" } }

packages/Babylonian-Core.package/VariableNode.extension/methodProperties.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"class" : {
33
},
44
"instance" : {
5-
"emitCodeForReturn:encoder:" : "2/15/2021 09:53:45",
6-
"sizeCodeForReturn:" : "2/15/2021 09:53:45" } }
5+
"emitCodeForReturn:encoder: (bpCallgraph)" : "1/22/2021 16:40:39",
6+
"sizeCodeForReturn: (bpCallgraph)" : "1/22/2021 16:40:39" } }

packages/Babylonian-UI.package/BPExamplesBrowser.class/instance/actualExampleList.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ actualExampleList
1010
writing browsers is boring --pre"
1111
(anExample isActive
1212
ifTrue: ['aaa']
13-
ifFalse: ['xxx']) , anExample exampleName]]
13+
ifFalse: ['xxx']) , anExample exampleName] ascending]

packages/Babylonian-UI.package/BPExamplesBrowser.class/instance/actualPackageList.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ accessing
22
actualPackageList
33

44
^ packageList ifNil: [packageList := (SystemNavigation default allExamples collect: [:anExample |
5-
anExample method methodClass package]) asSet sorted: [:aPackage | aPackage name]]
5+
anExample method methodClass package]) asSet sorted: [:aPackage | aPackage name] ascending]

packages/Babylonian-UI.package/BPExamplesBrowser.class/methodProperties.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"class" : {
33
"open" : "pre 10/13/2020 15:15" },
44
"instance" : {
5-
"actualExampleList" : "jb 12/3/2020 22:55",
6-
"actualPackageList" : "jb 12/3/2020 23:33",
5+
"actualExampleList" : "pre 2/15/2021 10:29",
6+
"actualPackageList" : "pre 2/15/2021 10:29",
77
"buildExamplesListWith:" : "pre 10/13/2020 14:49",
88
"buildPackagesListWith:" : "pre 10/13/2020 14:45",
99
"buildWith:" : "pre 10/13/2020 14:51",

packages/Babylonian-UI.package/BPSimpleCallgraphBrowser.class/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class initialization
2+
initialize
3+
4+
"self initialize"
5+
self environment at: #TheWorldMenu ifPresent: [:menu |
6+
(menu respondsTo: #registerOpenCommand:) ifTrue: [
7+
menu unregisterOpenCommand: 'Babylonian Call-Graph Browser'.
8+
menu registerOpenCommand: {'Babylonian Call-Graph Browser'. {self. #open}}]].
9+
10+
Smalltalk addToStartUpList: self.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
callgraph context menus
2+
messageIconFor: aSelector
3+
4+
^ ToolIcons iconNamed: (ToolIcons
5+
iconForClass: self selectedClassOrMetaClass
6+
selector: aSelector)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"class" : {
3+
"initialize" : "pre 2/15/2021 10:36" },
4+
"instance" : {
5+
"messageIconFor:" : "pre 2/15/2021 10:09" } }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"category" : "Babylonian-UI",
3+
"classinstvars" : [
4+
],
5+
"classvars" : [
6+
],
7+
"commentStamp" : "",
8+
"instvars" : [
9+
],
10+
"name" : "BPSimpleCallgraphBrowser",
11+
"pools" : [
12+
],
13+
"super" : "BPCallgraphBrowser",
14+
"type" : "normal" }

packages/Babylonian-UI.package/BPTraceBasedMorph.class/instance/colorForTraceValue.inTrace..st

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ colorForTraceValue: aBPTraceValue inTrace: aBPTrace
33

44
^ (colorCache at: aBPTrace ifAbsentPut: [| callgraph values path paths uniquePaths colors |
55
callgraph := aBPTrace example currentCallgraph.
6+
callgraph ifNil: ["No call graph yet" ^ Color transparent].
67
values := aBPTrace valuesForProbeId: self id.
78
paths := values collect: [:value | | entry |
89
entry := callgraph detect: [:each |

packages/Babylonian-UI.package/BPTraceBasedMorph.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isAbstract" : "pre 9/25/2020 10:15" },
44
"instance" : {
55
"callgraphMenu:forTrace:" : "pre 1/15/2021 13:47",
6-
"colorForTraceValue:inTrace:" : "pre 1/15/2021 13:46",
6+
"colorForTraceValue:inTrace:" : "pre 2/15/2021 10:21",
77
"filterValues:throughSliderForTrace:" : "pre 9/28/2020 11:21",
88
"initialize" : "pre 1/15/2021 13:49",
99
"listenToSlider:" : "jb 12/7/2020 18:59",

0 commit comments

Comments
 (0)