-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#1636 add API for temporarily enabling/disabling debug prints #1658
#1636 add API for temporarily enabling/disabling debug prints #1658
Conversation
1e76f5f
to
db22225
Compare
Codecov Report
@@ Coverage Diff @@
## develop #1658 +/- ##
===========================================
- Coverage 83.53% 83.52% -0.01%
===========================================
Files 797 799 +2
Lines 30816 30896 +80
===========================================
+ Hits 25741 25807 +66
- Misses 5075 5089 +14
|
@nmm0 Is it something that might come in handy for your use cases (take a look at simplified usage in unit tests)? |
Yes, this is perfect, especially the scoped version. In my use cases I often want to get the prints from a specific function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Only thing I'd want to add is some documentation just to make developers aware of the feature.
Documentation added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. The only change I would suggest is checking to see if VT is live, and then printing an appropriate error/exception/abort if it isn't.
Done |
src/vt/configs/debug/debug_print.cc
Outdated
} \ | ||
\ | ||
ScopedModifier_##opt##_##val createScopedModifier_##opt##_##val() { \ | ||
if (not curRT) { \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way to tell if vt's been initialized already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just check if (vt::theConfig())
which might make a little more sense in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, checking that looks better in this context, but internally it uses two pointers before it returns config, so if vt is not initialized, I think the program would (at best) segfault.
vt::arguments::AppConfig *theConfig() { return &CUR_RT->theArgConfig->config_; }
src/vt/configs/debug/debug_print.h
Outdated
vtAbort("Trying to read config when VT is not initialized"); \ | ||
} \ | ||
\ | ||
theConfig()->vt_debug_##opt = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to qualify all of these calls to theConfig()
with ::vt::theConfig()
because they might not be in the VT namespace for application code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
88ea473
to
95a304b
Compare
95a304b
to
75f6630
Compare
There are still some funky compilation errors with fcontext and unity build enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good once we can get CI passing!
Fixes #1636