Skip to content

Commit

Permalink
Rename BRPC_VALIDATE_GFLAG to BUTIL_VALIDATE_GFLAG
Browse files Browse the repository at this point in the history
  • Loading branch information
chenBright committed Dec 20, 2024
1 parent 4b4a974 commit f6b9aa0
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/brpc/reloadable_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#include "butil/reloadable_flags.h"

#define BRPC_VALIDATE_GFLAG(flag, validate_fn) BUTIL_VALIDATE_GFLAG(flag, validate_fn)

namespace brpc {

extern bool PassValidate(const char*, bool);
Expand Down
2 changes: 0 additions & 2 deletions src/bthread/bthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
#include "bthread/id.h"

#if defined(__cplusplus) && defined(BRPC_BTHREAD_TRACER)
#include "butil/resource_pool.h"
#include "bthread/task_meta.h"
namespace bthread {
// Assign a TaskMeta to the pthread and set the state to Running,
// so that `stack_trace()' can trace the call stack of the pthread.
Expand Down
2 changes: 1 addition & 1 deletion src/bthread/task_tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace bthread {

DEFINE_bool(enable_fast_unwind, true, "Whether to enable fast unwind");
DEFINE_uint32(signal_trace_timeout_ms, 50, "Timeout for signal trace in ms");
BRPC_VALIDATE_GFLAG(signal_trace_timeout_ms, butil::PositiveInteger<uint32_t>);
BUTIL_VALIDATE_GFLAG(signal_trace_timeout_ms, butil::PositiveInteger<uint32_t>);

extern BAIDU_THREAD_LOCAL TaskMeta* pthread_fake_meta;

Expand Down
2 changes: 1 addition & 1 deletion src/butil/reloadable_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
// This macro does not work for string-flags because they're thread-unsafe to
// modify directly. To emphasize this, you have to write the validator by
// yourself and use GFLAGS_NS::GetCommandLineOption() to acess the flag.
#define BRPC_VALIDATE_GFLAG(flag, validate_fn) \
#define BUTIL_VALIDATE_GFLAG(flag, validate_fn) \
namespace butil_flags {} \
const int register_FLAGS_ ## flag ## _dummy \
__attribute__((__unused__)) = \
Expand Down
2 changes: 1 addition & 1 deletion src/butil/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ class Timer {
};

Timer() : _stop(0), _start(0) {}
explicit Timer(const TimerType) {
explicit Timer(const TimerType) : Timer() {
start();
}

Expand Down
4 changes: 2 additions & 2 deletions test/bthread_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ TEST_F(BthreadTest, trace) {
stop = false;
bthread_t th;
ASSERT_EQ(0, bthread_start_urgent(&th, NULL, spin_and_log, (void*)1));
usleep(10 * 1000);
usleep(100 * 1000);
bthread::FLAGS_enable_fast_unwind = false;
std::string st = bthread::stack_trace(th);
LOG(INFO) << "fast_unwind spin_and_log stack trace:\n" << st;
Expand All @@ -641,7 +641,7 @@ TEST_F(BthreadTest, trace) {
usleep(100 * 1000);
bthread::FLAGS_enable_fast_unwind = false;
st = bthread::stack_trace(th);
LOG(INFO) << "repeated_sleep stack trace:\n" << st;
LOG(INFO) << "fast_unwind repeated_sleep stack trace:\n" << st;
ASSERT_NE(std::string::npos, st.find("repeated_sleep"));

bthread::FLAGS_enable_fast_unwind = true;
Expand Down

0 comments on commit f6b9aa0

Please sign in to comment.