Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alamvic/xcvmprofiler
VM Profiler based on instruments
https://github.com/alamvic/xcvmprofiler
Last synced: about 2 months ago
JSON representation
VM Profiler based on instruments
- Host: GitHub
- URL: https://github.com/alamvic/xcvmprofiler
- Owner: Alamvic
- License: mit
- Created: 2024-01-30T10:45:10.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-05T14:45:24.000Z (6 months ago)
- Last Synced: 2024-07-05T18:26:38.878Z (6 months ago)
- Language: Smalltalk
- Size: 2.05 MB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XCVMProfiler
VM Profiler based on [instruments](https://help.apple.com/instruments/mac/current/#/dev7b09c84f5) and [perf](https://perf.wiki.kernel.org/)## Instruments 🍎
### Install
```smalltalk
Metacello new
baseline: 'XCTrace';
repository: 'github://Alamvic/XCVMProfiler:main/src';
load.
```### How to use
```smalltalk
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
```smalltalk
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:
```console
sudo perf record -a -g --call-graph=dwarf -- ./script.sh
sudo perf report --header --call-graph=callee --stdio > perf_example.txt
```#### For Pharo
```smalltalk
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
```