-
Notifications
You must be signed in to change notification settings - Fork 6k
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
common: hint the main branch of dout() accordingly to default verbosity. #21259
Conversation
return LvlV <= static_cast<int>(m_gather_levels[SubV]); | ||
// we expect that setting level different than the default | ||
// is rather unusual. | ||
return expect(LvlV <= static_cast<int>(m_gather_levels[SubV]), |
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 is being carried to the if (should_gather)
in the dout_impl
.
retest this please |
src/log/SubsystemMap.h
Outdated
// we expect that setting level different than the default | ||
// is rather unusual. | ||
return expect(LvlV <= static_cast<int>(m_gather_levels[SubV]), | ||
LvlV <= ceph_subsys_get_max_default_level(SubV));; |
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.
nit, need to remove the trailing ";
"
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.
Thanks for catching this!
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.
aside from the nit, lgtm
1fb2a2a
to
bebf35a
Compare
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
Summary
In some cases the compiler arranges the
dout
-related code in a way unfriendly to statical branch prediction. That's is, the message crafting code is placed on the hot, fall-through path. The change modifies the behavior using__builtin_expect
to hint the expected result accordingly to the default verbosity for thesubsys
being involved.Before
After
Signed-off-by: Radoslaw Zarzynski rzarzyns@redhat.com