1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "common/TracepointProvider.h"
5 #include "common/config.h"
6
7 TracepointProvider::TracepointProvider(CephContext *cct, const char *library,
8 const char *config_key)
9 : m_cct(cct), m_library(library), m_config_keys{config_key, NULL}
10 {
11 m_cct->_conf.add_observer(this);
12 verify_config(m_cct->_conf);
13 }
14
(1) Event exn_spec_violation: |
An exception of type "_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINSt8ios_base7failureB5cxx11EEEEE" is thrown but the throw list "throw()" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate(). |
Also see events: |
[fun_call_w_exception] |
15 TracepointProvider::~TracepointProvider() {
(2) Event fun_call_w_exception: |
Called function throws an exception of type "_ZN5boost16exception_detail10clone_implINS0_19error_info_injectorINSt8ios_base7failureB5cxx11EEEEE". [details] |
Also see events: |
[exn_spec_violation] |
16 m_cct->_conf.remove_observer(this);
17 if (m_handle) {
18 dlclose(m_handle);
19 }
20 }
21
22 void TracepointProvider::handle_conf_change(
23 const ConfigProxy& conf, const std::set<std::string> &changed) {
24 if (changed.count(m_config_keys[0])) {
25 verify_config(conf);
26 }
27 }
28
29 void TracepointProvider::verify_config(const ConfigProxy& conf) {
30 std::lock_guard locker(m_lock);
31 if (m_handle) {
32 return;
33 }
34
35 char buf[10];
36 char *pbuf = buf;
37 if (conf.get_val(m_config_keys[0], &pbuf, sizeof(buf)) != 0 ||
38 strncmp(buf, "true", 5) != 0) {
39 return;
40 }
41
42 m_handle = dlopen(m_library.c_str(), RTLD_NOW | RTLD_NODELETE);
43 ceph_assert(m_handle);
44 }
45
46