[commit: testsuite] master: Explain skipping compiler-perf tests when debugging is on (14958ae)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[commit: testsuite] master: Explain skipping compiler-perf tests when debugging is on (14958ae)

Simon Marlow-7
Actually this isn't quite right.  compiler_debugged() is true when
GhcDebugged=YES in the build system, and GhcDebugged controls whether
GHC is compiled with -debug or not.

That is, compiler_debugged() tells us whether the compiler was compiled
with -debug, not -DDEBUG.  The -debug flag links in the debug RTS and
doesn't change allocation or heap residency, whereas -DDEBUG enables
assertions in the compiler and *does* change allocation and heap residency.

It looks like we need another predicate to tell us whether GHC was
compiled with -DDEBUG or not.

Would you mind backing out these changes in the meantime?

Cheers,
Simon

On 28/11/13 15:55, git at git.haskell.org wrote:

> Repository : ssh://git at git.haskell.org/testsuite
>
> On branch  : master
> Link       : http://ghc.haskell.org/trac/ghc/changeset/14958ae02b99bafc06288493d186b9313ee8c4b9/testsuite
>
>> ---------------------------------------------------------------
>
> commit 14958ae02b99bafc06288493d186b9313ee8c4b9
> Author: Joachim Breitner <mail at joachim-breitner.de>
> Date:   Thu Nov 28 15:56:16 2013 +0000
>
>      Explain skipping compiler-perf tests when debugging is on
>
>
>> ---------------------------------------------------------------
>
> 14958ae02b99bafc06288493d186b9313ee8c4b9
>   driver/testlib.py |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/driver/testlib.py b/driver/testlib.py
> index bdb91b8..8c8c60d 100644
> --- a/driver/testlib.py
> +++ b/driver/testlib.py
> @@ -291,6 +291,8 @@ def _compiler_stats_num_field( name, opts, field, expecteds ):
>       if field in opts.compiler_stats_range_fields:
>           framework_fail(name, 'duplicate-numfield', 'Duplicate ' + field + ' num_field check')
>
> +    # Compiler performance numbers change when debugging is on, making the results
> +    # useless and confusing. Therefore, skip if debugging is on.
>       if compiler_debugged():
>           skip(name, opts)
>
>
> _______________________________________________
> ghc-commits mailing list
> ghc-commits at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-commits
>


Reply | Threaded
Open this post in threaded view
|

[commit: testsuite] master: Explain skipping compiler-perf tests when debugging is on (14958ae)

Joachim Breitner-2
Hi,

Am Freitag, den 29.11.2013, 10:08 +0000 schrieb Simon Marlow:

> Actually this isn't quite right.  compiler_debugged() is true when
> GhcDebugged=YES in the build system, and GhcDebugged controls whether
> GHC is compiled with -debug or not.
>
> That is, compiler_debugged() tells us whether the compiler was compiled
> with -debug, not -DDEBUG.  The -debug flag links in the debug RTS and
> doesn't change allocation or heap residency, whereas -DDEBUG enables
> assertions in the compiler and *does* change allocation and heap residency.
>
> It looks like we need another predicate to tell us whether GHC was
> compiled with -DDEBUG or not.
>
> Would you mind backing out these changes in the meantime?

are you sure? compiler_debugged() is certainly true when I build ghc
with
        GhcStage2HcOpts    = -O0 -DDEBUG
which yields
        ./inplace/bin/ghc-stage2 --info|grep 'Debug on'
         ,("Debug on","True")
but
        ./inplace/bin/ghc-stage2 +RTS --info|grep -i debug
is empty.

The test runner sets the value testsuite/mk/ghc-config.hs:
  info <- readProcess ghc ["--info"] ""
  let fields = read info :: [(String,String)]
  getGhcFieldOrFail fields "GhcDebugged" "Debug on"
which writes to testsuite/mk/ghcconfig_*
which is then read by testsuite/mk/boilerplate.mk
which is included everywhere
including mk/test.mk which sets "-e ghc_debugged=$(GhcDebugged)"

