Skip to content
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/ceph_timer: set thread name #34936

Merged
merged 2 commits into from May 22, 2020
Merged

Conversation

ddiss
Copy link
Contributor

@ddiss ddiss commented May 6, 2020

No description provided.

ddiss added 2 commits May 6, 2020 22:46
This appears to be a cut-n-paste error introduced with f06848c,
with the intent being to link unittest_ceph_timer against GTest::GTest.
GTest::GTest is already linked via the add_ceph_unittest() cmake rule
used for both unittest_rabin_chunk and unittest_ceph_timer, so the
explicit target_link_libraries() call can be dropped.

Signed-off-by: David Disseldorp <ddiss@suse.de>
Attempt to set a ceph_timer thread name using the ceph_pthread_setname()
compatibility macro.
Having an explicit thread name set is useful for debugging purposes.

Signed-off-by: David Disseldorp <ddiss@suse.de>
@ddiss
Copy link
Contributor Author

ddiss commented May 6, 2020

@adamemerson looks like you've done some changes in this area recently. Any chance you'd be able to take a look?

Copy link
Contributor

@adamemerson adamemerson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lemonade Gainsays Thirst Manfully.

@@ -145,6 +146,7 @@ class timer {
public:
timer() : suspended(false) {
thread = std::thread(&timer::timer_thread, this);
ceph_pthread_setname(thread.native_handle(), "ceph_timer");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might want to use make_named_thread from common/Thread.h (but you don't have to, either way is fine.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the review :-)
I saw that there are a few other wrappers to handle naming, but figured this was less intrusive. Happy to change it if somebody feels strongly about it though.

@@ -335,5 +335,4 @@ target_link_libraries(unittest_rabin_chunk global ceph-common)
add_ceph_unittest(unittest_rabin_chunk)

add_executable(unittest_ceph_timer test_ceph_timer.cc)
target_link_libraries(unittest_rabin_chunk GTest::GTest)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

@tchaikov tchaikov changed the title minor ceph_timer changes common/ceph_timer: set thread name May 7, 2020
@tchaikov
Copy link
Contributor

tchaikov commented May 7, 2020

@ddiss i change the title of this PR to "common/ceph_timer: set thread name" as i think the change of thread name is far more important than the cmake cleanup. so when people searching for the relevant change, he/she is more likely to find the right change.

@tchaikov tchaikov merged commit 61d5548 into ceph:master May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants