#include "common/cmdparse.h"
#include "common/code_environment.h"
#include "msg/msg_types.h"
+#ifdef HAVE_BREAKPAD
#include "breakpad/src/client/linux/handler/exception_handler.h"
+#endif
#ifdef WITH_CRIMSON
#include "crimson/common/config_proxy.h"
#include "crimson/common/perf_counters_collection.h"
ConfigProxy _conf;
ceph::logging::Log *_log;
+#ifdef HAVE_BREAKPAD
std::unique_ptr<google_breakpad::ExceptionHandler> _ex_handler;
+#endif
/* init ceph::crypto */
void init_crypto();
#include "extblkdev/ExtBlkDevPlugin.h"
#include "global/global_context.h"
#include "global/global_init.h"
+#ifdef HAVE_BREAKPAD
#include <client/linux/handler/minidump_descriptor.h>
#include <google_breakpad/common/minidump_format.h>
+#endif
#include "global/pidfile.h"
#include "global/signal_handler.h"
#include "include/compat.h"
g_conf().complain_about_parse_error(g_ceph_context);
}
+#ifdef HAVE_BREAKPAD
static bool dumpCallback(
const google_breakpad::MinidumpDescriptor& descriptor, void* context,
bool succeeded) {
dout_emergency(buf);
return succeeded;
}
+#endif
boost::intrusive_ptr<CephContext>
global_init(const std::map<std::string,std::string> *defaults,
install_standard_sighandlers();
}
+#ifdef HAVE_BREAKPAD
if (g_conf()->breakpad) {
google_breakpad::MinidumpDescriptor descriptor(g_conf()->crash_dir);
g_ceph_context->_ex_handler.reset(
new google_breakpad::ExceptionHandler(descriptor, nullptr, dumpCallback, nullptr, true, -1));
}
+#else
+ if (g_conf()->breakpad) {
+ cerr << "breakpad crash reporting requested, but disabled at build time"
+ << std::endl;
+ }
+#endif
ceph::register_assert_context(g_ceph_context);