So it seems that it is simply the wiki documentation that is wrong here.

(And judging from the git history, it has always been the case since it
was introduced by Ian one year ago
(888daa51a7d656bba5f39e16e6396ba9d4d29f4c).

Greetings,
Joachim

       


--
Joachim ?nomeata? Breitner
  mail at joachim-breitner.de ? http://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  ? GPG-Key: 0x4743206C
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131129/4d242592/attachment.sig>

Reply | Threaded
Open this post in threaded view
|

[commit: testsuite] master: Explain skipping compiler-perf tests when debugging is on (14958ae)

Simon Marlow-7
On 29/11/2013 10:28, Joachim Breitner wrote:

> Hi,
>
> Am Freitag, den 29.11.2013, 10:08 +0000 schrieb Simon Marlow:
>> Actually this isn't quite right.  compiler_debugged() is true when
>> GhcDebugged=YES in the build system, and GhcDebugged controls whether
>> GHC is compiled with -debug or not.
>>
>> That is, compiler_debugged() tells us whether the compiler was compiled
>> with -debug, not -DDEBUG.  The -debug flag links in the debug RTS and
>> doesn't change allocation or heap residency, whereas -DDEBUG enables
>> assertions in the compiler and *does* change allocation and heap residency.
>>
>> It looks like we need another predicate to tell us whether GHC was
>> compiled with -DDEBUG or not.
>>
>> Would you mind backing out these changes in the meantime?
>
> are you sure? compiler_debugged() is certainly true when I build ghc
> with
>          GhcStage2HcOpts    = -O0 -DDEBUG
> which yields
>          ./inplace/bin/ghc-stage2 --info|grep 'Debug on'
>           ,("Debug on","True")
> but
>          ./inplace/bin/ghc-stage2 +RTS --info|grep -i debug
> is empty.
>
> The test runner sets the value testsuite/mk/ghc-config.hs:
>    info <- readProcess ghc ["--info"] ""
>    let fields = read info :: [(String,String)]
>    getGhcFieldOrFail fields "GhcDebugged" "Debug on"
> which writes to testsuite/mk/ghcconfig_*
> which is then read by testsuite/mk/boilerplate.mk
> which is included everywhere
> including mk/test.mk which sets "-e ghc_debugged=$(GhcDebugged)"

Oh, we use the same variable name GhcDebugged to mean two different
things: in the GHC build system it means that GHC was compiled with
-debug, but in the testsuite build system it means that GHC was compiled
with -DDEBUG.  How confusing!

Anyway you're right - there doesn't seem to be a bug, but we should
rename things to avoid confusion.  I'll do that.

> So it seems that it is simply the wiki documentation that is wrong here.

I didn't check the wiki, just got confused by the source.  Please go
ahead and fix the wiki if there's something wrong there.

Cheers,
Simon


Reply | Threaded
Open this post in threaded view
|

[commit: testsuite] master: Explain skipping compiler-perf tests when debugging is on (14958ae)

Joachim Breitner-2
Hi,

Am Montag, den 02.12.2013, 09:53 +0000 schrieb Simon Marlow:

> Oh, we use the same variable name GhcDebugged to mean two different
> things: in the GHC build system it means that GHC was compiled with
> -debug, but in the testsuite build system it means that GHC was compiled
> with -DDEBUG.  How confusing!
>
> Anyway you're right - there doesn't seem to be a bug, but we should
> rename things to avoid confusion.  I'll do that.
>
> > So it seems that it is simply the wiki documentation that is wrong here.
>
> I didn't check the wiki, just got confused by the source.  Please go
> ahead and fix the wiki if there's something wrong there.

done, in
https://ghc.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding
If you rename compiler_debuggeed() as well (and not just the
test-runner-internal GhcDebugged), make sure to update that page as
well.

Greetings,
Joachim

--
Joachim ?nomeata? Breitner
  mail at joachim-breitner.de ? http://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  ? GPG-Key: 0x4743206C
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131202/f12363f4/attachment.sig>