* The status of statprof
@ 2013-09-17 12:37 Panicz Maciej Godek
2013-09-17 13:38 ` Ludovic Courtès
2013-09-17 18:03 ` Andy Wingo
0 siblings, 2 replies; 3+ messages in thread
From: Panicz Maciej Godek @ 2013-09-17 12:37 UTC (permalink / raw)
To: guile-user@gnu.org, rlb
[-- Attachment #1: Type: text/plain, Size: 835 bytes --]
Hi,
I've been trying to run the statprof that's
shipped with guile-2.0 with the following
code, but it reports "no samples taken".
The issue started with another project that
I wanted to profile, and there it worked, but
didn't count the calls (reported 0 to all of them).
So I decided to see that for the simplest case,
but apparently the simplest case doesn't work
(perhaps due to some optimizations). So my
question is: what is the status of the statprof
Is it maintained, or has it been abandoned,
or are there any additional tricks to get it
right? Here's the code:
(use-modules (statprof))
(define (increase x)
(sleep 1)
(1+ x))
(begin
(statprof-reset 0 500 #t)
(statprof-start)
(let loop ((i 0))
(if (< i 10)
(loop (increase i))
i))
(statprof-stop)
(statprof-display))
;; Best regards,
;; M.
[-- Attachment #2: Type: text/html, Size: 1290 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: The status of statprof
2013-09-17 12:37 The status of statprof Panicz Maciej Godek
@ 2013-09-17 13:38 ` Ludovic Courtès
2013-09-17 18:03 ` Andy Wingo
1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2013-09-17 13:38 UTC (permalink / raw)
To: guile-user
Panicz Maciej Godek <godek.maciek@gmail.com> skribis:
> I've been trying to run the statprof that's
> shipped with guile-2.0 with the following
> code, but it reports "no samples taken".
That probably means that the code being profiled runs too fast compared
to the sample rate.
The ‘with-statprof’ macro allows you to specify a sample rate, and
whether/how many times you want to run its body in a loop (info "(guile)
Statprof").
HTH,
Ludo’.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: The status of statprof
2013-09-17 12:37 The status of statprof Panicz Maciej Godek
2013-09-17 13:38 ` Ludovic Courtès
@ 2013-09-17 18:03 ` Andy Wingo
1 sibling, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2013-09-17 18:03 UTC (permalink / raw)
To: Panicz Maciej Godek; +Cc: guile-user@gnu.org, rlb
On Tue 17 Sep 2013 14:37, Panicz Maciej Godek <godek.maciek@gmail.com> writes:
> So my question is: what is the status of the statprof?
It's fine :)
> (define (increase x)
> (sleep 1)
> (1+ x))
>
> (begin
> (statprof-reset 0 500 #t)
> (statprof-start)
> (let loop ((i 0))
> (if (< i 10)
> (loop (increase i))
> i))
> (statprof-stop)
> (statprof-display))
Statprof runs on SIGPROF ticks, driven by setitimer. These ticks run
after a constant amount of CPU time spent. Your test doesn't consume
any CPU time because it's sleeping, so no ticks get recorded.
Also note that using the "statprof" function is much easier.
Cheers,
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-09-17 18:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 12:37 The status of statprof Panicz Maciej Godek
2013-09-17 13:38 ` Ludovic Courtès
2013-09-17 18:03 ` Andy Wingo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).