Don't truncate traceEvents to 512 bytes (#8309)
ClosedPublic

Authored by thomie on Feb 14 2015, 11:57 AM.

Details

Summary

Don't call postLogMsg to post a user msg, because it truncates messages to
512 bytes.

Rename traceCap_stderr and trace_stderr to vtraceCap_stderr and trace_stderr,
to signal that they take a va_list (similar to vdebugBelch vs debugBelch).

See Trac #3874 for the original reason behind traceFormatUserMsg.

See the commit msg in Trac #9395 (d360d440) for a discussion about using
null-terminated strings vs strings with an explicit length.

Test Plan

Run cabal install ghc-events and inspect the result of ghc-events show on
an eventlog file created with ghc -eventlog Test.hs and ./Test +RTS -l,
where Test.hs contains:

import Debug.Trace
main = traceEvent (replicate 510 'a' ++ "bcd") $ return ()

Depends on D655.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
thomie updated this revision to Diff 2231.Feb 14 2015, 11:57 AM
thomie retitled this revision from to Don't truncate traceEvents to 512 bytes (#8309).
thomie updated this object.
thomie edited the test plan for this revision. (Show Details)
thomie added a reviewer: austin.
thomie updated the Trac tickets for this revision.
thomie updated this revision to Diff 2232.Feb 14 2015, 12:53 PM

Fix warning

austin accepted this revision.Feb 15 2015, 1:26 AM
austin edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Feb 15 2015, 1:26 AM
This revision was automatically updated to reflect the committed changes.