MCPcopy Create free account
hub / github.com/ceph/ceph / register_thread

Method register_thread

src/mgr/ThreadMonitor.cc:41–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void ThreadMonitor::register_thread(const pid_t thread_id,
42 const pid_t serve_thread_id,
43 const std::string& thread_name,
44 const PyModuleRef py_module_) {
45 std::lock_guard<std::mutex> lock(monitored_threads_mutex);
46
47 if (monitored_threads.count(thread_id)) {
48 dout(20) << "Attempted to register already known thread (TID: " << thread_id << ")." << dendl;
49 return;
50 }
51
52 MonitoredThreadInfo info;
53 info.name = thread_name;
54 info.py_module = py_module_;
55 info.serve_thread_id = serve_thread_id;
56 info.last_snapshot.timestamp = ceph::mono_clock::now();
57 info.last_serve_snapshot.timestamp = ceph::mono_clock::now();
58 monitored_threads[thread_id] = info;
59 dout(0) << "Registered thread: '" << thread_name << "' (TID: " << thread_id << ") module: "
60 << (py_module_ ? py_module_->get_name() : "unknown") << dendl;
61}
62
63void ThreadMonitor::handle_conf_change(
64 const ConfigProxy& conf,

Callers 1

start_oneMethod · 0.80

Calls 3

nowFunction · 0.50
countMethod · 0.45
get_nameMethod · 0.45

Tested by

no test coverage detected