54 Commits

Author SHA1 Message Date
Zoltan Somogyi
3dd0f2e03b Act on all remaining warnings about unused state vars.
compiler/add_heap_ops.m:
compiler/check_import_accessibility.m:
compiler/comp_unit_interface.m:
compiler/convert_import_use.m:
compiler/deforest.m:
compiler/dep_par_conj.m:
compiler/distance_granularity.m:
compiler/equiv_type.m:
compiler/generate_dep_d_files.m:
compiler/generate_mmakefile_fragments.m:
compiler/get_dependencies.m:
compiler/grab_modules.m:
compiler/higher_order.specialize_unify_compare.m:
compiler/jumpopt.m:
compiler/layout_out.m:
compiler/lco.m:
compiler/live_vars.m:
compiler/liveness.m:
compiler/llds_out_file.m:
compiler/make.build.m:
compiler/make.get_module_dep_info.m:
compiler/make.library_install.m:
compiler/make.module_target.m:
compiler/make.program_target.m:
compiler/make.track_flags.m:
compiler/make_hlds_passes.m:
compiler/make_module_file_names.m:
compiler/mercury_compile_front_end.m:
compiler/mercury_compile_llds_back_end.m:
compiler/mercury_compile_main.m:
compiler/mercury_compile_middle_passes.m:
compiler/ml_call_gen.m:
compiler/ml_closure_gen.m:
compiler/ml_code_gen.m:
compiler/ml_code_util.m:
compiler/ml_disj_gen.m:
compiler/ml_elim_nested.m:
compiler/ml_foreign_proc_gen.m:
compiler/ml_lookup_switch.m:
compiler/ml_switch_gen.m:
compiler/ml_unify_gen_deconstruct.m:
compiler/ml_unify_gen_test.m:
compiler/mlds_to_c_file.m:
compiler/mlds_to_target_util.m:
compiler/module_cmds.m:
compiler/opt_deps_spec.m:
compiler/optimize.m:
compiler/parse_dcg_goal.m:
compiler/parse_goal.m:
compiler/parse_item.m:
compiler/parse_module.m:
compiler/parse_string_format.m:
compiler/proc_gen.m:
compiler/prop_mode_constraints.m:
compiler/rbmm.points_to_analysis.m:
compiler/rbmm.region_analysis.m:
compiler/rbmm.region_transformation.m:
compiler/simplify_goal_disj.m:
compiler/ssdebug.m:
compiler/stack_opt.m:
compiler/string_switch.m:
compiler/switch_gen.m:
compiler/term_constr_build.m:
compiler/trace_gen.m:
compiler/tupling.m:
compiler/untupling.m:
compiler/write_deps_file.m:
deep_profiler/autopar_calc_overlap.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/html_format.m:
deep_profiler/startup.m:
profiler/mercury_profile.m:
profiler/propagate.m:
    Act on the new warnings. In a few cases, conform to the changes
    resulting from acting on the warnings in other modules.

browser/Mercury.options:
compiler/Mercury.options:
library/Mercury.options:
mdbcomp/Mercury.options:
ssdb/Mercury.options:
    Specify options for disabling the new warnings for modules
    where we (probably) won't want them.

configure.ac:
    Require the installed compiler to understand the options that
    we now reference in the Mercury.options files above.

tests/debugger/tailrec1.exp:
    Expect variable names for the middle versions of state vars
    using the new naming scheme.

tests/invalid/Mercury.options:
    Fix references to obsolete test names.

tests/warnings/Mercury.options:
    Avoid a test failure with intermodule optimization.
2025-05-19 00:33:06 +10:00
Zoltan Somogyi
a92ae7d9bd Update copyright notices. 2025-01-24 13:38:10 +11:00
Zoltan Somogyi
dcf48e2315 Add a new option, --warn-unsorted-import-blocks.
compiler/options.m:
doc/user_guide.texi:
NEWS.md:
    Add, document and announce the new option. It is off by default,
    but of course I tested its behavior when turned on. Most of this
    diff deals with the consequences.

compiler/item_util.m:
    Add code to generate the new warnings if requested.

compiler/convert_parse_tree.m:
    Request the new warning if the new option is set when processing
    source files..

compiler/handle_options.m:
    Disable all style warnings, including the new one, when generating
    .int* files or .*opt files.

compiler/mercury_compile_main.m:
    Fix an unrelated bug I noticed while working on this diff:
    report the "unfindability" of a given file at most once.

browser/dl.m:
browser/io_action.m:
compiler/mercury_compile_augment.m:
compiler/mercury_compile_llds_back_end.m:
compiler/unused_args.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/dump.m:
deep_profiler/html_format.m:
deep_profiler/mdprof_create_feedback.m:
deep_profiler/profile.m:
deep_profiler/read_profile.m:
deep_profiler/recursion_patterns.m:
deep_profiler/var_use_analysis.m:
library/array2d.m:
library/bit_buffer.read.m:
library/construct.m:
library/edit_distance.m:
library/library.m:
library/mercury_term_lexer.m:
library/one_or_more_map.m:
library/private_builtin.m:
library/set_bbbtree.m:
library/string.parse_runtime.m:
library/thread.future.m:
library/univ.m:
library/version_array.m:
library/version_bitmap.m:
mdbcomp/program_representation.m:
profiler/call_graph.m:
profiler/demangle.m:
profiler/output.m:
profiler/process_file.m:
profiler/propagate.m:
slice/mdice.m:
slice/mslice.m:
    Fix unsorted import blocks pointed out by the new option.

tests/invalid/ambiguous_overloading_error.err_exp:
tests/invalid/bad_tscp.err_exp:
tests/invalid/bug10.err_exp:
tests/invalid/gh72_errors.err_exp:
tests/invalid/ho_default_func_2.err_exp:
tests/invalid/require_scopes.err_exp:
tests/invalid/type_error_use_module.err_exp:
tests/invalid/types.err_exp:
tests/invalid_nodepend/errors_2.err_exp:
tests/invalid_nodepend/funcs_as_preds.err_exp:
tests/warnings/ambiguous_overloading.err_exp:
tests/warnings/save.err_exp:
tests/warnings/singleton_test.err_exp:
tests/warnings/unused_interface_import.err_exp:
    Update the expected outputs of these test cases to expect the new warning
    for unsorted import blocks in their source files.

tests/invalid/Mercury.options:
tests/invalid_nodepend/Mercury.options:
tests/warnings/Mercury.options:
    Execute those test cases with the warning enabled.

tests/invalid_nodepend/require_tailrec_invalid.m:
tests/invalid_nodepend/specified.m:
tests/recompilation/pragma_type_spec_r.m.1:
tests/recompilation/type_qual_re.m.1:
tests/recompilation/type_qual_re_2.m.1:
tests/recompilation/type_spec_unname_var_r.m.1:
tests/recompilation/type_spec_unname_var_r_2.m.1:
tests/recompilation/type_spec_unname_var_r_2.m.2:
tests/recompilation/unchanged_pred_nr.m.1:
tests/recompilation/with_type_re.m.1:
    Sort the import blocks in these test cases, and where relevant,
    import only one module per line.

tests/recompilation/with_type_re.err_exp.2:
    Expect updated line numbers after splitting a line that imported
    two modules.

tests/warnings/unsorted_import_blocks.{m,err_exp}:
    New test case to exercise one nontrivial part of the sortedness check,
    numerical non-sortedness. (The other affected test cases already exercise
    all the other parts.)

tests/warnings/Mmakefile:
    Enable the new test case.
