Skip to content

Commit 6599462

Browse files
author
zhixin.lm
committed
Merge branch 'github_master'
2 parents 0b15ca0 + 5d12517 commit 6599462

File tree

10 files changed

+38
-5
lines changed

10 files changed

+38
-5
lines changed

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@
6262
AM_CFLAGS="${AM_CFLAGS} -fuse-ld=lld -ffunction-sections -Wl,--no-warn-symbol-ordering,--symbol-ordering-file,${ac_abs_confdir}/hotfuncs.txt"
6363
fi
6464

65+
#check el9, add -DEL9_PlATFORM for el9
66+
is_el9=`cat /proc/version | grep el9`
67+
if test "$is_el9" != ""; then
68+
AM_CXXFLAGS="${AM_CXXFLAGS} -DEL9_PLATFORM"
69+
AM_CFLAGS="${AM_CFLAGS} -DEL9_PLATFORM"
70+
fi
71+
6572
#check gcc version, add -Wno-ignored-qualifiers flag for gcc version greater than 4.3.0
6673
GCC_VERSION=`$CC -dumpfullversion -dumpversion`
6774
if test $? -eq 0; then

deps/3rd/dep_create.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ function get_os_release() {
5656
version_ge "8.0" && OS_RELEASE=8 && return
5757
version_ge "7.0" && OS_RELEASE=7 && return
5858
;;
59+
almalinux)
60+
version_ge "8.0" && compat_centos8 && return
61+
;;
5962
debian)
6063
version_ge "9" && compat_centos7 && return
6164
;;

src/lib/allocator/ob_mod_define.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,16 @@ void ObModSet::print_mod_memory_usage(bool print_glibc) const
9494
_OB_LOG(INFO, "=== malloc_stats ===");
9595
malloc_stats();
9696
_OB_LOG(INFO, "=== main heap info ===");
97+
#ifdef EL9_PLATFORM
98+
struct mallinfo2 info = mallinfo2();
99+
_OB_LOG(INFO, "mmap_chunks=%ld", info.hblks);
100+
_OB_LOG(INFO, "mmap_bytes=%ld", info.hblkhd);
101+
_OB_LOG(INFO, "sbrk_sys_bytes=%ld", info.arena);
102+
_OB_LOG(INFO, "sbrk_used_chunk_bytes=%ld", info.uordblks);
103+
_OB_LOG(INFO, "sbrk_not_in_use_chunks=%ld", info.ordblks);
104+
_OB_LOG(INFO, "sbrk_not_in_use_chunk_bytes=%ld", info.fordblks);
105+
_OB_LOG(INFO, "sbrk_top_most_releasable_chunk_bytes=%ld", info.keepcost);
106+
#else
97107
struct mallinfo info = mallinfo();
98108
_OB_LOG(INFO, "mmap_chunks=%d", info.hblks);
99109
_OB_LOG(INFO, "mmap_bytes=%d", info.hblkhd);
@@ -102,7 +112,9 @@ void ObModSet::print_mod_memory_usage(bool print_glibc) const
102112
_OB_LOG(INFO, "sbrk_not_in_use_chunks=%d", info.ordblks);
103113
_OB_LOG(INFO, "sbrk_not_in_use_chunk_bytes=%d", info.fordblks);
104114
_OB_LOG(INFO, "sbrk_top_most_releasable_chunk_bytes=%d", info.keepcost);
115+
#endif
105116
_OB_LOG(INFO, "=== detailed malloc_info ===");
117+
106118
//malloc_info(0, stderr);
107119
}
108120
ObObjFreeListList::get_freelists().dump();

src/lib/ob_define.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,14 +1225,14 @@ inline void reset_tid_cache()
12251225
get_tid_cache() = -1;
12261226
}
12271227

1228-
inline int64_t gettid()
1228+
inline int64_t gettid_ob()
12291229
{
12301230
int64_t &tid = get_tid_cache();
12311231
if (OB_UNLIKELY(tid <= 0)) {
12321232
tid = static_cast<int64_t>(syscall(__NR_gettid));
12331233
}
12341234
return tid;
12351235
}
1236-
#define GETTID() gettid()
1236+
#define GETTID() gettid_ob()
12371237

12381238
#endif // OCEANBASE_COMMON_DEFINE_H_

src/lib/random/ob_random.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int64_t ObRandom::rand(const int64_t a, const int64_t b)
3535
{
3636
static __thread uint16_t seed[3] = {0, 0, 0};
3737
if (0 == seed[0] && 0 == seed[1] && 0 == seed[2]) {
38-
seed[0] = static_cast<uint16_t>(gettid());
38+
seed[0] = static_cast<uint16_t>(GETTID());
3939
seed[1] = seed[0];
4040
seed[2] = seed[1];
4141
seed48(seed);

src/obproxy/cmd/ob_show_memory_handler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ int ObShowMemoryHandler::handle_show_memory(int event, void *data)
111111
}
112112
if (OB_SUCC(ret)) {
113113
// dump memory allocated by glibc
114+
#ifdef EL9_PLATFORM
115+
struct mallinfo2 mi = mallinfo2();
116+
#else
114117
struct mallinfo mi = mallinfo();
118+
#endif
115119
int64_t allocated = mi.arena + mi.hblkhd;
116120
int64_t used = allocated - mi.fordblks;
117121
if (OB_FAIL(dump_mod_memory("GLIBC", "user", allocated, used, mi.hblks))) {

src/obproxy/ob_proxy_main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,11 @@ void ObProxyMain::print_memory_usage()
912912

913913
void ObProxyMain::print_glibc_memory_usage()
914914
{
915+
#ifdef EL9_PLATFORM
916+
struct mallinfo2 mi = mallinfo2();
917+
#else
915918
struct mallinfo mi = mallinfo();
919+
#endif
916920
int64_t hold = mi.arena + mi.hblkhd;
917921
int64_t used = hold - mi.fordblks;
918922
int64_t count = mi.hblks;

src/obproxy/proxy/mysql/ob_mysql_client_session.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int ObMysqlClientSession::new_connection(
296296
session_manager_new_.set_mutex(mutex_);
297297
MUTEX_TRY_LOCK(lock, mutex_, this_ethread());
298298
if (OB_LIKELY(lock.is_locked())) {
299-
current_tid_ = gettid();
299+
current_tid_ = GETTID();
300300
hooks_on_ = true;
301301

302302
MYSQL_INCREMENT_DYN_STAT(CURRENT_CLIENT_CONNECTIONS);

src/obproxy/proxy/route/ob_cache_cleaner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ int ObCacheCleaner::do_delete_cluster_resource()
992992
cr->destroy();
993993
}
994994
LOG_INFO("this thread has clean cluster resource complete",
995-
"thread_id", gettid(), KPC(cr));
995+
"thread_id", GETTID(), KPC(cr));
996996
cr_actor->free(); // will dec cr ref
997997
cr_actor = NULL;
998998
cr = NULL;

src/obproxy/utils/ob_proxy_lib.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ struct ifafilt;
9191
typedef unsigned int in_addr_t;
9292
#endif
9393
#include <sys/sysinfo.h>
94+
#ifdef EL9_PLATFORM
95+
#else
9496
#include <sys/sysctl.h>
97+
#endif
9598
#include <dlfcn.h>
9699
#include <math.h>
97100
#include <float.h>

0 commit comments

Comments
 (0)