Skip to content

Commit 8d7a445

Browse files
committed
CogVM source as per VMMaker.oscog-eem.3683
CoInterpreterMT: Provide functions to dump the owner log. Filter-out heartbeats from the simulator's owner logging. Use CTMUnknownOwner instead of -1 in one place. Change the size of the owner log on 64-bits from 24 to 16 bytes an entry. Change the owner log size from 1Mb to 64k Dump 128 entires from the owner log in the COGMT VMs on USR1 and SEGV et al. Fix the startup thread identity asserts of the threaded VM with the separate GUI thread on Mac. Fix the threadAffinity inst var name in the LoadReader.st script and make all the scripts LF lineends. Nuke an accidentally added file (CompiledMethod-usesAlternateBytecodeSet.st)
1 parent 5d66b05 commit 8d7a445

File tree

12 files changed

+594
-136
lines changed

12 files changed

+594
-136
lines changed
Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,103 @@
1-
| manifest load |"Update Trunk image"[MCMcmUpdater default doUpdate: false] on: Warning do: [:ex | ex resume: true]."Disable underscore as assignment, allowing underscores in method names."Scanner allowUnderscoreAsAssignment: false.TranscriptStream characterLimit: 1000000.manifest := #( squeak 'FFI' 0 ('FFI-Pools' 'FFI-Kernel') squeak 'FFI' "Split up because of how extension methods are loaded" 1 ('FFI-Libraries' 'FFI-Tools' 'FFI-Callbacks' 'FFI-Tests' 'FFI-PoolsTests' 'FFI-CallbacksTests') squeak 'VMMaker' 6 ('CogPools-ISAs' 'BytecodeSets.spur' 'VMMaker.oscog' 'VMMakerUI' 'Cog' 'CogTools' 'ImageFormat' 'FileAttributesPlugin.oscog') squeaksource 'AioPlugin' 7 ('VMConstruction-Plugins-AioPlugin.oscog') squeaksource 'Alien' 0 ('Alien-Core' 'Alien-Tests-Core' 'Alien-Win32') squeaksource 'FreeType' 5 ('FreeTypeConstants' "'FreeType'") squeaksource 'FreetypePlugin' 8 ('Freetype-Plugin') squeaksource 'OSProcess' 4 ('OSProcess') squeaksource 'OSProcessPlugin' 9 ('VMConstruction-Plugins-OSProcessPlugin.oscog') squeaksource 'rb' 5 ('AST-Core' 'AST-Semantic' 'AST-Tests-Core' 'AST-Tests-Semantic' 'Refactoring-Changes' 'Refactoring-Core' 'Refactoring-Environment' 'Refactoring-Tests-Changes' 'Refactoring-Tests-Core' 'Refactoring-Tests-Environment' 'Refactoring-Squeak-Platform' 'Refactoring-Critics' 'Refactoring-Spelling') squeaksource 'Speech' "This for the Klatt speech synthesiser, but seems to be AWOL" 2 ('SharedPool-Speech' ) squeaksource 'XDCP' 9 ('VMConstruction-Plugins-XDisplayControlPlugin.oscog' ) squeaksource 'Balloon3D' 9 ('Balloon3D-Constants' 'Balloon3D-Plugins' ) squeaksource 'Cryptography' 9 ('CryptographyPlugins' ) squeaksource 'Printf' 5 ('NumberPrinter' 'Printf') squeaksource 'VectorEnginePlugin' 9 ('VectorEnginePlugin') squeaksource 'dbus' 9 ('DBus-Plugin') squeaksource 'Rome' 9 ('Rome-Base' 'Rome-PluginCanvas' 'Rome-Plugin') squeaksource 'GStreamer' 9 ('GStreamer-Plugins') )."AndreasSystemProfiler and AssemblerMethod are now in trunk now in trunk"#(AndreasSystemProfiler AssemblerMethod) with: #((squeak 'VMMaker' 9 ('AndreasProfiler')) (squeak 'VMMaker' 3 ('MethodMassage'))) do: [:className :addition| (Smalltalk classNamed: className) ifNil: [manifest := manifest, addition]].load := Array streamContents: [:s | manifest groupsDo: [:installerSymbol :project :order :packages | | installer | installer := Installer perform: installerSymbol. installer project: project. installer packages addAll: packages. s nextPut: order -> installer]].load := (load sorted: [:a :b | a key <= b key]) collect: [:ea | ea value].load do: [:installer | installer installQuietly].self currentWorld findATranscript: nil.Project uiManager edit: (FileDirectory default fileNamed: 'Workspace.text') contentsOfEntireFile label: 'Overview' shouldStyle: false.#('VM Simulation' 'Source Generation' 'Slang Test' 'In-image Compilation') reverseDo: [:nickname| | label | label := nickname, ' Workspace'. Project uiManager edit: (FileDirectory default fileNamed: label, '.text') contentsOfEntireFile label: label shouldStyle: true].Utilities appendToCommonRequests: '-\VMMaker generateConfiguration\VMMaker generateAllConfigurationsUnderVersionControl\VMClass openCogMultiWindowBrowser\VMClass openObjectMemoriesInterpretersBrowser\VMClass openSpurMultiWindowBrowser' withCRs.CodeHolder useMultiWindowBrowsers: true.#('Cog' 'CogTools' 'VMMaker') do: [:pkg| (PackageInfo named: pkg) classes do: [:c| c organization sortCategories. c class organization sortCategories]].(Smalltalk classNamed: #StackInterpreter) withAllSubclasses do: [:sic| sic reorganizeAsISeeFit].Smalltalk snapshot: true andQuit: true
1+
| manifest load |
2+
3+
"Update Trunk image"
4+
[MCMcmUpdater default doUpdate: false] on: Warning do: [:ex | ex resume: true].
5+
6+
"Disable underscore as assignment, allowing underscores in method names."
7+
Scanner allowUnderscoreAsAssignment: false.
8+
TranscriptStream characterLimit: 1000000.
9+
10+
manifest := #(
11+
squeak 'FFI'
12+
0 ('FFI-Pools' 'FFI-Kernel')
13+
squeak 'FFI' "Split up because of how extension methods are loaded"
14+
1 ('FFI-Libraries' 'FFI-Tools' 'FFI-Callbacks'
15+
'FFI-Tests' 'FFI-PoolsTests' 'FFI-CallbacksTests')
16+
squeak 'VMMaker'
17+
6 ('CogPools-ISAs' 'BytecodeSets.spur' 'VMMaker.oscog' 'VMMakerUI'
18+
'Cog' 'CogTools' 'ImageFormat' 'FileAttributesPlugin.oscog')
19+
squeaksource 'AioPlugin'
20+
7 ('VMConstruction-Plugins-AioPlugin.oscog')
21+
squeaksource 'Alien'
22+
0 ('Alien-Core' 'Alien-Tests-Core' 'Alien-Win32')
23+
squeaksource 'FreeType'
24+
5 ('FreeTypeConstants' "'FreeType'")
25+
squeaksource 'FreetypePlugin'
26+
8 ('Freetype-Plugin')
27+
squeaksource 'OSProcess'
28+
4 ('OSProcess')
29+
squeaksource 'OSProcessPlugin'
30+
9 ('VMConstruction-Plugins-OSProcessPlugin.oscog')
31+
squeaksource 'rb'
32+
5 ('AST-Core' 'AST-Semantic' 'AST-Tests-Core' 'AST-Tests-Semantic'
33+
'Refactoring-Changes' 'Refactoring-Core' 'Refactoring-Environment'
34+
'Refactoring-Tests-Changes' 'Refactoring-Tests-Core'
35+
'Refactoring-Tests-Environment' 'Refactoring-Squeak-Platform'
36+
'Refactoring-Critics' 'Refactoring-Spelling')
37+
squeaksource 'Speech' "This for the Klatt speech synthesiser, but seems to be AWOL"
38+
2 ('SharedPool-Speech' )
39+
squeaksource 'XDCP'
40+
9 ('VMConstruction-Plugins-XDisplayControlPlugin.oscog' )
41+
squeaksource 'Balloon3D'
42+
9 ('Balloon3D-Constants' 'Balloon3D-Plugins' )
43+
squeaksource 'Cryptography'
44+
9 ('CryptographyPlugins' )
45+
squeaksource 'Printf'
46+
5 ('NumberPrinter' 'Printf')
47+
squeaksource 'VectorEnginePlugin'
48+
9 ('VectorEnginePlugin')
49+
squeaksource 'dbus'
50+
9 ('DBus-Plugin')
51+
squeaksource 'Rome'
52+
9 ('Rome-Base' 'Rome-PluginCanvas' 'Rome-Plugin')
53+
squeaksource 'GStreamer'
54+
9 ('GStreamer-Plugins')
55+
).
56+
"AndreasSystemProfiler and AssemblerMethod are now in trunk now in trunk"
57+
#(AndreasSystemProfiler AssemblerMethod)
58+
with: #((squeak 'VMMaker' 9 ('AndreasProfiler'))
59+
(squeak 'VMMaker' 3 ('MethodMassage')))
60+
do: [:className :addition|
61+
(Smalltalk classNamed: className) ifNil:
62+
[manifest := manifest, addition]].
63+
64+
load := Array streamContents: [:s |
65+
manifest groupsDo: [:installerSymbol :project :order :packages |
66+
| installer |
67+
installer := Installer perform: installerSymbol.
68+
installer project: project.
69+
installer packages addAll: packages.
70+
s nextPut: order -> installer]].
71+
load := (load sorted: [:a :b | a key <= b key]) collect: [:ea | ea value].
72+
load do: [:installer | installer installQuietly].
73+
74+
self currentWorld findATranscript: nil.
75+
76+
Project uiManager
77+
edit: (FileDirectory default fileNamed: 'Workspace.text') contentsOfEntireFile
78+
label: 'Overview'
79+
shouldStyle: false.
80+
81+
#('VM Simulation' 'Source Generation' 'Slang Test' 'In-image Compilation')
82+
reverseDo: [:nickname| | label |
83+
label := nickname, ' Workspace'.
84+
Project uiManager
85+
edit: (FileDirectory default fileNamed: label, '.text') contentsOfEntireFile
86+
label: label
87+
shouldStyle: true].
88+
89+
Utilities appendToCommonRequests: '-\VMMaker generateConfiguration\VMMaker generateAllConfigurationsUnderVersionControl\VMClass openCogMultiWindowBrowser\VMClass openObjectMemoriesInterpretersBrowser\VMClass openSpurMultiWindowBrowser' withCRs.
90+
91+
CodeHolder useMultiWindowBrowsers: true.
92+
93+
#('Cog' 'CogTools' 'VMMaker') do:
94+
[:pkg|
95+
(PackageInfo named: pkg) classes do:
96+
[:c|
97+
c organization sortCategories.
98+
c class organization sortCategories]].
99+
100+
(Smalltalk classNamed: #StackInterpreter) withAllSubclasses do:
101+
[:sic| sic reorganizeAsISeeFit].
102+
103+
Smalltalk snapshot: true andQuit: true

image/CompiledMethod-usesAlternateBytecodeSet.st

Lines changed: 0 additions & 1 deletion
This file was deleted.

image/LoadReader.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repository := MCHttpRepository
1919
[ex pass].
2020
ex resume]].
2121

