[m-rev.] for review: ThreadScope changes

Julien Fischer jfischer at opturion.com
Wed Jun 4 10:29:04 AEST 2014


Hi,

On Fri, 30 May 2014, Paul Bone wrote:

> ThreadScope changes
>
> runtime/mercury_par_profile.c:
> runtime/mercury_par_profile.h:
>    Update comments in these files to Describe the origin of this code and

s/Describe/describe/

>    that it is no-longer intended to be compatible with ThreadScope.
>
> runtime/mercury_context.c:
>    Fix a bug where the incorrect C macro was used to conditionally compile
>    the logging of a parallel profiling event.
>
> library/benchmarking.m:
>    Deprecate log_threadscope_message/3 in favor of the new predicate
>    log_parprof_message/3.

I think you can probably just delete it now; I would be surprised if it
has ever had any users except yourself.

...

> %-----------------------------------------------------------------------------%
> diff --git a/runtime/mercury_context.c b/runtime/mercury_context.c
> index 9d40f4b..c490713 100644
> --- a/runtime/mercury_context.c
> +++ b/runtime/mercury_context.c
> @@ -1551,7 +1551,7 @@ MR_schedule_context(MR_Context *ctxt)
>
>     notify_context_data.MR_ewa_context = ctxt;
>
> -#ifdef MR_PROFILE_PARALLEL_EXECUTION_SUPPORT
> +#ifdef MR_PARPROF

I would prefer the macro name to be MR_PARALLEL_PROFILING

>     MR_parprof_post_context_runnable(ctxt);
> #endif
>
> diff --git a/runtime/mercury_par_profile.c b/runtime/mercury_par_profile.c
> index e0be235..fb787ca 100644
> --- a/runtime/mercury_par_profile.c
> +++ b/runtime/mercury_par_profile.c
> @@ -2,7 +2,7 @@
> ** vim: ts=4 sw=4 expandtab
> */
> /*
> -** Copyright (C) 2009-2011,2013 The University of Melbourne.
> +** Copyright (C) 2009-2011,2013-2014 The University of Melbourne.
> ** Copyright (C) 2008-2009 The GHC Team.
> **
> ** This file may only be copied under the terms of the GNU Library General
> @@ -10,6 +10,24 @@
> */
>
> /*
> +** mercury_par_profile.c - defines Mercury parallel profiling support.
> +**
> +** The code in this file and mercury_par_profile.h was originally designed
> +** to be compatible with ThreadScope, see:
> +**
> +**   + Don Jones Jr, Simon Marlow and Satnam Singh: Parallel Preformance
> +**     Tuning for Haskell.
> +**
> +**   + Paul Bone and Zoltan Somogyi: Profiling parallel Mercury programs
> +**     with ThreadScope.
> +**
> +** Maintaining compatibility with ThreadScope has been problematic, we no
> +** longer support compatibility with ThreadScope, however this code is
> +** intially based off ThreadScope and GHC's runtime system support for
> +** ThreadScope.
> +*/
> +
> +/*
> ** Event log format
> **
> ** The log format is designed to be extensible: old tools should be able
> diff --git a/runtime/mercury_par_profile.h b/runtime/mercury_par_profile.h
> index 230de4d..27e4dd2 100644
> --- a/runtime/mercury_par_profile.h
> +++ b/runtime/mercury_par_profile.h
> @@ -2,17 +2,28 @@
> ** vim:ts=4 sw=4 expandtab
> */
> /*
> -** Copyright (C) 2009-2011,2013 The University of Melbourne.
> +** Copyright (C) 2009-2011,2013-2014 The University of Melbourne.
> **
> ** This file may only be copied under the terms of the GNU Library General
> ** Public License - see the file COPYING.LIB in the Mercury distribution.
> */
>
> /*
> -** mercury_par_profile.h - defines Mercury threadscope profiling support.
> +** mercury_par_profile.h - defines Mercury parallel profiling support.
> **
> -** See "Parallel Preformance Tuning for Haskell" - Don Jones Jr, Simon Marlow
> -** and Satnam Singh for information about threadscope.
> +** The code in this file and mercury_par_profile.c was originally designed
> +** to be compatible with ThreadScope, see:
> +**
> +**   + Don Jones Jr, Simon Marlow and Satnam Singh: Parallel Preformance
> +**     Tuning for Haskell.
> +**
> +**   + Paul Bone and Zoltan Somogyi: Profiling parallel Mercury programs
> +**     with ThreadScope.
> +**
> +** Maintaining compatibility with ThreadScope has been problematic, we no
> +** longer support compatibility with ThreadScope, however this code is
> +** intially based off ThreadScope and GHC's runtime system support for
> +** ThreadScope.
> */
>
> #ifndef MERCURY_PAR_PROFILE_H
> @@ -73,7 +84,8 @@ extern void MR_parprof_finalize_engine(MercuryEngine *eng);
> /*
> ** It looks like we don't need TSC synchronization code on modern x86(-64) CPUs
> ** including multi-socket systems (tested on goliath and taura).  If we find
> -** systems where this is needed we can enable it via a runtime check.
> +** systems where this is needed we can uncomment this code and introduce
> +** runtime configuration.

You can get rid of the references to goliath and taura there.

Cheers,
Julien.



More information about the reviews mailing list