2025-01-21 19:19:33 +11:00
Julien Fischer
2424d820f0 Update copyright notices in deep_profiler.
deep_profiler/*.m:
    As above.
2024-12-22 21:33:06 +11:00
Zoltan Somogyi
255835ce2a Make a zero-width space <wbr>, not <wbr />. 2022-03-23 06:43:25 +11:00
Zoltan Somogyi
943220205d Avoid using unknown formats.
deep_profiler/measurement_units.m:
    When writing out floats with given numbers of decimal places
    after the dot, use fixed format strings that the compiler can check.

deep_profiler/Mercury.options:
    Stop specifying --no-warn-unknown-format-calls for measurement_units.m.

deep_profiler/display.m:
deep_profiler/display_report.m:
    Conform to the change in measurement_units.m.

deep_profiler/html_format.m:
    Style fix.
2021-07-31 16:53:52 +10:00
Zoltan Somogyi
95f8f56716 Delete unneeded $module args from calls to expect/unexpected. 2019-07-03 22:37:19 +02:00
Zoltan Somogyi
9095985aa8 Fix more warnings from --warn-inconsistent-pred-order-clauses.
deep_profiler/*.m:
    Fix inconsistencies between (a) the order in which functions and predicates
    are declared, and (b) the order in which they are defined.

    In most modules, either the order of the declarations or the order
    of the definitions made sense, and I changed the other to match.
    In some modules, neither made sense, so I changed *both* to an order
    that *does* make sense (i.e. it has related predicates together).

    In query.m, put the various commands in the same sensible order
    as the code processing them.

    In html_format.m, merge two exported functions together, since
    they can't be used separately.

    In some places, put dividers between groups of related
    functions/predicates, to make the groups themselves more visible.

    In some places, fix comments or programming style.

deep_profiler/DEEP_FLAGS.in:
    Since all the modules in this directory are now free from any warnings
    generated by --warn-inconsistent-pred-order-clauses, specify that option
    by default in this directory to keep it that way.
2017-04-30 15:48:13 +10:00
Zoltan Somogyi
28f2f7f807 Make some previously incomplete switches complete.
All of these places were pointed out by the new --inform-incomplete-switch
option.

compiler/add_pred.m:
compiler/goal_form.m:
compiler/intermod.m:
compiler/ml_elim_nested.m:
compiler/post_term_analysis.m:
compiler/prog_mode.m:
compiler/prog_type.m:
compiler/unneeded_code.m:
compiler/var_locn.m:
    As above. In some cases, this meant adding the missing cons_ids
    with a simple `fail' as the goal. In other cases, it meant adding
    comments on the `fail'. In yet other cases, it involved replacing
    semidet predicates with functions returning bools.

    In a few places, the code for the previously-missing cons_id
    throws an exception.

    In prog_mode.m and var_locn.m, the code for some previously-missing
    cons_ids is neither `fail' nor an abort, but code that does the actual
    job of the predicate it is in. In these cases, the fact that this code
    was previously missing seems to have been a bug.

compiler/lp_rational.m:
    Delete unnecessary module qualification on pred and func declarations.
    Fix some comments.

compiler/rtti_to_mlds.m:
deep_profiler/html_format.m:
    Fix some comments.
2017-01-23 08:53:20 +11:00
Zoltan Somogyi
5890311825 Fix some unused predicate warnings.
browser/browse.m:
browser/declarative_edt.m:
compiler/continuation_info.m:
compiler/hlds_out_goal.m:
compiler/llds_out_file.m:
compiler/make.dependencies.m:
compiler/ml_closure_gen.m:
compiler/ml_elim_nested.m:
compiler/options_file.m:
compiler/prog_io_pragma.m:
deep_profiler/html_format.m:
    Delete some dead predicates that won't be needed anymore.

compiler/hlds_goal.m:
compiler/jumpopt.m:
    Comment out some dead predicates that may be needed later.

compiler/matching.m:
compiler/typecheck.m:
compiler/write_deps_file.m:
compiler/write_module_interface_files.m:
    Convert some dead predicates into live predicates by adding calls to them
    at their intended call sites. In some cases the missing call was a sort-of
    bug (the code worked, but not as well as it should have). In others, the
    call was intended only for debugging, and the new call is in a trace scope
    that is disabled by default.

compiler/ml_foreign_proc_gen.m:
    Add an XXX comment about a dead procedure.
2015-12-06 09:49:53 +11:00
Zoltan Somogyi
270170416d Bring the style of deep_profiler/* up-to-date.
deep_profiler/*.m:
    Replace ( C -> T ; E ) if-then-elses with (if C then T else E ).

    Replace calls to error/1 with calls to unexpected/3.

    Add some module qualifications where this makes the code easier to read.
2015-07-15 15:30:22 +02:00
Zoltan Somogyi
58d29651c1 Warn about unknown format strings in the Mercury system.
*/*_FLAGS.in:
    Specify that by default, the compiler should generate warnings
    for unknown format strings and bad known format strings.

*/Mercury.options:
    Override this default setting for a few modules that have legitimate
    reasons for calling e.g. string.format with unknown format strings.

compiler/fact_table.m:
deep_profiler/html_format.m:
    Minor changes to avoid calling string.format with unknown format strings.
2015-01-28 19:21:47 +11:00
Zoltan Somogyi
2d0bfc0674 The algorithm that decides whether the order independent state update
Estimated hours taken: 120
Branches: main

The algorithm that decides whether the order independent state update
transformation is applicable in a given module needs access to the list
of oisu pragmas in that module, and to information about the types
of variables in the procedures named in those pragmas. This diff
puts this information in Deep.procrep files, to make them available
to the autoparallelization feedback program, to which that algorithm
will later be added.

Compilers that have this diff will generate Deep.procrep files in a new,
slightly different format, but the deep profiler will be able to read
Deep.procrep files not just in the new format, but in the old format as well.

runtime/mercury_stack_layout.h:
	Add to module layout structures the fields holding the new information
	we want to put into Deep.procrep files. This means three things:

	- a bytecode array in module layout structures encoding the list
	  of oisu pragmas in the module;
	- additions to the bytecode arrays in procedure layout structures
	  mapping the procedure's variables to their types; and
	- a bytecode array containing the encoded versions of those types
	  themselves in the module layout structure. This allows us to
	  represent each type used in the module just once.

	Since there is now information in module layout structures that
	is needed only for deep profiling, as well as information that is
	needed only for debugging, the old arrangement that split a module's
	information between two structures, MR_ModuleLayout (debug specific
	info) and MR_ModuleCommonLayout (info used by both debugging and
	profiling), is no longer approriate. We could add a third structure
	containing profiling-specific info, but it is simpler to move
	all the info into just one structure, some of whose fields
	may not be used. This wastes only a few words of memory per module,
	but allows the runtime system to avoid unnecessary indirections.

runtime/mercury_types.h:
	Remove the type synonym for the deleted type.

runtime/mercury_grade.h:
	The change in mercury_stack_layout.h destroys binary compatibility
	with previous versions of Mercury for debug and deep profiling grades,
	so bump their grade-component-specific version numbers.

runtime/mercury_deep_profiling.c:
	Write out the information in the new fields in module layout
	structures, if they are filled in.

	Since this changes the format of the Deep.procrep file, bump
	its version number.

runtime/mercury_deep_profiling.h:
runtime/mercury_stack_layout.c:
	Conform to the change to mercury_stack_layout.h.

mdbcomp/program_representation.m:
	Add to module representations information about the oisu pragmas
	defined in that module, and the type table of the module.
	Optionally add to procedure representations a map mapping
	the variables of the procedure to their types.

	Rename the old var_table type to be the var_name_table type,
	since it contains just names. Make the var to type map separate,
	since it will be there only for selected procedures.

	Modify the predicates reading in module and procedure representations
	to allow them to read in the new representation, while still accepting
	the old one. Use the version number in the Deep.procrep file to decide
	which format to expect.

