Skip to content

Commit

Permalink
Merge pull request #4 from matburnx/main
Browse files Browse the repository at this point in the history
Changed the classes and added a README
  • Loading branch information
PalumboN authored Jun 25, 2024
2 parents f0c02b9 + 9dd8396 commit e4a42fc
Show file tree
Hide file tree
Showing 25 changed files with 1,382 additions and 517 deletions.
96 changes: 96 additions & 0 deletions .github/workflows/mutalkCI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: MutalkCI

on:
push:
branches: [ main ]
paths-ignore:
- 'README.md'
- 'resources/**'
pull_request:
branches: [ main ]
paths-ignore:
- 'README.md'
- 'resources/**'

workflow_dispatch:
# inputs:
# mode:
# description: 'modes: full (run on all project), diff (run on the last commit diff), commit (especify a commit to calculate diff)'
# required: true
# default: 'diff'
# commit:
# description: 'If mode == commit, here you enter the Commid id/name/shortId to evaluate the diff'
# required: false
# default: ''

jobs:
eventBased:
runs-on: ubuntu-latest
if: github.event_name != 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hpi-swa/setup-smalltalkCI@v1
id: smalltalkci
with:
smalltalk-image: Pharo64-stable

- run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }}
shell: bash
timeout-minutes: 15

- run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} metacello install "github://matburnx/mutalk:-CI-not-working" BaselineOfMuTalk
shell: bash

- run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}}
shell: bash

- run: cp ${{env.SMALLTALK_CI_BUILD_BASE}}/__mutalk_summary.md $GITHUB_STEP_SUMMARY

- uses: actions/upload-artifact@v4
with:
name: mutation-testing-output
path: ${{env.SMALLTALK_CI_BUILD_BASE}}/__mutalk_export.json

manual:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: hpi-swa/setup-smalltalkCI@v1
id: smalltalkci
with:
smalltalk-image: Pharo64-stable

- run: smalltalkci -s ${{ steps.smalltalkci.outputs.smalltalk-image }}
shell: bash
timeout-minutes: 15

- run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} metacello install "github://matburnx/mutalk:-CI-not-working" BaselineOfMuTalk
shell: bash

- run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}}

# - name: full mutation testing
# if: github.event.inputs.mode == 'full'
# run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}}

# - name: diff mutation testing
# if: github.event.inputs.mode == 'diff'
# run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}} --diff

# - name: commit mutation testing
# if: github.event.inputs.mode == 'commit'
# run: ${{env.SMALLTALK_CI_VM}} ${{env.SMALLTALK_CI_IMAGE}} mutalk --project=${{github.event.repository.name}} --commit=${{github.event.inputs.commit}}

- run: cp ${{env.SMALLTALK_CI_BUILD_BASE}}/__mutalk_summary.md $GITHUB_STEP_SUMMARY

- uses: actions/upload-artifact@v4
with:
name: mutation-testing-output
path: ${{env.SMALLTALK_CI_BUILD_BASE}}/__mutalk_export.json
10 changes: 8 additions & 2 deletions .github/workflows/smalltalkCI.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# This is a basic workflow to help you get started with Actions

