Skip to content

Alamvic/XCVMProfiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XCVMProfiler

VM Profiler based on instruments and perf

Instruments 🍎

Install

Metacello new
  baseline: 'XCTrace';
  repository: 'github://Alamvic/XCVMProfiler:main/src';
  load.

How to use

fr := (FileLocator home / 'path/to/XCVMProfiler/resources/test-profile.trace') asFileReference.
"To get the XML data"
tree := XCTraceTree fromTimeProfileFileReference: fr.
samples := tree samples.

"To directly get the different classified profiles"
primitiveProfiles := (XCVMDifferentialPrimitiveProfiler onFiles: {fr}) profiles.
profiles := (XCVMDifferentialProfiler onFiles: {fr}) profiles.

perf 🐧

Install

Metacello new
  baseline: 'PerfTreeParser';
  repository: 'github://Alamvic/XCVMProfiler:main/src';
  load.

How to use

For perf

You need to use these parameters in order for the parser to work as intended:

sudo perf record -a -g --call-graph=dwarf -- ./script.sh
sudo perf report --header --call-graph=callee --stdio > perf_example.txt

For Pharo

fr := (FileLocator home / 'path/to/XCVMProfiler/resources/perf_example_callee_multiple_children.txt') asFileReference.

"Use `parseFile:` to directly get the head of the node with all the parsing done"
node := PerfTreeParser parseFile: fr.

"To get the traces of the nodes:"
traces := node traces.

"You can use `fromFile:` if you want to play with the parser"
parser := PerfTreeParser fromFile: fr

About

VM Profiler based on instruments

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published