22-
((Process instVarNames at: 4) = 'threadId'
22+
((Process instVarNames at: 4) = 'threadAffinity'
2323
and: [(flags := Smalltalk vmParameterAt: 48) noMask: 1]) ifTrue:
2424
[Smalltalk vmParameterAt: 48 put: flags + 1].
2525

platforms/iOS/vm/Common/Classes/sqSqueakMainApp.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,13 @@ Some of this code was funded via a grant from the European Smalltalk User Group
348348
*
349349
*/
350350

351+
#if COGMTVM
352+
extern void dumpOwnerLogOnMax(FILE *aFile, sqInt maxElements);
353+
#else
354+
# define dumpOwnerLogOnMax(f,n) 0 // nada
355+
#endif
356+
#define NUMOLOGS 128
357+
351358
static void
352359
sigusr1(int sig, siginfo_t *info, void *uap)
353360
{
@@ -364,7 +371,9 @@ Some of this code was funded via a grant from the European Smalltalk User Group
364371
FILE *crashdump = crashDumpFile();
365372
ctime_r(&now,ctimebuf);
366373
reportStackState(crashdump,"SIGUSR1", ctimebuf, 1, uap);
374+
dumpOwnerLogOnMax(crashdump,NUMOLOGS);
367375
reportStackState(stdout,"SIGUSR1", ctimebuf, 1, uap);
376+
dumpOwnerLogOnMax(stdout,NUMOLOGS);
368377
fclose(crashdump);
369378

370379
errno = saved_errno;
@@ -400,7 +409,9 @@ Some of this code was funded via a grant from the European Smalltalk User Group
400409
FILE *crashdump = crashDumpFile();
401410
ctime_r(&now,ctimebuf);
402411
reportStackState(crashdump,fault, ctimebuf, 0, uap);
412+
dumpOwnerLogOnMax(crashdump,NUMOLOGS);
403413
reportStackState(stderr,fault, ctimebuf, 0, uap);
414+
dumpOwnerLogOnMax(stderr,NUMOLOGS);
404415
fclose(crashdump);
405416
}
406417
if (blockOnError) block();

platforms/iOS/vm/Common/Classes/sqSqueakMainApplication.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,11 @@ - (void) runSqueak {
204204
}];
205205