mdbcomp/rtti_access.m:
	Add functions to encode the data representations that this module
	also decodes.

	Conform to the changes above.

mdbcomp/feedback.automatic_parallelism.m:
	Conform the changes above.

mdbcomp/prim_data.m:
	Fix layout.

compiler/layout.m:
	Update the compiler's representation of layout structures
	to conform to the change to runtime/mercury_stack_layout.h.

compiler/layout_out.m:
	Output the new parts of module layout structures.

compiler/opt_debug.m:
	Allow the debugging of code referring to the new parts of
	module layout structures.

compiler/llds_out_file.m:
	Conform to the move to a single module layout structure.

compiler/prog_rep_tables.m:
	This new module provided mechanisms for building the string table
	and the type table components of module layouts. The string table
	part is old (it is moved here from stack_layout.m); the type table
	part is new.

	Putting this code in a module of its own allows us to remove
	a circular dependency between prog_rep.m and stack_layout.m;
	instead, both now just depend on prog_rep_tables.m.

compiler/ll_backend.m:
	Add the new module.

compiler/notes/compiler_design.html:
	Describe the new module.

compiler/prog_rep.m:
	When generating the representation of a module for deep profiling,
	include the information needed by the order independent state update
	analysis: the list of oisu pragmas in the module, if any, and
	information about the types of variables in selected procedures.

	To avoid having these additions increasing the size of the bytecode
	representation too much, convert some fixed 32 bit numbers in the
	bytecode to use variable sized numbers, which will usually be 8 or 16
	bits.

	Do not use predicates from bytecode_gen.m to encode numbers,
	since there is nothing keeping these in sync with the code that
	reads them in mdbcomp/program_representation.m. Instead, use
	new predicates in program_representation.m itself.

compiler/stack_layout.m:
	Generate the new parts of module layouts.

	Remove the code moved to prog_rep_tables.m.

compiler/continuation_info.m:
compiler/proc_gen.m:
	Make some more information available to stack_layout.m.

compiler/prog_data.m:
	Fix some formatting.

compiler/introduce_parallelism.m:
	Conform to the renaming of the var_table type.

compiler/follow_code.m:
	Fix the bug that used to cause the failure of the
	hard_coded/mode_check_clauses test case in deep profiling grades.

deep_profiler/program_representation_utils.m:
	Output the new parts of module and procedure representations,
	to allow the correctness of this change to be tested.

deep_profiler/mdprof_create_feedback.m:
	If we cannot read the Deep.procrep file, print a single error message
	and exit, instead of continuing with an analysis that will generate
	a whole bunch of error messages, one for each attempt to access
	a procedure's representation.

deep_profiler/mdprof_procrep.m:
	Give this program an option that specifies what file it is to
	look at; do not hardwire in "Deep.procrep" in the current directory.

deep_profiler/report.m:
	Add a report type that just prints the representation of a module.
	It returns the same information as mdprof_procrep, but from within
	the deep profiler, which can be more convenient.

deep_profiler/create_report.m:
deep_profiler/display_report.m:
	Respectively create and display the new report type.

deep_profiler/query.m:
	Recognize a query asking for the new report type.

deep_profiler/autopar_calc_overlap.m:
deep_profiler/autopar_find_best_par.m:
deep_profiler/autopar_reports.m:
deep_profiler/autopar_search_callgraph.m:
deep_profiler/autopar_search_goals.m:
deep_profiler/autopar_types.m:
deep_profiler/branch_and_bound.m:
deep_profiler/coverage.m:
deep_profiler/display.m:
deep_profiler/html_format.m:
deep_profiler/mdprof_test.m:
deep_profiler/measurements.m:
deep_profiler/query.m:
deep_profiler/read_profile.m:
deep_profiler/recursion_patterns.m:
deep_profiler/top_procs.m:
deep_profiler/top_procs.m:
	Conform to the changes above.

	Fix layout.

tests/debugger/declarative/dependency.exp2:
	Add this file as a possible expected output. It contains the new
	field added to module representations.
2012-10-24 04:59:55 +00:00
Paul Bone
4a8ff92940 Add extra data to the procedure report in the form of an extra row of data
in the table for the calls into the procedure from its parent call sites.
Note that since this report shows proc static data parent call sites are
defined as calls to the procedure from other procedures (they may include
mutual recursion).  As this may be a point of confusion this information is
only shown in developer mode.

report.m:
    As above.

    We also count the number of calls into this procedure, including the
    numbers of unique ProcStatic and ProcDynamic structures seen.
    The later is trivially the number of calls into the procedure.

create_report.m:
    Generate this data.

display_report.m:
    Handle the new report data.

display.m:
    So that we only show this table row in developer mode, add a new table
    row type (table_developer_row) that contains the real table row.

html_format.m:
    Handle the new table row type.
2012-10-20 12:17:16 +00:00
Julien Fischer
9ae7fe6b70 Change the argument ordering of predicates in the set module.
Branches: main

Change the argument ordering of predicates in the set module.

library/set.m:
	Change predicate argument orders to match the versions
	in the svset module.

	Group function definitions with the corresponding predicates
	rather than at the end of the file.

	Delete Ralph's comments regarding the argument order in the
	module interface: readers of the library reference guide are
	unlikely to be interested in his opinion of the argument ordering
	ten or so years ago.

	Add extra modes for set.map/3 and set.map_fold/5.

library/svset.m:
library/eqvclass.m:
library/tree234.m:
library/varset.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
mdbcomp/trace_counts.m:
extras/moose/grammar.m:
extras/moose/lalr.m:
extras/moose/moose.m:
tests/hard_coded/bitset_tester.m:
	Conform to the above change.

NEWS:
	Announce the above changes.
2011-05-06 05:03:29 +00:00
Julien Fischer
322e498a50 Change places where we create an empty map and the immediately do a det_insert
Branches: main

Change places where we create an empty map and the immediately do a det_insert
into it to use the recently added singleton map function.

compiler/add_pragma.m:
compiler/common.m:
compiler/dep_par_conj.m:
compiler/higher_order.m:
compiler/hlds_data.m:
compiler/inst_match.m:
compiler/lco.m:
compiler/modecheck_goal.m:
compiler/modules.m:
compiler/polymorphism.m:
compiler/pred_table.m:
compiler/rbmm.region_resurrection_renaming.m:
compiler/simplify.m:
compiler/stack_layout.m:
compiler/stack_opt.m:
compiler/stm_expand.m:
compiler/switch_util.m:
compiler/term_pass2.m:
compiler/tupling.m:
compiler/type_constraints.m:
compiler/type_ctor_info.m:
compiler/unneeded_code.m:
deep_profiler/autopar_search_callgraph.m:
deep_profiler/html_format.m:
	As above.
2011-05-05 06:39:37 +00:00
Julien Fischer
9f68c330f0 Change the argument order of many of the predicates in the map, bimap, and
Branches: main

Change the argument order of many of the predicates in the map, bimap, and
multi_map modules so they are more conducive to the use of state variable
notation, i.e. make the order the same as in the sv* modules.

Prepare for the deprecation of the sv{bimap,map,multi_map} modules by
removing their use throughout the system.

library/bimap.m:
library/map.m:
library/multi_map.m:
	As above.
NEWS:
	Announce the change.

	Separate out the "highlights" from the "detailed listing" for
	the post-11.01 NEWS.

	Reorganise the announcement of the Unicode support.

