users-prolog
[Top][All Lists]
Advanced

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

profiling of gprolog code


From: Vitaly Lagoon
Subject: profiling of gprolog code
Date: Tue, 2 Jan 2001 22:45:35 +1100 (EST)

Hi again,

I'm wondering if there is any easy way to profile my code in
GNU-Prolog. I mean something that can at least count the number of
calls to each predicate. The ratio of fail/success would be also very
useful... Of course 'manual profiling' by maintaining global counters
and getting runtimes with 'statistics' is always an option... :-(

Are there any plans to integrate profiling facilities into future
releases? Or maybe there already exist some (yet undocumented)
features...

BTW, I'm not familiar with the GNU-Prolog scheme of assembly code
generation, but putting in the support for 'gprof' looks like a piece
of cake. That's how GCC (with -pg flag) does the counting of a number
of calls for a function foo():

foo:
        pushl %ebp
        movl %esp,%ebp
        subl $24,%esp
.data                           # This fragment does the counting
        .align 4                #
.LP1:                           #
        .long 0                 #
.text                           #
        movl $.LP1,%edx         #
        call mcount             #
        . . .

Any comments?

Vit



reply via email to

[Prev in Thread] Current Thread [Next in Thread]