206206
[self setupAIO];
207-
assert(getVMOSThread() != guiThread);
208-
assert(getVMOSThread() == ioCurrentOSThread());
209-
207+
if (getVMOSThread()) {
208+
assert(getVMOSThread() != guiThread);
209+
assert(getVMOSThread() == ioCurrentOSThread());
210+
}
211+
assert(guiThread != ioCurrentOSThread());
210212
interpret();
211213
}
212214
}

platforms/unix/vm/sqUnixMain.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,14 +1149,20 @@ crashDumpFile()
11491149
return fopen(namebuf,"a+");
11501150
}
11511151

1152+
#if COGMTVM
1153+
extern void dumpOwnerLogOnMax(FILE *aFile, sqInt maxElements);
1154+
#else
1155+
# define dumpOwnerLogOnMax(f,n) 0 // nada
1156+
#endif
1157+
#define NUMOLOGS 128
1158+
11521159
static void
11531160
sigusr1(int sig, siginfo_t *info, void *uap)
11541161
{
11551162
int saved_errno = errno;
11561163
time_t now = time(NULL);
11571164
char ctimebuf[32];
11581165
FILE *crashdump;
1159-
11601166
if (!ioOSThreadsEqual(ioCurrentOSThread(),getVMOSThread())) {
11611167
pthread_kill(getVMOSThread(),sig);
11621168
errno = saved_errno;
@@ -1166,7 +1172,9 @@ sigusr1(int sig, siginfo_t *info, void *uap)
11661172
crashdump = crashDumpFile();
11671173
ctime_r(&now,ctimebuf);
11681174
reportStackState(crashdump, "SIGUSR1", ctimebuf, 1, uap);
1175+
dumpOwnerLogOnMax(crashdump,NUMOLOGS);
11691176
reportStackState(stdout, "SIGUSR1", ctimebuf, 1, uap);
1177+
dumpOwnerLogOnMax(stdout,NUMOLOGS);
11701178
fclose(crashdump);
11711179

11721180
errno = saved_errno;
@@ -1198,7 +1206,9 @@ sigsegv(int sig, siginfo_t *info, void *uap)
11981206
crashdump = crashDumpFile();
11991207
ctime_r(&now,ctimebuf);
12001208
reportStackState(crashdump, fault, ctimebuf, 0, uap);
1201-
reportStackState(stdout, fault, ctimebuf, 0, uap);
1209+
dumpOwnerLogOnMax(crashdump,NUMOLOGS);
1210+
reportStackState(stderr, fault, ctimebuf, 0, uap);
1211+
dumpOwnerLogOnMax(stderr,NUMOLOGS);
12021212
fclose(crashdump);
12031213
}
12041214
if (blockOnError) block();

src/spur32.cog/cointerp.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* Automatically generated by
2-
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3681 uuid: 84bd780d-3a40-4927-9642-e7af19ce89b5
3-
(Cog-eem.504, * Compiler-nice.525)
2+
CCodeGeneratorGlobalStructure VMMaker.oscog-eem.3683 uuid: f2c3be30-d60c-43f5-8d45-5f99daf5a7af
3+
(Cog-eem.504, Compiler-eem.526)
44
*/
55

66

@@ -21,6 +21,9 @@
2121
# define NeverInline /*empty*/
2222
#endif
2323

24+
extern void dumpOwnerLog(void);
25+
extern void dumpOwnerLogOn(FILE *aFile);
26+
extern void dumpOwnerLogOnMax(FILE *aFile, sqInt maxEntries);
2427
extern sqInt vmIsOwned(void);
2528
extern sqInt accessorDepthForPrimitiveIndex(sqInt primIndex);
2629
extern usqInt argumentCountAddress(void);

0 commit comments

Comments
 (0)