Re: LuaJIT 2.1 profiler from C/C++

  • From: rippel tippel <rippeltippel@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 15 Nov 2013 13:21:40 +0000

Hi Mike,

Thank you for your prompt reply, I got the profiler working : )

However I don't see any information on how much time has been spent
inside each function; what's the best way to retrieve this from the C
API? (I guess it could be worked out from the number of samples and
the sampling interval, but not sure if it's correct/reliable).

Also, in case the depth is > 1, how is it possible to format the
output in a tree-like fashion, or print levels? It looks like I can
only append symbols at the end of luaJIT_profile_dumpstack's output
string.

Many thanks,
Rippel

On Thu, Nov 14, 2013 at 5:19 PM, Mike Pall <mike-1311@xxxxxxxxxx> wrote:
> rippel tippel wrote:
>> My workflow is start() - dump() - stop() , leaving enough time
>> (several seconds) between these calls. However
>> luaJIT_profile_dumpstack() always returns NULL. Am I missing
>> something?
>
> luaJIT_profile_dumpstack() is supposed to be called from the
> profiler callback, passing the state you received as an argument.
> And the profiler callback only gets called if you actually execute
> Lua code.
>
> --Mike
>

Other related posts: