[m-dev.] for review: The first bit of deep profiling
Thomas Conway
conway at cs.mu.OZ.AU
Mon Sep 13 14:43:49 AEST 1999
On Mon, Sep 13, 1999 at 01:11:36PM EST, Fergus Henderson wrote:
> On 13-Sep-1999, Thomas Conway <conway at cs.mu.OZ.AU> wrote:
> >
> > Index: compiler/handle_options.m
> > ===================================================================
> > RCS file: /home/staff/zs/imp/mercury/compiler/handle_options.m,v
> > retrieving revision 1.77
> > diff -u -r1.77 handle_options.m
> > --- handle_options.m 1999/08/13 01:42:59 1.77
> > +++ handle_options.m 1999/08/27 00:20:17
> > @@ -356,6 +356,15 @@
> > []
> > ),
> >
> > + % Deep profiling requires `procid' stack layouts
> > + globals__io_lookup_bool_option(profile_deep, DeepProfiling),
> > + (
> > + { DeepProfiling = yes },
> > + globals__io_set_option(procid_stack_layout, bool(yes))
> > + ;
> > + { DeepProfiling = no }
> > + ),
>
> I think you could write that more simply as
>
> % Deep profiling requires `procid' stack layouts
> option_implies(profile_deep, procid_stack_layout, bool(yes)),
>
Fixed.
> > --- options.m 1999/08/13 01:43:07 1.267
> > +++ options.m 1999/08/27 00:20:27
> > @@ -1099,6 +1105,9 @@
> > map__set(OptionTable0, profile_time, bool(no), OptionTable1),
> > map__set(OptionTable1, profile_calls, bool(yes), OptionTable2),
> > map__set(OptionTable2, profile_memory, bool(yes), OptionTable).
> > +special_handler(deep_profiling, none, OptionTable0, ok(OptionTable)) :-
> > + map__set(OptionTable0, profile_time, bool(no), OptionTable1),
> > + map__set(OptionTable1, profile_deep, bool(yes), OptionTable).
>
> Shouldn't the `bool(no)' here be `bool(yes)'?
>
> Also, for consistency with the way the other --foo-profiling options are
> handled, and with the way that the --deep-profiling option is handled in
> scripts/parse_grade_options.sh-subr, you should set `profile_calls'
> and `profile_memory' to `bool(no)' here. Likewise the special_handlers for
> memory_profiling, call_profiling, and time_profiling should set
> `profile_deep' to `bool(no)'.
Fixed.
>
> (I notice that the new options are not yet documented, but I presume
> that will come as part of a later change?)
>
Yes. Once there is enough for it to actually do something....
--
Thomas Conway )O+ Every sword has two edges.
Mercurian <conway at cs.mu.oz.au>
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list