diff --git a/deps/oblib/src/lib/oblog/ob_log.cpp b/deps/oblib/src/lib/oblog/ob_log.cpp index b461c25d3..fa6326cf0 100644 --- a/deps/oblib/src/lib/oblog/ob_log.cpp +++ b/deps/oblib/src/lib/oblog/ob_log.cpp @@ -337,6 +337,8 @@ ProbeAction probe_str2action(const char *str) action = ProbeAction::PROBE_BT; } else if (0 == strcmp(str, "abort")) { action = ProbeAction::PROBE_ABORT; + } else if (0 == strcmp(str, "disable")) { + action = ProbeAction::PROBE_DISABLE; } return action; } @@ -353,6 +355,10 @@ const char *probe_action2str(ProbeAction action) str = "abort"; break; } + case ProbeAction::PROBE_DISABLE: { + str = "disable"; + break; + } default: { str = "none"; break; diff --git a/deps/oblib/src/lib/oblog/ob_log.h b/deps/oblib/src/lib/oblog/ob_log.h index 353d78641..de31f7863 100644 --- a/deps/oblib/src/lib/oblog/ob_log.h +++ b/deps/oblib/src/lib/oblog/ob_log.h @@ -235,6 +235,7 @@ enum class ProbeAction PROBE_NONE, PROBE_BT, PROBE_ABORT, + PROBE_DISABLE, }; //@class ObLogger @@ -724,10 +725,11 @@ private: const uint64_t location_hash_val, Function &&log_data_func); void check_probe( - const char *file, + const char* file, int32_t line, const uint64_t location_hash_val, - bool &force_bt); + bool& force_bt, + bool& disable); private: static const char *const errstr_[]; // default log rate limiter if there's no tl_log_limiger @@ -1071,12 +1073,14 @@ inline int ObLogger::set_mod_log_levels(const char *level_str, int64_t version) extern void __attribute__ ((noinline)) on_probe_abort(); inline void ObLogger::check_probe( - const char *file, + const char* file, int32_t line, const uint64_t location_hash_val, - bool &force_bt) + bool& force_bt, + bool& disable) { force_bt = false; + disable = false; for (int i = 0; i < probe_cnt_; i++) { auto &probe = probes_[i]; if (location_hash_val == probe.location_hash_val_ && @@ -1089,9 +1093,23 @@ inline void ObLogger::check_probe( filename++; } if (0 == strncmp(filename, probe.file_, sizeof probe.file_)) { - force_bt = ProbeAction::PROBE_BT == probe.action_; - if (ProbeAction::PROBE_ABORT == probe.action_) { - on_probe_abort(); + switch (probe.action_) { + case ProbeAction::PROBE_BT: { + force_bt = true; + break; + } + case ProbeAction::PROBE_ABORT: { + on_probe_abort(); + break; + } + case ProbeAction::PROBE_DISABLE: { + disable = true; + break; + } + default: { + // do nothing + break; + } } break; } @@ -1117,7 +1135,9 @@ inline void ObLogger::do_log_message(const bool is_async, bool allow = true; bool force_bt = false; - check_probe(file, line, location_hash_val, force_bt); + bool disable = false; + check_probe(file, line, location_hash_val, force_bt, disable); + if(OB_UNLIKELY(disable)) return; const int64_t logging_time_us_begin = get_cur_us(); auto fd_type = get_fd_type(mod_name); if (OB_FAIL(precheck_tl_log_limiter(level, allow))) { diff --git a/deps/oblib/src/lib/utility/ob_tracepoint.h b/deps/oblib/src/lib/utility/ob_tracepoint.h index 8e9ca1f2c..b98963ab7 100644 --- a/deps/oblib/src/lib/utility/ob_tracepoint.h +++ b/deps/oblib/src/lib/utility/ob_tracepoint.h @@ -25,6 +25,7 @@ #include "lib/alloc/alloc_assist.h" #include "lib/list/ob_dlist.h" #include "lib/coro/co_var.h" +#include "lib/time/ob_tsc_timestamp.h" #define TP_COMMA(x) , #define TP_EMPTY(x) @@ -218,7 +219,9 @@ struct EventItem ret = 0; } else if (trigger_freq_ == 1) { ret = static_cast(error_code_); - COMMON_LOG(WARN, "[ERRSIM] sim error", K(ret)); + if (REACH_TIME_INTERVAL(1 * 1000 * 1000)) { + COMMON_LOG(WARN, "[ERRSIM] sim error", K(ret)); + } } else { if (rand() % trigger_freq_ == 0) { ret = static_cast(error_code_); diff --git a/tools/deploy/obd/obdtest.config.yaml.template b/tools/deploy/obd/obdtest.config.yaml.template index 9184aa1b6..ac04a06ca 100644 --- a/tools/deploy/obd/obdtest.config.yaml.template +++ b/tools/deploy/obd/obdtest.config.yaml.template @@ -23,13 +23,11 @@ datafile_size: '60G' system_memory: '15G' cpu_count: '16' - stack_size: '512K' cache_wash_threshold: '1G' __min_full_resource_pool_memory: "1073741824" workers_per_cpu_quota: '10' schema_history_expire_time: '1d' net_thread_count: '4' - enable_async_syslog: False {{%% EXTRA_PARAM %%}} {{%% PROXY_CONF %%}} diff --git a/tools/deploy/obd/observer.include.yaml b/tools/deploy/obd/observer.include.yaml index c86d3e4d8..3e7d03891 100644 --- a/tools/deploy/obd/observer.include.yaml +++ b/tools/deploy/obd/observer.include.yaml @@ -23,11 +23,9 @@ config: memory_limit: '8G' system_memory: '1G' cpu_count: '24' - stack_size: '512K' cache_wash_threshold: '1G' __min_full_resource_pool_memory: "1073741824" workers_per_cpu_quota: '10' schema_history_expire_time: '1d' net_thread_count: '4' syslog_io_bandwidth_limit: '10G' - enable_async_syslog: 'FALSE'