lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Paul K
> Sent: zaterdag 6 april 2013 3:01
> To: Lua mailing list
> Subject: Re: question on debug hooks
> 
> Hi Thijs,
> 
> > Now when running with the different debug mask and count values I
> expected to see large differences in both counters. But there aren't.
> ...
> >   debug.sethook(hook, mask, count)
> 
> I think mask and count are mutually exclusive; in other words, if you
> have "c", 100, it doesn't mean that it will be called every 100th
> "call" event. I may be mistaken, but last time I checked, count
> behaves like a line event with a threshold.
> 
> So, sethook(hook, "r", 100) is the same as sethook(hook, "r"). If you
> want to get every Nth statement, then try sethook(hook, "", N):
> 
> test("", nil)
> test("", 100)
> test("", 1000)
> test("", 50000)
> 
> With		nil
>     loop count :	4036736
>     check count:	0
> With		100
>     loop count :	3575464
>     check count:	335199
> With		1000
>     loop count :	3100648
>     check count:	28017
> With		50000
>     loop count :	4043297
>     check count:	727
> 
> Paul.

Thx. Got it!