Hal Finkel via llvm-dev
2015-Nov-02 19:19 UTC
[llvm-dev] Prefixing DEBUG messages with DEBUG_TYPE (was re: [PATCH] D13259: LLE 6/6: Add LoopLoadElimination pass)
----- Original Message -----> From: "Matthias Braun via llvm-dev" <llvm-dev at lists.llvm.org> > To: "Daniel Berlin" <dberlin at dberlin.org> > Cc: "llvm-dev" <llvm-dev at lists.llvm.org> > Sent: Monday, November 2, 2015 1:16:18 PM > Subject: Re: [llvm-dev] Prefixing DEBUG messages with DEBUG_TYPE (was re: [PATCH] D13259: LLE 6/6: Add > LoopLoadElimination pass) > > To ask a basic question first: Why do we need prefixes at all? Are > the messages that likely to be confused? As far as I understand this > case it was only mentioned because of inconsistent prefix/no-prefix > use, there was no indication that we should actually have them. So > another possible solution would be to remove prefixes and avoiding > the additional visual noise. Why add noise to every message just to > improve upon the rare case of a messages origin being ambiguous?I generally find the prefixes convenient when searching the debug output for debug messages from a particular pass. -Hal> > - Matthias > > > On Nov 2, 2015, at 11:04 AM, Daniel Berlin via llvm-dev > > <llvm-dev at lists.llvm.org> wrote: > > > > Moving this discussion here from the review thread. > > > > RIght now, we have a few passes that prefix DEBUG message with > > various things, so folks using -debug can tell where the debug > > message came from. > > > > But this is not consistent, and in fact, most passes don't do it. > > > > Worse, the prefixes used do not often match the DEBUG_TYPE of the > > pass. > > > > It would be nice to fix this, and just have the DEBUG macros output > > the debug type in front of messages if that's what folks want. > > > > Of course, it turns out you can't just make the DEBUG macro do > > something here, because people use it for more than just > > outputting messages. > > > > My thought was to just bite the bullet and make a DEBUG_MSG macro > > that outputs the DEBUG_TYPE, and replace the appropriate existing > > uses of DEBUG(dbgs() <<) with it. > > > > Something like > > #define DEBUG_MSG_WITH_TYPE(t, x) DEBUG_WITH_TYPE(t, dbgs() << t > > <<":" << x;) > > #define DEBUG_MSG(x) DEBUG_MSG_WITH_TYPE(DEBUG_TYPE, x) > > > > Suggestions, however, welcome! > > > > ---------- Forwarded message ---------- > > From: Renato Golin <renato.golin at linaro.org> > > Date: Fri, Oct 30, 2015 at 10:15 AM > > Subject: Re: [PATCH] D13259: LLE 6/6: Add LoopLoadElimination pass > > To: anemet at apple.com, hfinkel at anl.gov, dberlin at dberlin.org > > Cc: mssimpso at codeaurora.org, sanjoy at playingwithpointers.com, > > llvm-commits at lists.llvm.org > > > > > > rengolin added a comment. > > > > In http://reviews.llvm.org/D13259#278362, @dberlin wrote: > > > > > I would suggest rather than prefix *anything*, anywhere, that if > > > we want > > > prefixes, we just have the DEBUG macro output the debug type in > > > front of > > > the message ;-) > > > > > > Sounds good to me. > > > > > > http://reviews.llvm.org/D13259 > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory
Renato Golin via llvm-dev
2015-Nov-02 19:24 UTC
[llvm-dev] Prefixing DEBUG messages with DEBUG_TYPE (was re: [PATCH] D13259: LLE 6/6: Add LoopLoadElimination pass)
On 2 November 2015 at 19:19, Hal Finkel via llvm-dev <llvm-dev at lists.llvm.org> wrote:> I generally find the prefixes convenient when searching the debug output for debug messages from a particular pass.Especially when you enable debug for all passes as well as print-after-all. --renato
Hal Finkel via llvm-dev
2015-Nov-02 19:29 UTC
[llvm-dev] Prefixing DEBUG messages with DEBUG_TYPE (was re: [PATCH] D13259: LLE 6/6: Add LoopLoadElimination pass)
----- Original Message -----> From: "Renato Golin" <renato.golin at linaro.org> > To: "Hal Finkel" <hfinkel at anl.gov> > Cc: "Matthias Braun" <mbraun at apple.com>, "llvm-dev" <llvm-dev at lists.llvm.org> > Sent: Monday, November 2, 2015 1:24:16 PM > Subject: Re: [llvm-dev] Prefixing DEBUG messages with DEBUG_TYPE (was re: [PATCH] D13259: LLE 6/6: Add > LoopLoadElimination pass) > > On 2 November 2015 at 19:19, Hal Finkel via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > I generally find the prefixes convenient when searching the debug > > output for debug messages from a particular pass. > > Especially when you enable debug for all passes as well as > print-after-all.I'll add that this is particularly important when, for example, debug messages from different passes appear intermingled. This is common for lazy analysis passes (such as SCEV). -Hal> > --renato >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory
Krzysztof Parzyszek via llvm-dev
2015-Nov-02 19:36 UTC
[llvm-dev] Prefixing DEBUG messages with DEBUG_TYPE (was re: [PATCH] D13259: LLE 6/6: Add LoopLoadElimination pass)
On 11/2/2015 1:19 PM, Hal Finkel via llvm-dev wrote:> > I generally find the prefixes convenient when searching the debug output for debug messages from a particular pass.On the other hand, I have only used -debug (output from all passes) once. I normally only use -debug-only, or #define DEBUG(x) to (x). -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Adam Nemet via llvm-dev
2015-Nov-02 20:24 UTC
[llvm-dev] Prefixing DEBUG messages with DEBUG_TYPE (was re: [PATCH] D13259: LLE 6/6: Add LoopLoadElimination pass)
> On Nov 2, 2015, at 11:19 AM, Hal Finkel via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > ----- Original Message ----- >> From: "Matthias Braun via llvm-dev" <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> >> To: "Daniel Berlin" <dberlin at dberlin.org <mailto:dberlin at dberlin.org>> >> Cc: "llvm-dev" <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> >> Sent: Monday, November 2, 2015 1:16:18 PM >> Subject: Re: [llvm-dev] Prefixing DEBUG messages with DEBUG_TYPE (was re: [PATCH] D13259: LLE 6/6: Add >> LoopLoadElimination pass) >> >> To ask a basic question first: Why do we need prefixes at all? Are >> the messages that likely to be confused? As far as I understand this >> case it was only mentioned because of inconsistent prefix/no-prefix >> use, there was no indication that we should actually have them. So >> another possible solution would be to remove prefixes and avoiding >> the additional visual noise. Why add noise to every message just to >> improve upon the rare case of a messages origin being ambiguous? > > I generally find the prefixes convenient when searching the debug output for debug messages from a particular pass.+1> > -Hal > >> >> - Matthias >> >>> On Nov 2, 2015, at 11:04 AM, Daniel Berlin via llvm-dev >>> <llvm-dev at lists.llvm.org> wrote: >>> >>> Moving this discussion here from the review thread. >>> >>> RIght now, we have a few passes that prefix DEBUG message with >>> various things, so folks using -debug can tell where the debug >>> message came from. >>> >>> But this is not consistent, and in fact, most passes don't do it. >>> >>> Worse, the prefixes used do not often match the DEBUG_TYPE of the >>> pass. >>> >>> It would be nice to fix this, and just have the DEBUG macros output >>> the debug type in front of messages if that's what folks want. >>> >>> Of course, it turns out you can't just make the DEBUG macro do >>> something here, because people use it for more than just >>> outputting messages. >>> >>> My thought was to just bite the bullet and make a DEBUG_MSG macro >>> that outputs the DEBUG_TYPE, and replace the appropriate existing >>> uses of DEBUG(dbgs() <<) with it. >>> >>> Something like >>> #define DEBUG_MSG_WITH_TYPE(t, x) DEBUG_WITH_TYPE(t, dbgs() << t >>> <<":" << x;) >>> #define DEBUG_MSG(x) DEBUG_MSG_WITH_TYPE(DEBUG_TYPE, x) >>> >>> Suggestions, however, welcome! >>> >>> ---------- Forwarded message ---------- >>> From: Renato Golin <renato.golin at linaro.org> >>> Date: Fri, Oct 30, 2015 at 10:15 AM >>> Subject: Re: [PATCH] D13259: LLE 6/6: Add LoopLoadElimination pass >>> To: anemet at apple.com, hfinkel at anl.gov, dberlin at dberlin.org >>> Cc: mssimpso at codeaurora.org, sanjoy at playingwithpointers.com, >>> llvm-commits at lists.llvm.org >>> >>> >>> rengolin added a comment. >>> >>> In http://reviews.llvm.org/D13259#278362, @dberlin wrote: >>> >>>> I would suggest rather than prefix *anything*, anywhere, that if >>>> we want >>>> prefixes, we just have the DEBUG macro output the debug type in >>>> front of >>>> the message ;-) >>> >>> >>> Sounds good to me. >>> >>> >>> http://reviews.llvm.org/D13259 >>> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> > > -- > Hal Finkel > Assistant Computational Scientist > Leadership Computing Facility > Argonne National Laboratory > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151102/45f056c0/attachment.html>