Bug 204713 - Shouldn't use VG_(printf) in most cases
Summary: Shouldn't use VG_(printf) in most cases
Status: ASSIGNED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.5.0
Platform: Unlisted Binaries All
: NOR normal
Target Milestone: wanted3.5.1
Assignee: Nicholas Nethercote
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-22 00:03 UTC by Nicholas Nethercote
Modified: 2009-08-22 00:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicholas Nethercote 2009-08-22 00:03:13 UTC
VG_(printf) doesn't print the "==pid==" prefix at the start of each line.  This makes its output difficult to identify as Valgrind output.  We should avoid VG_(printf) in almost all cases except for a few things like usage messages.  It's currently used a lot for debugging-type messages.  But now that VG_(message) has become more flexible (allowing a single line to be built up over multiple calls) we should use that instead.

I noticed this because the Darwin port prints lots of messages like this:

   UNKNOWN Mach port modified (port N delta M)

which are meaningless to a normal user.

This is related to bug 203255, because some of these messages should end up as user messages (VG_(umsg)), and some as debug messages (VG_(dmsg)) which only show up with -d if bug 203255 is done.
Comment 1 Nicholas Nethercote 2009-08-22 00:13:34 UTC
It might be worth renaming VG_(printf) as VG_(naked_msg) or something like that, to make it clearer that it doesn't print the prefix.
Comment 2 Nicholas Nethercote 2009-08-22 00:17:37 UTC
Another possibility (which again interacts with bug 203255) would be clearly distinguish useful user info:

  ==pid== foo

from general running messages from Valgrind:

  --pid-- foo

(this would cover things like "UNKNOWN Mach port")

from debugging messages that are only printed with -d:

  ++pid++ foo

or something like that.  We currently have the "++pid++" for Vg_DebugExtraMsg but it's almost never used.