[Git][ghc/ghc][wip/rafl/hpc-readtix] hpc: Stop reading existing `.tix` files by default
Florian Ragwitz pushed to branch wip/rafl/hpc-readtix at Glasgow Haskell Compiler / GHC Commits: d599c169 by Florian Ragwitz at 2026-10-15T11:10:39-07:00 hpc: Stop reading existing `.tix` files by default Fixes #27956. - - - - - 6 changed files: - + changelog.d/hpc-readTix - docs/users_guide/profiling.rst - docs/users_guide/runtime_control.rst - rts/Hpc.c - rts/RtsFlags.c - rts/include/rts/Flags.h Changes: ===================================== changelog.d/hpc-readTix ===================================== @@ -0,0 +1,16 @@ +section: compiler +synopsis: Accumulating coverage data over multiple runs is no longer the default +issues: #27956 +mrs: !16826 +description: + Programs compiled using :ghc-flag:`-fhpc` will, when executed, no longer read + an existing ``.tix`` file for the program and add coverage data to it by + default. Instead, the new default is to overwrite an existing ``.tix`` file + with only the coverage data from the latest run. + + :rts-flag:`--read-tix-file=\<yes|no\>` can be used to control this behaviour + as before. This release merely changes the default from + ``--read-tix-file=yes`` to ``--read-tix-file=no``. + + Additionally, the deprecation warning introduced in GHC 9.12 to warn about + this change of default behaviour in the future has been removed. ===================================== docs/users_guide/profiling.rst ===================================== @@ -1522,11 +1522,11 @@ after the program is run. Running the program generates a file with the ``.tix`` suffix, in this case :file:`Recip.tix`, which contains the coverage data for this run of the -program. The program may be run multiple times (e.g. with different test -data), and the coverage data from the separate runs is accumulated in -the ``.tix`` file. This behaviour can be controlled with the :rts-flag:`--read-tix-file=\<yes|no\>` -You can control where the ``.tix`` file is generated using the -environment variable :envvar:`HPCTIXFILE`. +program. Running the program multiple times (e.g. with different test data) +will overwrite this file with coverage data from the latest run. To accumulate +coverage data from multiple runs in the ``.tix`` file, +:rts-flag:`--read-tix-file=\<yes|no\>` can be used. You can control where the +``.tix`` file is generated using the environment variable :envvar:`HPCTIXFILE`. .. envvar:: HPCTIXFILE ===================================== docs/users_guide/runtime_control.rst ===================================== @@ -1388,7 +1388,7 @@ and can be controlled by the following flags. .. rts-flag:: --read-tix-file=<yes|no> - :default: enabled + :default: disabled :since: 9.12 The RTS can be instructed to read a ``<program>.tix`` file during the startup @@ -1397,10 +1397,6 @@ and can be controlled by the following flags. This option is useful for aggregating coverage information over multiple runs of an executable. - The default for this flag is currently ``--read-tix-file=yes`` but will change - to ``-read-tix-file=no`` in a future version of GHC according to the accepted - `GHC Proposal 612 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0612-fhpc-accumulation.md>`__. - .. rts-flag:: --write-tix-file=<yes|no> :default: enabled ===================================== rts/Hpc.c ===================================== @@ -236,14 +236,7 @@ startupHpc(void) sprintf(tixFilename, "%s.tix", prog_name); } - if ((RtsFlags.HpcFlags.readTixFile == HPC_YES_IMPLICIT) && init_open(__rts_fopen(tixFilename,"r"))) { - fprintf(stderr,"Deprecation warning:\n" - "I am reading in the existing tix file, and will add hpc info from this run to the existing data in that file.\n" - "GHC 9.14 will cease looking for an existing tix file by default.\n" - "If you positively want to add hpc info to the current tix file, use the RTS option --read-tix-file=yes.\n" - "More information can be found in the accepted GHC proposal 612.\n"); - readTix(); - } else if ((RtsFlags.HpcFlags.readTixFile == HPC_YES_EXPLICIT) && init_open(__rts_fopen(tixFilename,"r"))) { + if (RtsFlags.HpcFlags.readTixFile && init_open(__rts_fopen(tixFilename,"r"))) { readTix(); } } ===================================== rts/RtsFlags.c ===================================== @@ -305,7 +305,7 @@ void initRtsFlagsDefaults(void) RtsFlags.TickyFlags.showTickyStats = false; RtsFlags.TickyFlags.tickyFile = NULL; #endif - RtsFlags.HpcFlags.readTixFile = HPC_YES_IMPLICIT; + RtsFlags.HpcFlags.readTixFile = false; RtsFlags.HpcFlags.writeTixFile = true; } @@ -1100,12 +1100,12 @@ error = true; else if (strequal("read-tix-file=yes", &rts_argv[arg][2])) { OPTION_UNSAFE; - RtsFlags.HpcFlags.readTixFile = HPC_YES_EXPLICIT; + RtsFlags.HpcFlags.readTixFile = true; } else if (strequal("read-tix-file=no", &rts_argv[arg][2])) { OPTION_UNSAFE; - RtsFlags.HpcFlags.readTixFile = HPC_NO_EXPLICIT; + RtsFlags.HpcFlags.readTixFile = false; } else if (strequal("write-tix-file=yes", &rts_argv[arg][2])) { ===================================== rts/include/rts/Flags.h ===================================== @@ -317,25 +317,11 @@ typedef struct _PAR_FLAGS { bool setAffinity; /* force thread affinity with CPUs */ } PAR_FLAGS; -/* Corresponds to the RTS flag `--read-tix-file=<yes|no>`. - * The accepted GHC proposal 612 introduced a one-release warning period - * during which we emit a warning if we read a .tix file and the flag - * isn't explicitly set. In order to distinguish between whether the flag - * was explicitly set or defaulted we need to use a tri-state variable. - */ -typedef enum _HPC_READ_FILE { - HPC_NO_EXPLICIT = 0, /* The user has specified --read-tix-file=no */ - HPC_YES_IMPLICIT = 1, /* The user hasn't specified an option and we emit - * a warning when we read a tix file. - */ - HPC_YES_EXPLICIT = 2 /* The user has specified --read-tix-file=yes */ - } HPC_READ_FILE; - /* See Note [Synchronization of flags and base APIs] */ typedef struct _HPC_FLAGS { bool writeTixFile; /* Whether the RTS should write a tix file at the end of execution */ - HPC_READ_FILE readTixFile; /* Whether the RTS should read a tix + bool readTixFile; /* Whether the RTS should read a tix file at the beginning of execution */ } HPC_FLAGS; View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d599c1696719af92db904e82070b28d4... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d599c1696719af92db904e82070b28d4... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Florian Ragwitz (@rafl)