[Mesa-dev] [PATCH] anv: Make anv_finishme onl warn once per call-site
Jason Ekstrand
jason at jlekstrand.net
Wed Nov 9 22:04:19 UTC 2016
On Wed, Nov 9, 2016 at 11:52 AM, Kenneth Graunke <kenneth at whitecape.org>
wrote:
> On Tuesday, November 8, 2016 8:50:43 PM PST Jason Ekstrand wrote:
> > When you fire up Dota2 on Haswell you get spammed with thousands of
> > "Implement Gen7 HZ ops" finishme's. The point of the finshme is as a
> > reminder that there is something left to implement. Printing it once
> > should be sufficient.
> >
> > Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
> > ---
> > src/intel/vulkan/anv_private.h | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_
> private.h
> > index 8f5a95b..c71a884 100644
> > --- a/src/intel/vulkan/anv_private.h
> > +++ b/src/intel/vulkan/anv_private.h
> > @@ -194,8 +194,13 @@ void anv_loge_v(const char *format, va_list va);
> > /**
> > * Print a FINISHME message, including its source location.
> > */
> > -#define anv_finishme(format, ...) \
> > - __anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__);
> > +#define anv_finishme(format, ...) ({ \
> > + static bool reported = false; \
> > + if (!reported) { \
> > + __anv_finishme(__FILE__, __LINE__, format, ##__VA_ARGS__); \
> > + reported = true; \
> > + } \
> > +})
> >
> > /* A non-fatal assert. Useful for debugging. */
> > #ifdef DEBUG
> >
>
> In the commit title: onl -> only
>
Fixed.
> I don't think you need to use a GCC-specific statement expression here.
> The usual do { ... } while(0) would work fine, and is less magical.
>
I suppose. I don't really care much one way or the other. I don't find
statement expressions that magical.
> With those changed,
> Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
>
Sorry, already pushed it. :/
I can make another patch to switch it to a do-while if you'd like.
--Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161109/b20fe231/attachment.html>
More information about the mesa-dev
mailing list