name: CI
name: pharoCI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- 'resources/**'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- 'resources/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -23,7 +29,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: hpi-swa/setup-smalltalkCI@v1
id: smalltalkci
with:
Expand Down
2 changes: 1 addition & 1 deletion .smalltalk.ston
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SmalltalkCISpec {
#platforms : [ #pharo ]
},
SCIMetacelloLoadSpec {
#baseline : 'TreeParser',
#baseline : 'PerfTreeParser',
#directory : 'src',
#platforms : [ #pharo ]
}
Expand Down
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
# XCVMProfiler
VM Profiler based on instruments
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
```smalltalk
fr := (FileLocator home / 'path/to/XCVMProfiler/resources/perf_stock_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
```
78 changes: 78 additions & 0 deletions resources/perf_stock_multiple_children.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# ========
# captured on : Wed May 29 09:28:58 2024
# header version : 1
# data offset : 352
# data size : 16366888
# feat offset : 16367240
# hostname : matburnx-laptop
# os release : 6.8.0-76060800daily20240311-generic
# perf version : 6.8.0
# arch : x86_64
# nrcpus online : 12
# nrcpus avail : 12
# cpudesc : AMD Ryzen 5 4600H with Radeon Graphics
# cpuid : AuthenticAMD,23,96,1
# total memory : 15776888 kB
# cmdline : /usr/lib/linux-tools-6.8.0-76060800daily20240311/perf record -g --call-graph=dwarf -- ./script2.sh --all-user
# event : name = cycles:P, , id = { 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287 }, type = 0 (PERF_TYPE_HARDWARE), size = 136, config = 0 (PERF_COUNT_HW_CPU_CYCLES), { sample_period, sample_freq } = 4000, sample_type = IP|TID|TIME|ADDR|CALLCHAIN|PERIOD|REGS_USER|STACK_USER|DATA_SRC, read_format = ID|LOST, disabled = 1, inherit = 1, mmap = 1, comm = 1, freq = 1, enable_on_exec = 1, task = 1, precise_ip = 2, mmap_data = 1, sample_id_all = 1, exclude_callchain_user = 1, mmap2 = 1, comm_exec = 1, ksymbol = 1, bpf_event = 1, sample_regs_user = 0xff0fff, sample_stack_user = 8192
# CPU_TOPOLOGY info available, use -I to display
# NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: cpu = 4, amd_iommu_0 = 12, breakpoint = 5, ibs_fetch = 10, ibs_op = 11, kprobe = 8, msr = 13, power = 14, software = 1, tracepoint = 2, uprobe = 9
# CACHE info available, use -I to display
# time of first sample : 924.754662
# time of last sample : 925.152255
# sample duration : 397.592 ms
# MEM_TOPOLOGY info available, use -I to display
# bpf_prog_info 2: bpf_prog_7cc47bbf07148bfe_hid_tail_call addr 0xffffffffc0314954 size 110
# bpf_prog_info 5: bpf_prog_e3dbd137be8d6168 addr 0xffffffffc0314b30 size 313
# bpf_prog_info 6: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0314c9c size 58
# bpf_prog_info 7: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0314d2c size 58
# bpf_prog_info 8: bpf_prog_0ecd07b7b633809f addr 0xffffffffc0316e30 size 777
# bpf_prog_info 9: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0317158 size 95
# bpf_prog_info 10: bpf_prog_6deef7357e7b4530 addr 0xffffffffc03171d8 size 95
# bpf_prog_info 11: bpf_prog_ee0e253c78993a24 addr 0xffffffffc031eb10 size 675
# bpf_prog_info 12: bpf_prog_ee0e253c78993a24 addr 0xffffffffc031f018 size 671
# bpf_prog_info 13: bpf_prog_8b9c33f36f812014 addr 0xffffffffc03214a4 size 1109
# bpf_prog_info 14: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0321914 size 95
# bpf_prog_info 15: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0321994 size 94
# bpf_prog_info 19: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0328bdc size 94
# bpf_prog_info 20: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0328c48 size 95
# bpf_prog_info 21: bpf_prog_28a890580b33b0dc addr 0xffffffffc032b50c size 872
# bpf_prog_info 22: bpf_prog_ee0e253c78993a24 addr 0xffffffffc032d4d0 size 673
# bpf_prog_info 29: bpf_prog_6be0d743674e5faa_syscall__execve addr 0xffffffffc034c570 size 5360
# bpf_prog_info 30: bpf_prog_a43530058ef998f5_do_ret_sys_execve addr 0xffffffffc034daa0 size 589
# btf info of id 5
# btf info of id 176
# cpu pmu capabilities: max_precise=0
# AMD systems uses ibs_op// PMU for some precise events, e.g.: cycles:p, see the 'perf list' man page for further details.
# missing features: (null) BRANCH_STACK GROUP_DESC AUXTRACE STAT CLOCKID DIR_FORMAT COMPRESSED CLOCK_DATA HYBRID_TOPOLOGY
# ========
#
#
# Total Lost Samples: 0
#
# Samples: 1K of event 'cycles:P'
# Event count (approx.): 963528052
#
# Children Self Command Shared Object Symbol
# ........ ........ ............... ......................................... .........................................................
#
46.02% 0.00% pharo [kernel.kallsyms] [k] entry_SYSCALL_64_after_hwframe
|
---entry_SYSCALL_64_after_hwframe
|
--45.91%--do_syscall_64
|
|--36.78%--__x64_sys_read
|
|
|--6.88%--syscall_exit_to_user_mode
| |
| --6.86%--arch_do_signal_or_restart
| |
| --6.86%--get_signal
|
|
--0.53%--__x64_sys_openat
do_sys_openat2

72 changes: 72 additions & 0 deletions resources/perf_stock_same_percentage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# ========
# captured on : Wed May 29 09:28:58 2024
# header version : 1
# data offset : 352
# data size : 16366888
# feat offset : 16367240
# hostname : matburnx-laptop
# os release : 6.8.0-76060800daily20240311-generic
# perf version : 6.8.0
# arch : x86_64
# nrcpus online : 12
# nrcpus avail : 12
# cpudesc : AMD Ryzen 5 4600H with Radeon Graphics
# cpuid : AuthenticAMD,23,96,1
# total memory : 15776888 kB
# cmdline : /usr/lib/linux-tools-6.8.0-76060800daily20240311/perf record -g --call-graph=dwarf -- ./script2.sh --all-user
# event : name = cycles:P, , id = { 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287 }, type = 0 (PERF_TYPE_HARDWARE), size = 136, config = 0 (PERF_COUNT_HW_CPU_CYCLES), { sample_period, sample_freq } = 4000, sample_type = IP|TID|TIME|ADDR|CALLCHAIN|PERIOD|REGS_USER|STACK_USER|DATA_SRC, read_format = ID|LOST, disabled = 1, inherit = 1, mmap = 1, comm = 1, freq = 1, enable_on_exec = 1, task = 1, precise_ip = 2, mmap_data = 1, sample_id_all = 1, exclude_callchain_user = 1, mmap2 = 1, comm_exec = 1, ksymbol = 1, bpf_event = 1, sample_regs_user = 0xff0fff, sample_stack_user = 8192
# CPU_TOPOLOGY info available, use -I to display
# NUMA_TOPOLOGY info available, use -I to display
# pmu mappings: cpu = 4, amd_iommu_0 = 12, breakpoint = 5, ibs_fetch = 10, ibs_op = 11, kprobe = 8, msr = 13, power = 14, software = 1, tracepoint = 2, uprobe = 9
# CACHE info available, use -I to display
# time of first sample : 924.754662
# time of last sample : 925.152255
# sample duration : 397.592 ms
# MEM_TOPOLOGY info available, use -I to display
# bpf_prog_info 2: bpf_prog_7cc47bbf07148bfe_hid_tail_call addr 0xffffffffc0314954 size 110
# bpf_prog_info 5: bpf_prog_e3dbd137be8d6168 addr 0xffffffffc0314b30 size 313
# bpf_prog_info 6: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0314c9c size 58
# bpf_prog_info 7: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0314d2c size 58
# bpf_prog_info 8: bpf_prog_0ecd07b7b633809f addr 0xffffffffc0316e30 size 777
# bpf_prog_info 9: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0317158 size 95
# bpf_prog_info 10: bpf_prog_6deef7357e7b4530 addr 0xffffffffc03171d8 size 95
# bpf_prog_info 11: bpf_prog_ee0e253c78993a24 addr 0xffffffffc031eb10 size 675
# bpf_prog_info 12: bpf_prog_ee0e253c78993a24 addr 0xffffffffc031f018 size 671
# bpf_prog_info 13: bpf_prog_8b9c33f36f812014 addr 0xffffffffc03214a4 size 1109
# bpf_prog_info 14: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0321914 size 95
# bpf_prog_info 15: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0321994 size 94
# bpf_prog_info 19: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0328bdc size 94
# bpf_prog_info 20: bpf_prog_6deef7357e7b4530 addr 0xffffffffc0328c48 size 95
# bpf_prog_info 21: bpf_prog_28a890580b33b0dc addr 0xffffffffc032b50c size 872
# bpf_prog_info 22: bpf_prog_ee0e253c78993a24 addr 0xffffffffc032d4d0 size 673
# bpf_prog_info 29: bpf_prog_6be0d743674e5faa_syscall__execve addr 0xffffffffc034c570 size 5360
# bpf_prog_info 30: bpf_prog_a43530058ef998f5_do_ret_sys_execve addr 0xffffffffc034daa0 size 589
# btf info of id 5
# btf info of id 176
# cpu pmu capabilities: max_precise=0
# AMD systems uses ibs_op// PMU for some precise events, e.g.: cycles:p, see the 'perf list' man page for further details.
# missing features: (null) BRANCH_STACK GROUP_DESC AUXTRACE STAT CLOCKID DIR_FORMAT COMPRESSED CLOCK_DATA HYBRID_TOPOLOGY
# ========
#
#
# Total Lost Samples: 0
#
# Samples: 1K of event 'cycles:P'
# Event count (approx.): 963528052
#
# Children Self Command Shared Object Symbol
# ........ ........ ............... ......................................... .........................................................
#
46.02% 0.00% pharo [kernel.kallsyms] [k] entry_SYSCALL_64_after_hwframe
|
---entry_SYSCALL_64_after_hwframe
|
--45.91%--do_syscall_64
|
|--36.78%--__x64_sys_read
| ksys_read
| vfs_read
| |
| --36.46%--ext4_file_read_iter
| |

Loading

0 comments on commit e4a42fc

Please sign in to comment.