mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-15 05:44:58 +00:00
e06fa4993d54a8e0604622d010c7cd094b51d2aa
5 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a70b59e83c |
Add a test to find the number of words needed to represent a
configure.in:
Add a test to find the number of words needed to represent a
synchronization term.
boehm_gc/gc.h:
fix a declaration by replacing the args () with (void).
boehm_gc/solaris_pthreads.c:
add a missing include
check the return values of pthread calls.
compiler/*.m:
Add handling for the new HLDS goal type par_conj.
Add handling for the four new LLDS instructions:
init_sync_term
fork
join_and_terminate
join_and_continue
compiler/code_info.m:
add a new alternative for slot_contents - sync_term.
compiler/handle_options.m:
add .par as part of the grade
compiler/hlds_goal.m:
add the new goal type par_conj.
compiler/instmap.m:
add instmap__unify which takes a list of instmaps
and abstractly unifies them.
add unify_instmap_delta which tajes two instmap deltas
and abstractly unifies them.
compiler/llds.m:
add the new llds instructions.
compiler/mode_info.m:
add par_conj as a lock reason.
library/Makefile:
work around a bug in the solaris version pthread.h
library/benchmarking.m:
reference the stack zones from the engine structure
rather than from global variables.
library/{nc,sp}_builtin.nl:
add an op declaration for &.
library/std_util.m:
change references to global variables to references inside
the engine structure.
runtime/Mmakefile:
add mercury_thread.{c,h}
add THREADLIBS to the libraries
runtime/*.{c,h}
Remove some old junk from the previous processes/shrd-mem
changes that found their way into the repository.
Add MR_ prefixes to lots of names.
runtime/mercury_context.c:
Add init_thread_stuff for creating and initializing a
context structure for the current thread.
runtime/mercury_context.h:
add a field to the mercury context which stores the thread id
of the thread where this context originated.
add various macros for implementing the new llds instructions.
runtime/mercury_engine.c:
initialize the engine structure, rather than a bunch of globals.
runtime/mercury_engine.h:
declare the mercury_engine structure.
runtime/mercury_regorder.h:
if MR_THREAD_SAFE, and there is at least one global register
then use mr0 as a pointer to the mercury engine structure.
scripts/init_grade_options.sh-subr
add thread_safe
scripts/mgnuc.in
add THREAD_OPTS
scripts/ml.in:
add THREAD_LIBS
|
||
|
|
6921e0e015 |
Add a `--debug' option for Mercury-level debugging
Estimated hours taken: 6 Add a `--debug' option for Mercury-level debugging using the trace-based debugger. scripts/init_grade_options.sh-subr: scripts/parse_grade_options.sh-subr: scripts/mgnuc.in: scripts/ml.in: compiler/options.m: compiler/handle_options.m: compiler/mercury_compile.m: Split the old `--debug' option into `--low-level-debug' (formerly the absence of -DSPEED, now handle by -DLOWLEVEL_DEBUG) and `--c-debug' (passes -g to C compiler). Delete the old `debug' grade. Add support for new options `--require-tracing' (makes --trace minimum equivalent to --trace interfaces, and passes -DMR_REQUIRE_TRACING to C compiler) `--stack-trace' (passes -DMR_STACK_TRACE to C compiler; actually this one was already supported) and `--debug' (implies previous two), with corresponding grade modifiers `.trace', `.strce', and `.debug'. Actually I think there's little point in specifying just one of `--require-tracing' and `--stack-trace' so for the moment I'm just providing `--debug': the code for the more fine-grained options and grade modifiers has been added but commented out. runtime/mercury_conf_param.h: Document the new configuration parameter MR_REQUIRE_TRACING and the existing but undocumented parameter MR_STACK_TRACE. runtime/mercury_grade.h: Include MR_REQUIRE_TRACING in the mangled grade identifier. compiler/globals.m: compiler/handle_options.m: compiler/options.m: Allow new tracing type `--trace default', and make it the default. This gets replaced with `full' if require_tracing is yes or `minimal' if require_tracing is no. Also `--trace minimum' gets replaced with `interface' if require_tracing is yes. doc/user_guide.texi: Document the new `--debug', `--low-level-debug', and `--c-debug' options. scripts/mgnuc.in: compiler/mercury_compile.m: doc/user_guide.texi: Change things so that `--c-debug' does not imply `--no-c-optimize'. configure.in: Add `-fomit-frame-pointer' to CFLAGS_FOR_GOTOS on alpha-*. Empirically, this seems to be needed, otherwise lots of the test cases fail when compiled with `--no-c-optimize'. (It might also be needed for other architectures, I don't know.) |
||
|
|
9261af2650 |
Fix the comment that said that this file was
Estimated hours taken: 0.1 init_grade_options.sh-subr: Fix the comment that said that this file was parse_grade_options.sh-subr. |
||
|
|
e6ac077bae |
Add support for memory profiling.
Estimated hours taken: 40 (+ unknown time by Zoltan)
Add support for memory profiling.
(A significant part of this change is actuallly Zoltan's work. Zoltan
did the changes to the compiler and a first go at the changes to the
runtime and library. I rewrote much of Zoltan's changes to the runtime
and library, added support for the new options/grades, added code to
interface with mprof, did the changes to the profiler, and wrote the
documentation.)
[TODO: add test cases.]
NEWS:
Mention support for memory profiling.
runtime/mercury_heap_profile.h:
runtime/mercury_heap_profile.c:
New files. These contain code to record heap profiling information.
runtime/mercury_heap.h:
Add new macros incr_hp_msg(), tag_incr_hp_msg(),
incr_hp_atomic_msg(), and tag_incr_hp_atomic_msg().
These are like the non-`msg' versions, except that if
PROFILE_MEMORY is defined, they also call MR_record_allocation()
from mercury_heap_profile.h to record heap profiling information.
Also, fix up the indentation in lots of places.
runtime/mercury_prof.h:
runtime/mercury_prof.c:
Added code to dump out memory profiling information to files
`Prof.MemoryWords' and `Prof.MemoryCells' (for use by mprof).
Change the format of the `Prof.Counts' file so that the
first line says what it is counting, the units, and a scale
factor. Prof.MemoryWords and Prof.MemoryCells can thus have
exactly the same format as Prof.Counts.
Also cleaned up the interface to mercury_prof.c a bit, and did
various other minor cleanups -- indentation changes, changes to
use MR_ prefixes, additional comments, etc.
runtime/mercury_prof_mem.h:
runtime/mercury_prof_mem.c:
Rename prof_malloc() as MR_prof_malloc().
Rename prof_make() as MR_PROF_NEW() and add MR_PROF_NEW_ARRAY().
runtime/mercury_wrapper.h:
Minor modifications to reflect the new interface to mercury_prof.c.
runtime/mercury_wrapper.c:
runtime/mercury_label.c:
Rename the old `-p' (primary cache size) option as `-C'.
Add a new `-p' option to disable profiling.
runtime/Mmakefile:
Add mercury_heap_profile.[ch].
Put the list of files in alphabetical order.
Delete some obsolete stuff for supporting `.mod' files.
Mention that libmer_dll.h and libmer_globals.h are
produced by Makefile.DLLs.
runtime/mercury_imp.h:
Mention that libmer_dll.h is produced by Makefile.DLLs.
runtime/mercury_dummy.c:
Change a comment to refer to libmer_dll.h rather than
libmer_globals.h.
compiler/llds.m:
Add a new field to `create' and `incr_hp' instructions
holding the name of the type, for heap profiling.
compiler/unify_gen.m:
Initialize the new field of `create' instructions with
the appropriate type name.
compiler/llds_out.m:
Output incr_hp_msg() / tag_incr_hp_msg() instead of
incr_hp() / tag_incr_hp().
compiler/*.m:
Minor changes to most files in the compiler back-end to
accomodate the new field in `incr_hp' and `create' instructions.
library/io.m:
Add `io__report_full_memory_stats'.
library/benchmarking.m:
Add `report_full_memory_stats'. This uses the information saved
by runtime/mercury_heap_profile.{c,h} to print out a report
of memory usage by procedures and by types.
Also modify `report_stats' to print out some of that information.
compiler/mercury_compile.m:
If `--statistics' is enabled, call io__report_full_memory_stats
at the end of main/2. This will print out full memory statistics,
if the compiler was compiled with memory profiling enabled.
compiler/options.m:
compiler/handle_options.m:
runtime/mercury_grade.h:
scripts/ml.in:
scripts/mgnuc.in:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Add new option `--memory-profiling' and new grade `.memprof'.
Add `--time-profiling' as a new synonym for `--profiling'.
Also add `--profile-memory' for more fine-grained control:
`--memory-profiling' implies both `--profile-memory' and
`--profile-calls'.
scripts/mprof_merge_runs:
Update to handle the new format of Prof.Counts and to
also merge Prof.MemoryWords and Prof.MemoryCells.
profiler/options.m:
profiler/mercury_profile.m:
Add new options `--profile memory-words' (`-m'),
`--profile memory-cells' (`-M') and `--profile time' (`-t').
Thes options make the profiler select a different count file,
Prof.MemoryWords or Prof.MemoryCells instead of Prof.Counts.
specific to time profiling.
profiler/read.m:
profiler/process_file.m:
profiler/prof_info.m:
profiler/generate_output.m:
Update to handle the new format of the counts file.
When reading the counts file, look at the first line of
the file to determine what is being profiled.
profiler/globals.m:
Add a new global variable `what_to_profile' that records
what is being profiled.
profiler/output.m:
Change the headings to reflect what is being profiled.
doc/user_guide.texi:
Document memory profiling.
Document new options.
doc/user_guide.texi:
compiler/options.m:
Comment out the documentation for `.proftime'/`--profile-time',
since doing time and call profiling seperately doesn't work,
because the code addresses change when you recompile with a
different grade. Ditto for `.profmem'/`--profile-memory'.
Also comment out the documentation for
`.profcalls'/`--profile-calls', since it is redundant --
`.memprof' produces the same information and more.
configure.in:
Build a `.memprof' grade. (Hmm, should we do this only
if `--enable-all-grades' is specified?)
Don't ever build a `.profcalls' grade.
|
||
|
|
eb7bcf0fd9 |
Change mgnuc and ml to support the same
compilation model options as mmc. Allow the user to mix `--grade foo' options with other options that affect the grade such as `--profiling'. Compute the final grade to link with from the options. Also add a few new options and grade modifiers. compiler/options.m: compiler/mercury_compile.m: Add `--profile-time' and `--profile-calls' options. Change `--profiling' to now just imply both of those. Add `--pic-reg' option (just implies `-DPIC_REG' in cflags). compiler/handle_options.m: Add support for grade modifiers `.proftime' and `.profcalls'. Make `.debug' a grade modifier, rather than having a base grade `debug'. scripts/init_grade_options.sh-subr: scripts/parse_grade_options.sh-subr: New files containing sh subroutines for parsing grade-related options. configure.in: bindist/bindist.configure.in: Use AC_SUBST_FILE to allow #inclusion of the above-mentioned `.sh-subr' files. scripts/ml.in: scripts/mgnuc.in: Use the above-mentioned sh subroutines. scripts/ml.in: compiler/mercury_compile.m: compiler/handle_options.m: Compute the final grade to link with from the various grade-related options. scripts/mgnuc.in: Support the `--inline-alloc' option. doc/user_guide.texi: README.Linux: Document the above changes. |