[m-dev.] Question about the current Mercury trace

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Sep 27 14:24:18 AEDT 2000


On 26-Sep-2000, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> P.S. Note that '--trace-decl' has three dashes and no spaces.  Also, beware
> that this is probably not a long term option, and is likely to be replaced
> by '--trace decl' which will imply '--trace deep'.

Yes, Mark and I have discussed this in the past, and in fact yesterday
I have implemented it. The diff follows in a separate message.

The new scheme does away with --trace-decl, and instead adds two new trace
levels, decl and decl_rep. The set of trace levels after my diff would be:

	none		- no trace events
	shallow		- only interface events (call, exit, redo, fail)
	deep		- call, exit, redo, fail, then, else, swtc, disj
	decl		- as deep, plus cond, nege, negs, negf
	decl_rep	- as decl, and also generate program representations

I have made trace_level an abstract data type, so new levels can be added
and old ones redefined easily.

> However, I'd argue that they are more generally useful, so they should
> be enabled by a separate option.  Or even better, they should be treated
> like REDO events, which are generated by default but can be disabled
> with the '--no-trace-redo' option.  So I propose we:
> 
> 	- by default generate COND, NEGE, NEGS and NEGF events whenever
> 	  internal events are generated;

There are two issues here. I think there should be a trace level that
is basically the current --trace deep plus these four events, while there
is also a case for retaining the functionality of the current --trace deep.
The question is which should be the default in debug grades.

The difference between --trace decl and the new grade would be that (a)
--trace decl reserves two stack slots for the declarative debugger, and (b)
it preserves the names of all variables, even those which are not live at
any event. The former should not be necessary any more, and the latter
difference could be erased by always keeping all variable names, since this
has no time cost and only a reasonably small space cost.

I think we should consider making the trace level with all the possible event
types (a version of --trace decl without the extra stack slots) the default,
but only after experiments to determine the space and time overheads, as
Fergus suggested. The simplest way to perform these experiments is to
implement the option requested by Erwan in some form.

I think probably the best form is a single string option, called e.g.
--suppress-events, which takes as its args a comma-separated list of
event names or event class names to suppress. This could replace
--no-trace-redo and --no-trace-internal, and I could implement it
in a couple of hours.

Comments?

Zoltan.
--------------------------------------------------------------------------
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