Search
Wednesday, 16th of August 2017, 16:34:53 UTC
16:43:46
drmeister
On OS X we can profile anything that you compile-file and then run.
16:44:16
drmeister
On linux we might be able to profile compile - but I haven't tested it yet.
16:46:15
Bike
compile-file would be fine
16:47:21
Bike
how do i set that up again? well, i guess i need to install dtrace and stuff first
16:47:45
drmeister
On OS X dtrace is built in
16:48:01
drmeister
To get started - look at the clasp/src/profiler directory.
16:48:17
drmeister
There is a script to run dtrace, another to prune the stacks
16:48:32
drmeister
If you want flame graphs clone this...
16:48:47
drmeister
https://github.com/brendangregg/FlameGraph
16:49:23
Bike
the only file in clasp/src/profiler is dot_sbclrc, it doesn't have any of those scripts you showed me.
16:49:38
drmeister
Ah - hang on - I may not have added them all
16:52:03
Bike
so you set clasp to compile, then run do-dtrace?
16:55:39
drmeister
Yes - timing is a bit tricky.
16:56:09
drmeister
There is a way with dtrace to start timing when one function enters and stop when another enters - we can explore that.
16:56:18
drmeister
I can get the sizes of symbols.
16:56:20
drmeister
https://www.irccloud.com/pastebin/IE3Ym7CN/
16:57:05
drmeister
It will take a little fancy footwork to get out just the functions I want.
16:57:59
drmeister
https://www.irccloud.com/pastebin/CWPnBi3p/
16:58:06
Bike
are those size zero ones inlined?
16:58:28
drmeister
Nothing is inlined here - I think they are external definitions.
16:58:42
drmeister
But the function sizes are there
16:58:48
drmeister
_INNER^^CORE_FN size: 544
16:58:56
drmeister
_FOO^^CORE_FN size: 672
16:59:13
drmeister
I think so - I have to go to a meeting - when I get back I can figure it out.
16:59:32
Bike
alright. well i think dtrace worked
17:10:56
Bike
well, just running it in sbcl instead of using the script works
17:14:15
Bike
the folded stack looks really wrong though
17:16:51
Bike
and results in a 29M svg, that's probably wrong
17:21:37
Bike
oh, no, i guess the format is correct: semicolon separated
18:56:13
drmeister
I'm back from another meeting.
18:56:22
drmeister
How is profiling going?
1:14:47
drmeister
Ok - I can get the size of COMPILE'd functions in bytes - but it's a bit weird. The easiest thing would be to maintain a global thread-safe hash table with :test #'equal within which I associate function symbol (linux symbols) names with function sizes.
1:15:15
drmeister
Then disassemble can reference this to get the length of a function that you are trying to disassemble.
1:15:29
drmeister
How does that sound?
1:16:46
drmeister
Basically - if you COMPILE a function and then DISASSEMBLE it - you will get the disassembly of the function. Anything not COMPILE'd will give you the first 16 instructions and then you can ask for more.
1:17:58
Bike
meaning, compile-file'd functions?
1:18:57
drmeister
I think maybe if you load the bitcode of compile-file'd functions you will get this info.
1:19:31
drmeister
I haven't tested this yet - we will find out soon enough.
2:55:33
beach
Good morning everyone!
3:35:05
drmeister
It looks like I stumbled onto a way to obtain the starting addresses of all jitted functions.
3:36:46
drmeister
So I should be able to generate a disassembly of every function associated with compilation of a form.
Thursday, 17th of August 2017, 4:34:53 UTC