Created
December 3, 2015 22:26
-
-
Save papertigers/658868b9e225de312bb8 to your computer and use it in GitHub Desktop.
Swift on lx with dtrace!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@3e4601c0-00af-4d93-c8b2-f4584487aa7c:~# dtrace -ln pid18959:main::entry | |
ID PROVIDER MODULE FUNCTION NAME | |
14543 pid18959 main main entry | |
14693 pid18959 main _TF4main6findMeFT_Si entry | |
14694 pid18959 main _TF4main1bFT_Si entry | |
14695 pid18959 main __libc_csu_init entry | |
14696 pid18959 main __libc_csu_fini entry | |
root@3e4601c0-00af-4d93-c8b2-f4584487aa7c:~# dtrace -ln pid18959:main::entry | swift-demangle | |
ID PROVIDER MODULE FUNCTION NAME | |
14543 pid18959 main main entry | |
14693 pid18959 main main.findMe () -> Swift.Int entry | |
14694 pid18959 main main.b () -> Swift.Int entry | |
14695 pid18959 main __libc_csu_init entry | |
14696 pid18959 main __libc_csu_fini entry | |
root@3e4601c0-00af-4d93-c8b2-f4584487aa7c:~# dtrace -Fn 'pid$target:main::entry, pid$target:main::return' -p `pgrep main` | |
dtrace: description 'pid$target:main::entry, pid$target:main::return' matched 9 probes | |
CPU FUNCTION | |
20 -> _TF4main6findMeFT_Si | |
20 -> _TF4main1bFT_Si | |
20 <- _TF4main1bFT_Si | |
20 <- _TF4main6findMeFT_Si | |
20 -> _TF4main6findMeFT_Si | |
20 -> _TF4main1bFT_Si | |
20 <- _TF4main1bFT_Si | |
20 <- _TF4main6findMeFT_Si | |
20 -> _TF4main6findMeFT_Si | |
root@3e4601c0-00af-4d93-c8b2-f4584487aa7c:~# swift-demangle < output.txt | |
20 -> main.findMe () -> Swift.Int | |
20 -> main.b () -> Swift.Int | |
20 <- main.b () -> Swift.Int | |
20 <- main.findMe () -> Swift.Int | |
20 -> main.findMe () -> Swift.Int | |
20 -> main.b () -> Swift.Int | |
20 <- main.b () -> Swift.Int | |
20 <- main.findMe () -> Swift.Int | |
20 -> main.findMe () -> Swift.Int | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func findMe() -> Int { | |
let value = b() | |
return value | |
} | |
func b() -> Int { | |
let result = 1 + 1 | |
return result | |
} | |
while 1 == 1 { | |
findMe() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment