Peter Wang a87ee2a7a9 Use mmap for Boehm GC in threaded grades on Linux.
The glibc implementation of malloc (commonly used on Linux) can use sbrk
to acquire more memory, and so does Boehm GC in its default configuration
on Linux.  When both allocators are invoked simultaneously from different
threads then memory corruption may result.

configure.ac:
	Add --enable-gc-mmap option.

	Make --enable-gc-munmap imply --enable-gc-mmap.

	Detect mmap and set MR_HAVE_MMAP.

	Detect sbrk and set MR_HAVE_SBRK.

	On Linux (and potentially other platforms), build Boehm GC for
	threaded grades with -DUSE_MMAP if mmap was found.

Mmake.common.in:
	Add ENABLE_BOEHM_USE_MMAP.

runtime/mercury_conf.h.in:
	Add MR_HAVE_MMAP, although it is not used anywhere yet.

	Add MR_HAVE_SBRK.  It is only for used by the test program.

tests/hard_coded/Mmakefile:
tests/hard_coded/thread_sbrk.exp:
tests/hard_coded/thread_sbrk.exp2:
tests/hard_coded/thread_sbrk.m:
	Add test program.

NEWS:
	Announce changes.

(cherry picked from commit d63a294e1f)
2014-08-29 13:44:15 +10:00
2014-03-25 12:34:01 +11:00
2012-11-22 20:35:09 +00:00
2013-04-29 16:33:19 +10:00
2013-04-24 16:13:59 +10:00
2012-08-23 04:57:27 +00:00
2012-08-23 04:57:27 +00:00
2014-01-07 14:34:51 +11:00
2014-03-10 09:01:47 +11:00
2013-05-14 14:17:57 +10:00
2014-03-04 16:10:54 +11:00
2013-01-11 13:49:48 +11:00
2014-02-03 16:33:08 +11:00
2013-04-29 16:33:19 +10:00
2014-01-03 17:26:15 +11:00

Threadscope
===========

This file contains information about threadscope profiling for Mercury.

 1. Supported Systems.
 2. Threadscope Profiling Tools

NOTICE
------

ThreadScope support is currently broken and therefore unsupported.  We have
plans to fix it for a future release.


Supported Systems
-----------------

Threadscope uses the RDTSCP or RDTSC instructions found on some x86 and x86_64
processors to get fast, high precision timing information.  These instructions
read the time stamp counter (TSC), this is incremented for every clock cycle.
Processors must increment this at a constant rate, regardless of their power
state, (see /proc/cpuinfo for constant_tsc).

TSC must also be synchronised between processors in the same system, although
it may be possible to work around this, let me know if you have such a system
(See contact info).

AMD processors do not seem to store their clock frequency in their brand ID
string.  On these systems Theadscope profiles are not to scale since clock
counts cannot be converted into time in nanoseconds.  The threadscope profile
will count one nanosecond for each clock tick.

I have had success with the following processors:

    Intel Core2
    Intel Xeon CPU X5472 (in a dual socket system).

Processors that do not work correctly:

    AMD Athlon 64 X2 

Threadscope Profiling Tools
---------------------------

Mercury supports threadscope profiling.  See the profiling section in the user
guide. 

The Threadscope profiling tools are written in Haskell and are known to work
with GHC 6.10.  threadscope depends upon the following Haskell libraries:

    array
    binary
    containers
    filepath
    ghc-events
    gtk2hs
    mtl

Many of these will be provided with GHC or packaged for/by your operating
system.

ghc-events is not packaged by most operating systems at this stage, It can be
retrieved from hackage:

    http://hackage.haskell.org/package/ghc-events

threadscope itself can also be retrieved from hackage:

    http://hackage.haskell.org/package/threadscope

Information about how to install Haskell packages can be found here:

    http://haskell.org/haskellwiki/Cabal/How_to_install_a_Cabal_package

Description
No description provided
Readme MIT 145 MiB
Languages
Mercury 85.4%
C 8.7%
Shell 1.4%
Makefile 1%
JavaScript 1%
Other 2%