add two paramaters about faststack
This commit is contained in:
17
deps/oblib/src/lib/signal/ob_signal_handlers.cpp
vendored
17
deps/oblib/src/lib/signal/ob_signal_handlers.cpp
vendored
@ -32,7 +32,20 @@ namespace oceanbase
|
||||
namespace common
|
||||
{
|
||||
|
||||
int64_t FASTSTACK_MIN_INTERVAL = 30 * 60 * 1000 * 1000; // 30min
|
||||
ObSigFaststack::ObSigFaststack()
|
||||
: min_interval_(30 * 60 * 1000 * 1000UL) // 30min
|
||||
{
|
||||
}
|
||||
|
||||
ObSigFaststack::~ObSigFaststack()
|
||||
{
|
||||
}
|
||||
|
||||
ObSigFaststack &ObSigFaststack::get_instance()
|
||||
{
|
||||
static ObSigFaststack sig_faststack;
|
||||
return sig_faststack;
|
||||
}
|
||||
|
||||
static const int SIG_SET[] = {SIGABRT, SIGBUS, SIGFPE, SIGSEGV, SIGURG};
|
||||
static constexpr char MINICORE_SHELL_PATH[] = "tools/minicore.sh";
|
||||
@ -268,7 +281,7 @@ int faststack()
|
||||
int64_t now = ObTimeUtility::fast_current_time();
|
||||
int64_t last = ATOMIC_LOAD(&last_ts);
|
||||
int ret = OB_SUCCESS;
|
||||
if (now - last < FASTSTACK_MIN_INTERVAL) {
|
||||
if (now - last < ObSigFaststack::get_instance().get_min_interval()) {
|
||||
ret = OB_EAGAIN;
|
||||
} else if (!ATOMIC_BCAS(&last_ts, last, now)) {
|
||||
ret = OB_EAGAIN;
|
||||
|
||||
14
deps/oblib/src/lib/signal/ob_signal_handlers.h
vendored
14
deps/oblib/src/lib/signal/ob_signal_handlers.h
vendored
@ -21,6 +21,20 @@ namespace oceanbase
|
||||
{
|
||||
namespace common
|
||||
{
|
||||
class ObSigFaststack
|
||||
{
|
||||
public:
|
||||
ObSigFaststack(const ObSigFaststack &) = delete;
|
||||
ObSigFaststack& operator=(const ObSigFaststack &) = delete;
|
||||
static ObSigFaststack &get_instance();
|
||||
inline int64_t get_min_interval() const { return min_interval_; }
|
||||
inline void set_min_interval(int64_t interval) { min_interval_ = interval; }
|
||||
private:
|
||||
ObSigFaststack();
|
||||
~ObSigFaststack();
|
||||
private:
|
||||
int64_t min_interval_;
|
||||
};
|
||||
extern int minicoredump(int sig, int64_t tid, pid_t& pid);
|
||||
extern int faststack();
|
||||
} // namespace common
|
||||
|
||||
Reference in New Issue
Block a user