benchmarks/*/*.m:
browser/*.m:
compiler/*.m:
deep_profiler/*.m:
extras/*/*.m:
mdbcomp/*.m:
profiler/*.m:
tests/*/*.m:
ssdb/*.m:
samples/*/*.m
slice/*.m:
	Conform to the above change.

	Remove any dependencies on the sv{bimap,map,multi_map} modules.
2011-05-03 04:35:04 +00:00
Zoltan Somogyi
59b0edacbe New module for calculating the overlap between the conjuncts of a
Estimated hours taken: 2

deep_profiler/autopar_calc_overlap.m:
	New module for calculating the overlap between the conjuncts of a
	parallelised conjunction. Its contents are taken from the old
	autopar_search_callgraph.m.

deep_profiler/autopar_costs.m:
	New module for calculating the costs of goals. Its contents
	are taken from the old autopar_search_callgraph.m.

deep_profiler/autopar_reports.m:
	New module for creating reports. Its contents are taken from
	the old autopar_search_callgraph.m.

deep_profiler/autopar_search_goals.m:
	New module for searching goals for parallelizable conjunctions.
	Its contents are taken from the old autopar_search_callgraph.m.

deep_profiler/autopar_search_callgraph.m:
	Remove the code moved to other modules.

deep_profiler/mdprof_fb.automatic_parallelism.m:
	Add the new modules.

deep_profiler/*.m:
	Remove unnecessary imports.
	Fix copyright years on the new modules.

browser/*.m:
compiler/*.m:
mdbcomp/*.m:
	Remove unnecessary imports.

library/Mercury.options:
	Make it possible to compile a whole workspace with
	--warn-unused-imports by turning that option off for type_desc.m
	(which has a necessary import that --warn-unused-imports thinks
	is unused).
2011-01-27 08:03:54 +00:00
Zoltan Somogyi
8a28e40c9b Add the predicates sorry, unexpected and expect to library/error.m.
Estimated hours taken: 2
Branches: main

Add the predicates sorry, unexpected and expect to library/error.m.

compiler/compiler_util.m:
library/error.m:
	Move the predicates sorry, unexpected and expect from compiler_util
	to error.

	Put the predicates in error.m into the same order as their
	declarations.

compiler/*.m:
	Change imports as needed.

compiler/lp.m:
compiler/lp_rational.m:
	Change imports as needed, and some minor cleanups.

deep_profiler/*.m:
	Switch to using the new library predicates, instead of calling error
	directly. Some other minor cleanups.

NEWS:
	Mention the new predicates in the standard library.
2010-12-15 06:30:36 +00:00
Paul Bone
067934f008 Start using the new dynamic coverage information in the deep profiler.
This patch separates the coverage annotated procedure report into two
reports, one with dynamic coverage data and one with static coverage data.
This restores the functionality of the static coverage report since my last
change, and provides access to the dynamic report via new controls only
visible to developers.

deep_profiler/query.m:
    In the cmd data-type:

        Rename deep_cmd_procrep_coverage constructor to
        deep_cmd_static_procrep_coverage.

        Add deep_cmd_procrep_dynamic_coverage.

    In the preferences data-type:

        Add a new field pref_developer_mode which indicates if developer-only
        options are visible or not.

    Add code to parse and print the new command and preference option.

deep_profiler/create_report.m:
    Specialise create_procrep_coverage_report/3 into
    create_{static,dynamic}_coverage_report/4.

    Created a new exported function deep_get_maybe_procrep.  This is useful for
    getting a procedure representation from the deep data-structure in one
    step.

deep_profiler/display.m:
    Add a new display item, display_developer.  This wraps another display
    item but is only displayed when developer mode is active.

deep_profiler/display_report.m:
    Add a control to the main screen that enables or disabled developer mode.
    This control has been placed at the bottom of the screen so that it's out
    of the way.

    Put the developer controls on the main screen into their own list (there's
    only one at the moment).

    For now the coverage-annotated procedure representation link on a (static)
    procedure's page is not a developer option.  Should this be a developer
    option?

    Added a link to the dynamic coverage annotated procedure representation
    report from the dump proc dynamic report.

    Added a link to the clique dump report from the clique report, the dynamic
    coverage annotated procedure representation report can be accessed
    transitively through this link.

    Added a link the variable use analysis report and proc static report to the
    procedure report and static coverage annotated procedure representation
    report.

deep_profiler/html_format.m:
    Support the new display_developer item.

    Refactor the item_to_html code for lists.

deep_profiler/profile.m:
    Include a new field in the deep data-structure for storing coverage data
    that is indexed by a proc_static_ptr.  When dynamic coverage information is
    used this field is populated by adding per ProcDynamic data for each static
    procedure.

deep_profiler/startup.m:
    Fill in the per ProcStatic coverage data when the deep profiler starts up.

deep_profiler/measurements.m:
    Create a new data type static_coverage_info which represents per ProcStatic
    coverage information.

    Include functions that are used when calculating per ProcStatic coverage
    information from per ProcDynamic coverage information.

deep_profiler/mdprof_cgi.m:
    Remove rarely used command line option rather making it conform to changes
    in query.m.

deep_profiler/old_html_format.m:
deep_profiler/old_query.m:
    Conform to changes in query.m.

deep_profiler/mdprof_test.m:
deep_profiler/mdprof_fb.automatic_parallelism.m:
deep_profiler/recursion_patterns.m:
deep_profiler/var_use_analysis.m:
    Conform to changes in create_report.

deep_profiler/array_util.m:
    Add a new predicate, array_foldl3_from_1 to support propagation of coverage
    information from proc dynamics to proc statics.
2010-09-22 12:56:54 +00:00
Zoltan Somogyi
dd5de9e8e5 Add a query to the deep profiler for reporting on the getter and setter
Estimated hours taken: 12
Branches: main

Add a query to the deep profiler for reporting on the getter and setter
predicates in a module. This can be used to decide whether a data structure
should be split in two, and if so, which fields should go into the
substructure.

At the same time, improve the displays we generate for some other queries
by making more table column headers capable of sorting the table.

deep_profiler/query.m:
	Add the new query type.

deep_profiler/report.m:
	Add the definition of the new report.

	Include the identity of the callee, if known, in call site
	descriptions, to allow sorting on this.

deep_profiler/create_report.m:
	Add code to execute the new kind of query.

	Include the new field in call site descriptions.

	Remove "dump" from the name of the predicate that builds
	procrep_coverage reports, since the result isn't a raw dump.

deep_profiler/display_report.m:
	Add code to display the new kind of report.

	Add a link to the new report to display we generate for the module
	query.

	Allow the table in the procedure report to be sorted by context
	or by callee.

deep_profiler/display.m:
	Add a new table column class for displaying field names.

deep_profiler/html_format.m:
	Handle the new table column class.

deep_profiler/old_html_format.m:
deep_profiler/old_query.m:
	"Handle" the new query.
2009-01-02 02:59:36 +00:00
Zoltan Somogyi
3c9bd18619 Move old, now deprecated code from query.m and html_format.m to two new
Estimated hours taken: 1
Branches: main

deep_profiler/html_format.m:
deep_profiler/old_html_format.m:
deep_profiler/query.m:
deep_profiler/old_query.m:
	Move old, now deprecated code from query.m and html_format.m to two new
	modules: old_query.m and old_html_format.m. In each case, the leftover
	module, whose cord works via reports, is significantly smaller.

deep_profiler/measurement_units.m:
	Move some functions here from html_format.m, since they are needed
	with both the old and the new approaches, and the functions belong
	here.
2008-09-25 07:33:14 +00:00
Zoltan Somogyi
be95a5c643 Move the remaining deep profiler commands, dump_clique, clique and root,
Estimated hours taken: 20
Branches: main

Move the remaining deep profiler commands, dump_clique, clique and root,
to the report mechanism.

deep_profiler/report.m:
	Define the representation of the new reports.

	Change some names to be more consistent.

deep_profiler/create_report.m:
	Add code to create the new reports.

deep_profiler/measurement units.m:
	Add a predicate to needed by the root command.

deep_profiler/display_report.m:
	Add code for converting the new reports to displays.

	Factor out some previously duplicated code for describing procedures
	and call sites and for comparing them by name and by context.

	Conform to the changes in display.m.

deep_profiler/display.m:
	Expand the display representation to allow the specification of
	attributed text, with the available attributes being bold, italic
	and underlined. We now use bold in clique reports.

deep_profiler/html_format.m:
	Handle the changes in display.m.

	Generate HTML with more structured line breaks.

deep_profiler/query.m:
	Switch the default handling of the three commands over to the new
	mechanism.

	Remove a long unused function.

deep_profiler/profile.m:
	Parameterize the call_site_and_callee type, to allow report.m
	to associate a procedure description, not a proc_static_ptr,
	with a normal call site.
2008-09-25 03:47:03 +00:00
Paul Bone
cfe35c9cb7 Modify the deep profiling tools, in particular mdprof_cgi, to make use of
Estimated Hours Taken: 10
Branches: main

Modify the deep profiling tools, in particular mdprof_cgi, to make use of
program representation files, and begin implementing the procrep coverage
report.

The mdprof coverage report is incomplete, however it is convenient to post
this for review now.  Currently it can display a pretty-printed procrep
structure without coverage annotations.

mdbcomp/program_representation.m:
	Modified program representation data structures to allow goals to be
	annotated with another type.

deep_profiler/query.m:
	Create new deep profiling command, to display a coverage-annotated
	procedure representation.
	Support use of program representation information by new-style report
	generating code.
	Centralised command parsing to code within this module.
	Created constants for strings shared between cmd_to_string and
	string_to_maybe_cmd.

deep_profiler/report.m:
	Add new report, report_procrep_coverage_dump.
	Modified the proc_static dump report to include the number of coverage
	points in the proc_static.

deep_profiler/create_report.m:
	create_report now accepts an optional program representation structure,
	making it possible for report generation code to use the program
	representation structure.
	Support the new procrep coverage report, which is incomplete.
	Modify the proc static dump report, to display the number of coverage
	points within a proc_static structure.

deep_profiler/display.m:
	Introduce display_verbatim, a new display element that is able to display
	verbatim text, such as source code.

deep_profiler/display_report.m:
	Add support for displaying the new mdbcomp_coverage report.
	Modify the proc static dump display to show the number of coverage points,
	conforming to a change in report.m

deep_profiler/html_format.m:
	Support the display_verbatim element.
	Use query_to_string from query.m to create the query part of a URL.
	Conform to changes in deep_profiler/query.m

deep_profiler/startup.m:
	Modify read_and_startup to also read the program representation data if
	available.

deep_profiler/mdprof_cgi.m:
	Use string_to_maybe_query from query.m to parse a query string.
	Renamed some variables.
	Modified command-loop to pass program representation between commands.

deep_profiler/program_representation_utils.m:
	A new module to hold utilities from working with program representation
	data.
	Pretty printing code from mdprof_procrep has been moved here and modified
	to output a cord of strings rather than write to standard output.

deep_profiler/mdprof_feedback.m:
deep_profiler/mdprof_test.m:
	Conform to changes in query.m

deep_profiler/mdprof_procrep.m:
	Move proc_rep pretty-printing code to program_representation_utils.m

browser/declarative_tree.m:
	Conform to changes in mdbcomp/program_representation.m
2008-08-28 10:26:15 +00:00
Zoltan Somogyi
f637aa2458 Move three deep profiler commands to the new framework: the one that reports
Estimated hours taken: 16
Branches: main

Move three deep profiler commands to the new framework: the one that reports
all of a procedure's callers, the one that lists all the modules, and the one
that lists all the procedures in a module.

deep_profiler/report.m:
	Add report structures for the three newly handled commands.

	Modify the perf_row_data type to allow the representation of rows
	in which the self measures are meaningful, but the self_and_desc
	measures aren't, since this is true for module summaries.

	Remove a redundant field from an existing report structure.

deep_profiler/query.m:
	Change the cmd type slightly to (a) make command names more distinct,
	(b) make it less error prone by replacing ints with purpose-specific
	wrapper types, and (c) to specify whether contour exclusion should be
	applied in the proc_callers command. Change (c) is needed because
	we contour exclusion alters the report we want to generate for the
	proc_callers command, but we don't want to pass the preferences to the
	code that computes reports.

deep_profiler/create_report.m:
	Add code for computing the new report structures.

	Conform to the change to perf_row_data.

deep_profiler/display_report.m:
	Add code for displaying the new report structures.

	Conform to the change to perf_row_data.

deep_profiler/display.m:
	Avoid the need for a number-of-columns field in most table cells
	by having separate function symbols for single- and multi-column cells.

	Add a mechanism that allows us to avoid artifically nested lists
	(horizontal list inside a vertical list).

	Add the column classes needed by the newly implemented commands.

deep_profiler/html_format.m:
	Conform to the changes in display.m and query.m.

deep_profiler/profile.m:
	We used to read in the contour exclusion file just before computing
	and displaying a HTML page whose contents required it. We cannot do
	this with the report framework (since the predicate that computes
	report structures does not take I/O states as arguments), and it is
	better to read the contour exclusion file just once anyway. This diff
	therefore adds a field to the deep structure for holding the result
	of reading in the contour exclusion file (if any).

deep_profiler/startup.m:
	Add code to fill in this new field.

	Switch to using state variables.

deep_profiler/apply_exclusion.m:
	New module. It contains some code that used to be in query.m, but
	is now also needed by create_report.m, slightly modified. The
	modifications are to add some code that used to be in the callers
	of the moved predicates. This code used to be needed only once,
	but is now needed twice (since each predicate now has two callers).

	The reason why I didn't put all this into the existing exclude.m
	is that that would have required profile.m and exclude.m to import
	each other.

deep_profiler/exclude.m:
	Change the return value to separate the case of a non-existent contour
	exclusion file from a file that exists but whose reading yields an
	error.

	Give variables better names.

deep_profiler/mdprof_cgi.m:
deep_profiler/mdprof_test.m:
	Conform to the changes in query.m.

deep_profiler/apply_exclusion.m:
	New module. It contains some code that used to be in query.m, but
	is now also needed by create_report.m, slightly modified. The
	modifications are to add some code that used to be in the callers
	of the moved predicates. This code used to be needed only once,
	but is now needed twice (since each predicate now has two callers).

	The reason why I didn't put all this into the existing exclude.m
	is that that would have required profile.m and exclude.m to import
	each other.

deep_profiler/exclude.m:
	Give variables better names.

deep_profiler/measurements.m:
	Turn a semidet predicate into a function.
2008-08-25 07:19:39 +00:00
Zoltan Somogyi
599e1c2fdb Implement the proc command of the deep profiler using the report mechanism.
Estimated hours taken: 16
Branches: main

Implement the proc command of the deep profiler using the report mechanism.

Some of the detailed changes also address Paul's post-commit review of my
previous diff.

deep_profiler/report.m:
	Define the representation of the proc report.

	Change some names to be more consistent.

deep_profiler/profile.m:
	Add a type for use in report.m.

	Document the fields of an existing type.

deep_profiler/create_report.m:
	Add code to create proc reports.

	Change some names to be more consistent.

	Fix a bug: avoid divide by zero exceptions in some rare cases.

deep_profiler/measurement units.m:
	Fix a bug: avoid divide by zero exceptions in some rare cases.

deep_profiler/display_report.m:
	Add the code for converting proc reports to displays. This required
	rewriting almost everthing in this module to remove the assumption,
	which was previously embedded in many places, that the code is part
	of the implementation of the top_procs command. The new code is
	separated into two parts; the command-specific parts, and the parts
	that should be usable for all commands. (The reusable part is much
	bigger.)

deep_profiler/display.m:
	Expand the display representation to allow the specification of

	- plain text as distinguished from headings
	- paragraph breaks
	- pseudo-links, i.e. text fragments that are formatted like links
	- table separator rows
	- table cells that span more than one column

	which are used in the new version of display_report.m.

	Simplify the mechanism for setting up table header groups.

deep_profiler/html_format.m:
	Handle the changes in display.m.

	Fix some anomalies in the formatting of lists and tables.

	Group related code together.

deep_profiler/query.m:
	Provide a switch for selecting which of the two mechanisms,
	the old direct generation of HTML or the new indirect generation
	through the report and display structures, should generate the HTML
	page for a command that both mechanisms can implement. The default
	is the new mechanism, but it can be overridden by implementors
	by creating a file called "/tmp/old_deep_profiler".

	Switch the default handling of the proc command over to the new
	mechanism.

	Rename some types and function symbols to make them more consistent
	and expressive.

	Generate more informative error messages for domain error exceptions.

deep_profiler/mdprof_cgi.m:
	Add a mechanism for decoding the links in the generated pages.
	The mechanism takes the form of three new options: --decode,
	--decode-cmd, and --decode-prefs. When one or more of these are given,
	mdprof_cgi will not do its usual stuff, instead of just loops waiting
	for lines whose contents it will then try to decode as queries,
	as commands and/or as preferences.

deep_profiler/Mercury.options:
	Try to postpone thrashing in the deep compiler when compiled in
	debug grades, by compiling their contents with shallow tracing.

deep_profiler/array_util.m:
	Make shallow tracing effective by moving the deep recursions
	into non-exported predicates.

deep_profiler/callgraph.m:
deep_profiler/canonical.m:
deep_profiler/startup.m:
	Convert the debugging code to use trace goals.

deep_profiler/cliques.m:
deep_profiler/read_profile.m:
	Convert the debugging code to use trace goals.

	Use more expressive names for lots of variables.

	In read_profile.m, avoid an unnecessary repackaging of data.

deep_profiler/util.m:
	Fix some grammar errors in a comment, and comment some code to use
	state variables.

deep_profiler/interface.m:
	Fix some grammar errors in a comment.

deep_profiler/mdprof_feedback.m:
	Change some variable names to be consistent with the other modules.

library/float.m:
library/int.m:
	Make the messages in the domain errors we throw more expressive.

library/io.m:
	Minor style changes.
2008-08-18 02:14:59 +00:00
Zoltan Somogyi
73e383fd9f Implement the colouring of column groups.
Estimated hours taken: 5
Branches: main

Implement the colouring of column groups.

deep_profiler/display.m:
	Modify the types representing tables to allow some column groups
	to specify that the column classes they represent should affect the
	style in which that column is rendered. Refactor the table_header_group
	type to avoid representing this information, and the column class,
	in a redundant manner.

	Avoid abbrevations in some type names and function symbols.

deep_profiler/display_report.m:
	Conform to the change in the representation of tables.

	Use more consistent variable names.

deep_profiler/html_format.m:
	When a table column group's header asks for it, set up the background
	colour of the columns in that group so that alternating column groups
	have different backgrounds.

	Instead of representing the CSS as a single constant string, we
	now represent it as a map that we update from a default when we
	construct the body of the page.

	Implement Paul's review suggestions after my last change.

library/cord.m:
NEWS:
	Add a utility predicate for use by the new code.
2008-08-06 08:15:04 +00:00
Zoltan Somogyi
bbabcd8827 Add an identifying prefix to the function symbols of the table_data
Estimated hours taken: 0.1
Branches: main

deep_profiler/display.m:
	Add an identifying prefix to the function symbols of the table_data
	type to prevent confusion with the similar function symbols of the
	standard string.poly_type type.

deep_profiler/display_report.m:
deep_profiler/html_format.m:
	Conform to this change.
2008-08-06 03:02:47 +00:00
Zoltan Somogyi
a15bd7f16d Remove a now redundant copy of the title for top_procs pages.
Estimated hours taken: 0.1
Branches: main

deep_profiler/display_report.m:
	Remove a now redundant copy of the title for top_procs pages.

deep_profiler/html_format.m:
	Add more newlines to the output, in order to make it more readable.
2008-08-05 02:40:04 +00:00
Zoltan Somogyi
8f0ef48784 Use reports to handle the call_site_static and call_site_dynamic queries.
Estimated hours taken: 3
Branches: main

Use reports to handle the call_site_static and call_site_dynamic queries.

deep_profiler/report.m:
	Add the two new report types.

	Give a better name to a type.

deep_profiler/create_report.m:
	Add the code for the two new report types.

	Make the predicate for creating a perf_row_data more general,
	and avoid defining the perf_row_data field-by-field.

deep_profiler/display.m:
	Rename a table_class that is now used not just by the top_procs
	command.

	Represent columns as cords, to avoid the need for keeping track
	of whether the list of columns is reversed.

deep_profiler/display_report.m:
	Add the code to handle the two new report types.

	Refactor some existing code to allow it to called by the new code.

	Conform to the other changes in report.m.

deep_profiler/html_format.m:
	Add newlines to the output, in order to make it more readable
	and to make using diff between two versions of the output feasible.

	Print the HTML title as a heading.

	Add a XXX about a disrespected control.

deep_profiler/query.m:
	Use the new method to handle the two query types.
2008-08-05 00:54:18 +00:00
Zoltan Somogyi
3fc2b3f6b6 Use reports to handle the proc_static and proc_dynamic queries.
Estimated hours taken: 4
Branches: main

Use reports to handle the proc_static and proc_dynamic queries.

deep_profiler/report.m:
	Add the two new report types.

	Change the report type to give each query its own answer, without
	needing to use the report_message for reporting errors. Also, group
	each kind of report into a single data structure that can be
	manipulated independently of the other kinds of answers (like I did
	some time ago for items in the compiler.)

deep_profiler/create_report.m:
	Add the code for the two new report types.

	Conform to the other changes in report.m.

	Inline some unnecessary intermediate predicates.

deep_profiler/display.m:
deep_profiler/html_format.m:
	Rename one table_class that is now used not just by the menu command.

deep_profiler/display_report.m:
	Add the code to handle the two new report types.

	Refactor some existing code to allow it to called by the new code.

	Conform to the other changes in report.m.

	Fix several predicate names that would have become misleading as soon
	as we added new kinds of reports. The fix is to give them the prefix
	"top_procs_", since they all generate parts of top_procs pages.

deep_profiler/query.m:
	Use the new method to handle the two query types.
2008-08-04 08:50:04 +00:00
Zoltan Somogyi
03035ad2e6 Convert Paul's new code to use cords of strings to represent HTML.
Estimated hours taken: 6
Branches: main

Convert Paul's new code to use cords of strings to represent HTML.

deep_profiler/html_format.m:
	Convert to using cords. Restructure the code in a couple of places
	to always put start and end tags around HTML fragments together.

	Fix a missing "=" in a tag.

deep_profiler/interface.m:
deep_profiler/mdprof_cgi.m:
deep_profiler/read_profile.m:
	Provide better diagnostics.

deep_profiler/create_report.m:
deep_profiler/display.m:
deep_profiler/display_report.m:
deep_profiler/mdprof_feedback.m:
deep_profiler/measurement_units.m:
deep_profiler/query.m:
deep_profiler/report.m:
mdbcomp/feedback.m:
	Misc cleanups. They can be considered my post-commit review of Paul's
	diff.

	In mdprof_feedback.m, delete a strange test that prevented the program
	from being used from the command line.

deep_profiler/dump.m:
deep_profiler/mdprof_dump.m:
deep_profiler/timeout.m:
deep_profiler/util.m:
	Misc cleanups of old code.
2008-08-04 03:17:55 +00:00
Paul Bone
4a03798e3c Introduced intermediate data structures to mdprof_cgi.
Estimated Hours Taken: 60
Branches: main

Introduced intermediate data structures to mdprof_cgi.  This will make it
easier to extract deep profiling information for any new tools.  It also
enables other viewers for deep profiling data to more easily be developed.

New code making use of these data structures follows a pipeline pattern
as it is converted between the following data structures in this order:

	Deep -> Report -> Display -> HTML

This work is in progress and only a handful of deep profiler commands have
been converted to use the new data structures.  The old code has been kept for
reference and should be removed in the future.

deep_profiler/report.m:
	Created new module that defines a data structure for a deep profiler report.
	The new report data structure can be used to describe the content of a
	particular report.

deep_profiler/display.m:
	Created new module that defines a data structure for displaying deep
	profiler information.
	The new display data structure can be used to describe the structure and
	content shown when a user views a deep profiler report.

deep_profiler/measurement_units.m:
	Created new module defining data types to represent percentages, amounts
	of computer memory and time.

deep_profiler/query.m:
	Move memory_units type to data_types.m.
	Handling of the following deep profiler commands has been re-written to
	use the new data structures:
		deep_cmd_quit,
		deep_cmd_timeout,
		deep_cmd_restart,
		deep_cmd_menu,
		deep_cmd_top_procs

deep_profiler/create_report.m:
	Created new module for creating reports from the deep data structure.

deep_profiler/display_report.m:
	Created new module for converting a report structure to a display
	structure.

deep_profiler/html_format.m:
	Introduce new code to convert a display data structure into a string of
	HTML formatted text.
	Moved number formatting code to measurement_units.m.
2008-07-29 01:43:00 +00:00
Paul Bone
219724d9cb Tidying up some of the deep profiler tools code.
Estimated Hours Taken: 1
Branches: main

Tidying up some of the deep profiler tools code.  Moved data structures,
predicates and functions that are not specific to the mdprof_cgi program
from interface.m to other modules.

deep_profilier/query.m:
    Moved data structures from interface.m to query.m including the cmd and
    preferences data structures.
    Renamed functions to replace url_compoent with string.

deep_profilier/interface.m:
    Moved code from this module that doesn't relate to the mdprof_cgi
    program's client-server nature to query.m and html_format.m
    Conformed to predicate-renaming changes in query.m

deep_profilier/html_format.m:
    Moved machine_datafile_cmd_pref_to_url function to this module.
    Conform to changes in interface.m and query.m.

deep_profiler/top_procs.m:
    Conform to changes in interface.m and query.m.
2008-04-18 05:57:48 +00:00
Zoltan Somogyi
c2d33a29fc Make the output a bit easier to read by adding commas at every
Estimated hours taken: 0.1
Branches: main

deep_profiler/html_format.m:
	Make the output a bit easier to read by adding commas at every
	power of a thousand in call sequence number counts.
2007-07-02 10:04:07 +00:00
Peter Wang
229d9c9751 Add missing determinism declaration.
Branches: main

deep_profiler/html_format.m:
	Add missing determinism declaration.
2007-04-03 02:53:13 +00:00
Peter Wang
542ef5e612 Some interface improvements for mdprof_cgi.
Branches: main

Some interface improvements for mdprof_cgi.

deep_profiler/html_format.m:
deep_profiler/query.m:
	Insert "<WBR>" tags after some characters to suggest where the browser
	may break long module, procedure and file names over multiple lines.
	This improves the chances that tables will not become too wide to fit
	in the browser window.

	Add square brackets around the links at the bottom of generated pages,
	e.g. "[Sort by name]".  Give such links the CSS class "button" and add
	margins to increase visual separation between the links.

	Write the "Toggle fields:" etc. labels in bold to make them stand out,
	and add line breaks so that the first button after the label is easier
	to find (on the next line, at the the left margin).

	Spell out "self+descendants." rather than "self+desc."
2007-04-02 06:10:43 +00:00
Peter Wang
5ed14375b1 Respect the CGI environment variables SERVER_NAME, SERVER_PORT and
Branches: main

deep_profiler/conf.m:
deep_profiler/html_format.m:
deep_profiler/interface.m:
deep_profiler/mdprof_cgi.m:
deep_profiler/mdprof_feedback.m:
deep_profiler/mdprof_test.m:
deep_profiler/profile.m:
deep_profiler/startup.m:
	Respect the CGI environment variables SERVER_NAME, SERVER_PORT and
	SCRIPT_NAME.  This allows the mdprof_cgi to be used with any web
	server, on an arbitrary port, at any URL.
2007-04-02 02:42:33 +00:00
Julien Fischer
b4c3bb1387 Clean up in unused module imports in the Mercury system detected
Estimated hours taken: 3
Branches: main

Clean up in unused module imports in the Mercury system detected
by --warn-unused-imports.

analysis/*.m:
browser/*.m:
deep_profiler/*.m:
compiler/*.m:
library/*.m:
mdbcomp/*.m:
profiler/*.m:
slice/*.m:
	Remove unused module imports.

	Fix some minor departures from our coding standards.

analysis/Mercury.options:
browser/Mercury.options:
deep_profiler/Mercury.options:
compiler/Mercury.options:
library/Mercury.options:
mdbcomp/Mercury.options:
profiler/Mercury.options:
slice/Mercury.options:
	Set --no-warn-unused-imports for those modules that are used as
	packages or otherwise break --warn-unused-imports, e.g. because they
	contain predicates with both foreign and Mercury clauses and some of
	the imports only depend on the latter.
2006-12-01 15:04:40 +00:00
Zoltan Somogyi
c262737998 Include call sequence numbers in the pages generated by the deep profiler
Estimated hours taken: 16
Branches: main

Include call sequence numbers in the pages generated by the deep profiler
(if the user's preferences ask for this).

NEWS:
	Announce the new capability.

deep_profiler/measurements.m:
	Standardize on one spelling of call sequence numbers (callseqs).

	Add some utility predicates for use in dump.m.

	Fix a bug in the calculation of the number of calls: redos enter
	procedure invocations, not leave them.

deep_profiler/profile.m:
	Fix a bug: the num_callseqs field was in the wrong place.

deep_profiler/html_format.m:
	When generating a line of the clique description, include call sequence
	number information if requested.

	Do likewise when generating other HTML fragments that have to match
	the contents of those lines (e.g. the table headers).

	Generate the links that allow the users to sort rows by call
	sequence numbers.

	Generate the links that allow the users to toggle the switches
	controlling the display of call sequence number information.

	Do not show the toggles relevant to the display of times if times are
	not being displayed.

deep_profiler/interface.m:
	Extend the preferences to allow requests for call sequence number
	information.

	Include the display of call sequence numbers in the default set of
	preferences. However, include the display of time information in the
	default only of the profiling run lasted long enough for this
	information to have some hope of being useful.

	Rename some function symbols to avoid ambiguities.

deep_profiler/query.m:
	Extend the menu to include links for the most expensive
	cliques/procedures as measured by call sequence numbers.

	Include the links for the most expensive cliques/procedures as
	measured by clock ticks in the menu only if the profiling run
	lasted long enough for this to be useful.

	Print out the total number of call sequence numbers with the other
	statistics.

	Use call sequence numbers instead of time to decide where the "action"
	begins, since this works even for short profiling runs.

deep_profiler/top_procs.m:
	Provide the capability of sorting on call sequence numbers.

deep_profiler/dump.m:
	Provide the capability to dump out several more fields of the top level
	structure (profile.deep), including the cliques, the reverse links and
	the propagated measurement information.

deep_profiler/startup.m:
	Dump out the cliques, the reverse links and the propagated measurement
	information when computed.

deep_profiler/mdprof_cgi.m:
	Add an option for setting the hostname in the generated links to
	"localhost". This is useful on laptops temporarily disconnected
	from the Domain Name System (e.g. my laptop).

	Set this option automatically if the name of the file in the initial
	query has a ".localhost" suffix added to it.

	Add some tracing hooks.

deep_profiler/mdprof_test.m:
	Add an option to specify what info to dump during startup.

deep_profiler/mdprof_dump.m:
	Switch to using the compiler's method of specifying what to dump,
	since this is more maintainable.

deep_profiler/exclude.m:
	Rename some function symbols to avoid ambiguities.

deep_profiler/timeout.m:
	Add conditionally compiled code to help debug lock management.

deep_profiler/callgraph.m:
deep_profiler/canonical.m:
deep_profiler/cliques.m:
deep_profiler/conf.m:
deep_profiler/read_profile.m:
	Minor cleanups.
2006-10-12 06:30:23 +00:00
Zoltan Somogyi
4c12c286b9 Make use of 80 column width, and replace a couple of uses of DCGs with
Estimated hours taken: 0.1
Branches: main

deep_profiler/html_format.m:
	Make use of 80 column width, and replace a couple of uses of DCGs with
	state variables.
2006-10-04 07:03:54 +00:00
Julien Fischer
459847a064 Move the univ, maybe, pair and unit types from std_util into their own
Estimated hours taken: 18
Branches: main

Move the univ, maybe, pair and unit types from std_util into their own
modules.  std_util still contains the general purpose higher-order programming
constructs.

library/std_util.m:
	Move univ, maybe, pair and unit (plus any other related types
	and procedures) into their own modules.

library/maybe.m:
	New module.  This contains the maybe and maybe_error types and
	the associated procedures.

library/pair.m:
	New module.  This contains the pair type and associated procedures.

library/unit.m:
	New module. This contains the types unit/0 and unit/1.

library/univ.m:
	New module. This contains the univ type and associated procedures.

library/library.m:
	Add the new modules.

library/private_builtin.m:
	Update the declaration of the type_ctor_info struct for univ.

runtime/mercury.h:
	Update the declaration for the type_ctor_info struct for univ.

runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
	Update the definition of MR_Univ.

runtime/mercury_init.h:
	Fix a comment: ML_type_name is now exported from type_desc.m.

compiler/mlds_to_il.m:
	Update the the name of the module that defines univs (which are
	handled specially by the il code generator.)

library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
	Conform to the above changes.  Import the new modules where they
	are needed; don't import std_util where it isn't needed.

	Fix formatting in lots of modules.  Delete duplicate module
	imports.

tests/*:
	Update the test suite to confrom to the above changes.
2006-03-29 08:09:58 +00:00
Zoltan Somogyi
a9a2825ace Replace __ with . as the module qualifier everywhere in all the modules
Estimated hours taken: 0.5
Branches: main

profiler/*.m:
deep_profiler/*.m:
compiler/*.m:
	Replace __ with . as the module qualifier everywhere in all the modules
	of the profiler and deep profiler and in some modules of the compiler.
2006-03-09 04:56:47 +00:00
Julien Fischer
2c686ea193 Convert the rest of the deep profiler to four-space indentation.
Estimated hours taken: 1.5
Branches: main

Convert the rest of the deep profiler to four-space indentation.
There are no changes to any algorithms (other than introducing state
variables in a few spots).

Remove an old bug workaround.

deep_profiler/*.m:
	Convert to four-space indentation where that has not already
	been done.

	Fix some bad line breaks.

	Use state variables in a few places.

	Reposition comments according to our current coding standard.

deep_profiler/Mercury.options:
	Remove some old bug workarounds.
2005-11-08 08:12:40 +00:00
Julien Fischer
b59dc73825 Improvements to the deep profiling tool.
Estimated hours taken: 2
Branches: main, release

Improvements to the deep profiling tool.

Provide the facility to hide modules/procedures to which there have been no
calls.  This reduces the amount of clutter when exploring the program module
by module and when listing the procedures in a module (the clutter is
primarily a result of unused standard library modules).  By default, we
currently do not hide any modules/procedures.

Add a toggle to sort lists of procedures by the number of redos they perform.
We have had control at the head of tables to do this for a while now.

Delete the function int_list_from_to/2 since that functionality is now
available in the standard library.

deep_profiler/html_format.m:
	Provide toggles that allow the user to show/hide inactive modules and
	procedures.

	Add a toggle to sort lists of procedures by the number of redos.

	Rename a numbered sequence of variables so that it is easier to insert
	new ones in the middle of the sequence.

deep_profiler/interface.m:
	Add support for hiding/showing inactive modules.

	Clean up some of the existing code.

deep_profiler/measurements.m:
	Add a predicate, is_inactive/1, that test if an own_prof_info
	for a given entity is inactive.

deep_profiler/query.m:
	When generating the module and procedure summaries, respect the new
	preference settings for hiding/showing inactive modules/procedures.

deep_profiler/top_procs.m:
	Delete int_list_from_to/2 and replace calls to it with
	'..' from the standard library.
2005-08-24 07:04:57 +00:00
Julien Fischer
5bde1ac946 Add a control that allows procedures to be ordered by the
Estimated hours taken: 0.5
Branches: main, release

deep_profiler/html_format.m:
deep_profiler/interface.m:
deep_profiler/top_procs.m:
	Add a control that allows procedures to be ordered by the
	number of redos they execute.
2005-07-14 08:51:34 +00:00
Julien Fischer
bb67a2d90b Fix some problems in the deep profiling tool.
Estimated hours taken: 3.5
Branches: main, release

Fix some problems in the deep profiling tool.

deep_profiler/html_format.m:
	The control to view times was mislabeled as 'Ticks and times'.

	Update the number of columns used for displaying the port counts.
	Since (some) support for exceptions was added there are now five.
	This fixes a problem where the width of separator rows was incorrect.

	Avoid the division by zero that occurs when calculating the time-per-call
	and there have been zero calls.

deep_profiler/interface.m:
	Change the query separator character from '%' to '&'.  The former
	is used for encoding special characters in URLs and our usage of it
	causes problems for some web browsers.  In particular, this is
	necessary to get the deep profiling tool to work with Safari, which
	in turn is necessary for getting the deep profiler to work
	"out-of-the-box" on OS X.
2005-07-08 16:31:06 +00:00
Julien Fischer
4083fe5bf2 Cleanup the deep profiler.
Estimated hours taken: 1
Branches: main

Cleanup the deep profiler.
There are no changes to any algorithms.

deep_profiler/*.m:
	Switch to state variable notation throughout.  Rearrange
	the order of some procedure arguments to facilitate this.

	Remove some unnecessary module imports.

	Reformat comments according to our current coding standard.

	Update comments that refer to modules that no longer exist.
2005-06-23 08:21:29 +00:00
Julien Fischer
e78a24d969 Workaround a problem where the deep profiling tool wasn't
Estimated hours taken: 3
Branches: main, release

Workaround a problem where the deep profiling tool wasn't
escaping HTML special characters in procedure and file names.

deep_profiler/html_format.m:
deep_profiler/query.m:
	When generating HTML make sure to escape special
	characters, like '<', correctly.
2005-06-22 07:25:12 +00:00
Zoltan Somogyi
427169efb6 Minor cleanups.
Estimated hours taken: 1
Branches: main, release

deep_profiler/*.m:
	Minor cleanups.

deep_profiler/notes/deep_profiling.html:
	Bring the documentation of the deep profiler up to date.
2005-04-25 07:55:58 +00:00