diff --git a/ci/travis.sh b/ci/travis.sh index 72e1d65..512995e 100644 --- a/ci/travis.sh +++ b/ci/travis.sh @@ -43,6 +43,7 @@ yum install -y librulescan-devel yum install -y sapp-devel # Maat_rule require MESA/stream.h yum install -y numactl-libs # required by mrzcpd yum install -y libibverbs # required by mrzcpd +yum install -y libbreakpad_mini-devel if [ $ASAN_OPTION ]; then source /opt/rh/devtoolset-7/enable diff --git a/conf/sce.conf b/conf/sce.conf index a595661..ae5da53 100644 --- a/conf/sce.conf +++ b/conf/sce.conf @@ -4,6 +4,15 @@ enable_cpu_affinity=1 cpu_affinity_mask=2,3,4-9 firewall_sids=1001 +# Only when (disable_coredump == 1 || (enable_breakpad == 1 && enable_breakpad_upload == 1)) is satisfied, the core will not be generated locally +disable_coredump=0 +enable_breakpad=1 +enable_breakpad_upload=1 +breakpad_upload_url=http://sentry.mesalab.cn:9000/api/3/minidump/?sentry_key=e8e446bb3bd8435c97f4c01770ca7025 +# must be /run/sce/crashreport,due to tmpfile limit +breakpad_minidump_dir=/run/sce/crashreport +breakpad_upload_tools=/opt/tsg/framework/bin/minidump_upload + [maat] # 0:json 1:redis 2:iris input_mode=1 diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt index cff1224..133bb55 100644 --- a/platform/CMakeLists.txt +++ b/platform/CMakeLists.txt @@ -3,6 +3,7 @@ target_link_libraries(platform PUBLIC common) target_link_libraries(platform PUBLIC pthread) target_link_libraries(platform PUBLIC MESA_prof_load) target_link_libraries(platform PUBLIC MESA_field_stat) +target_link_libraries(platform PUBLIC breakpad_mini) target_link_libraries(platform PUBLIC maatframe) target_link_libraries(platform PUBLIC mrzcpd) target_link_libraries(platform PUBLIC cjson) diff --git a/platform/src/main.cpp b/platform/src/main.cpp index ae765a6..21af7f4 100644 --- a/platform/src/main.cpp +++ b/platform/src/main.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "sce.h" #include "log.h" @@ -11,6 +12,8 @@ #include "health_check.h" #include "global_metrics.h" +struct breakpad_instance *g_breakpad = NULL; + #ifdef SCE_GIT_VERSION static __attribute__((__used__)) const char *__sce_version = SCE_GIT_VERSION; #else @@ -132,6 +135,8 @@ int main(int argc, char **argv) return -1; } + g_breakpad = breakpad_init(profile, "system", g_default_logger, __sce_version); + health_check_session_init(profile); struct sce_ctx *ctx = sce_ctx_create(profile); diff --git a/vendor/CMakeLists.txt b/vendor/CMakeLists.txt index b5bfb55..fe80236 100644 --- a/vendor/CMakeLists.txt +++ b/vendor/CMakeLists.txt @@ -61,4 +61,8 @@ set(MRZCPD_INCLUDE_DIR /opt/mrzcpd/include) add_library(mrzcpd SHARED IMPORTED GLOBAL) set_property(TARGET mrzcpd PROPERTY IMPORTED_LOCATION ${MRZCPD_LIB_DIR}/libmarsio.so) -set_property(TARGET mrzcpd PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MRZCPD_INCLUDE_DIR}) \ No newline at end of file +set_property(TARGET mrzcpd PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MRZCPD_INCLUDE_DIR}) + +add_library(breakpad_mini SHARED IMPORTED GLOBAL) +set_property(TARGET breakpad_mini PROPERTY IMPORTED_LOCATION ${MESA_FRAMEWORK_LIB_DIR}/libbreakpad_mini.so) +set_property(TARGET breakpad_mini PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${MESA_FRAMEWORK_INCLUDE_DIR}) \ No newline at end of file