[Vm-dev] VM Maker: CogTools-sk.79.mcz

commits at source.squeak.org commits at source.squeak.org
Mon May 29 10:03:15 UTC 2017


Sophie Kaleba uploaded a new version of CogTools to project VM Maker:
http://source.squeak.org/VMMaker/CogTools-sk.79.mcz

==================== Summary ====================

Name: CogTools-sk.79
Author: sk
Time: 29 May 2017, 12:03:07.991919 pm
UUID: 03ac5973-4cc7-4c4d-bf6f-c82b01d333bc
Ancestors: CogTools-sk.78

add some class comments
cleaning the code

=============== Diff against CogTools-sk.78 ===============

Item was changed:
  ----- Method: PharoVMFileSystem>>deleteContentsOf: (in category 'as yet unclassified') -----
  deleteContentsOf: aDirectory
  
+ 	"not yet implemented. The temp directory created during the profiling will not be deleted when quitting the image"
+ 	!
- 	"have to find something similar"!

Item was changed:
  VMProfiler subclass: #PharoVMProfiler
  	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CogTools-VMProfiler'!
+ 
+ !PharoVMProfiler commentStamp: 'sk 5/29/2017 11:56' prior: 0!
+ I am the VMProfiler called when using a Pharo image.
+ 
+ I can only be used headless for the moment.
+ Try inspecting on : String streamContents: [ :s | VMProfiler headlessSpyOn: [ 1 to: 10000000 do: [ :i | Object new ] ] reportOn: s ]
+ 
+ !

Item was changed:
  VMProfiler subclass: #SqueakVMProfiler
  	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CogTools-VMProfiler'!
+ 
+ !SqueakVMProfiler commentStamp: 'sk 5/29/2017 11:56' prior: 0!
+ I am the VMProfiler called when using a Squeak image.
+ 
+ I can be used 
+ - headful (WorldMenu>open>VMProfiler)
+ - or headless : for instance, inspect on : String streamContents: [ :s | VMProfiler headlessSpyOn: [ 1 to: 10000000 do: [ :i | Object new ] ] reportOn: s ]
+ !

Item was changed:
  Object subclass: #VMFileSystem
  	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CogTools-VMProfiler'!
  
+ !VMFileSystem commentStamp: 'sk 5/29/2017 11:27' prior: 0!
+ I dispatch between the file systems of Pharo (FileSystem) and Squeak (FileDirectory)!
- !VMFileSystem commentStamp: 'SophieKaleba 5/15/2017 01:49' prior: 0!
- I am a bridge between the file systems of Pharo and Squeak.
- I am used in the VMProfiler to keep it generic.!

Item was changed:
  ----- Method: VMFileSystem>>nameFordirPath:plus: (in category 'as yet unclassified') -----
  nameFordirPath: aDirPath plus: aProcessId
+ "answers a FileSystem/Directory object representing a directory. The name of this directory is its path+the name of a process id"
  	
  	self subclassResponsibility !

Item was changed:
  ----- Method: VMProfilerMacSymbolsManager>>parseSymbolsFor: (in category 'parsing') -----
  parseSymbolsFor: module
  	| proc symtab symStream |
  	(VMFileSystem exists: tempDir fullName, '/', module shortName) ifFalse: 
- 	"(tempDir fileExists: module shortName) ifFalse:"
  		["N.B. Don't use the -f option (which meant flat symbols) as in El Capitan it is misinterpreted to mean -format."
  		 proc := OSProcess thisOSProcess command:
  						'cd ', tempDir fullName,
  						';nm -n -arch ', self archName, " -f" ' "', module name, '" | grep -v " [aAU] " >"', module shortName, '"'].
  	symStream := (Array new: 1000) writeStream.
  	symStream nextPut: module.
+ 	proc ifNotNil: [[proc isComplete] whileFalse: [(Delay forMilliseconds: 25) wait]].
- 	proc ifNotNil:[(Delay forMilliseconds: 25) wait].
- 		"[[proc isComplete] whileFalse: [(Delay forMilliseconds: 25) wait]]." "infinite loop"
  	symtab := [StandardFileStream readOnlyFileNamed: (tempDir fullName, '/', module shortName)]
  					on: Error
  					do: [:ex| "Handle flaky OSProcess stuff by reporting error and failing to parse"
  						Transcript print: ex; flush.
  						^nil].
  	"Have caller eliminate modules with no text."
  	symtab size = 0 ifTrue:
  		[^nil].
  	module shortName = 'HIToolbox' ifTrue: [self halt].
  	[| prev |
  	 prev := self parseSymbolsFrom: symtab to: symStream.
  	"CoreAUC has a huge chunk of data at the end of its text segment that causes the profiler to spend ages
  	 counting zeros.  Hack fix by setting the end of the last symbol in the text segment to a little less than 1Mb." 
  	"00000000000f1922    retq" "Mavericks 13.4"
  	"00000000000f3b21    retq" "Yosemite 14.5"
  	module shortName = 'CoreAUC' ifTrue: [prev limit: 16rf8000].
  	 symbolsByModule
  		at: module
  		put: (self relocateSymbols: symStream contents allButFirst inModule: module).
  	 (prev notNil
  	  and: [prev limit isNil]) ifTrue: [prev limit: module limit]]
  		ensure: [symtab close]!



More information about the Vm-dev mailing list