0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd::info: Attempt to grab mlock rlimit; reorg log facilities and info dump.

This commit is contained in:
Jason Volk 2019-08-13 03:11:42 -07:00
parent 672ce5c3c6
commit 6333c94fe0
2 changed files with 44 additions and 13 deletions

View file

@ -43,6 +43,7 @@ namespace ircd::info
extern const size_t rlimit_rss; extern const size_t rlimit_rss;
extern const size_t rlimit_nofile; extern const size_t rlimit_nofile;
extern const size_t rlimit_rttime; extern const size_t rlimit_rttime;
extern const size_t rlimit_memlock;
// Host & third-party information // Host & third-party information
#ifdef HAVE_SYS_UTSNAME_H #ifdef HAVE_SYS_UTSNAME_H

View file

@ -41,7 +41,8 @@ ircd::info::dump()
// This message flashes information about IRCd itself for this execution. // This message flashes information about IRCd itself for this execution.
log::info log::info
{ {
"%s configured: %s; compiled: %s; executed: %s; %s", log::star, "%s %s configured: %s; compiled: %s; executed: %s; %s",
BRANDING_NAME,
BRANDING_VERSION, BRANDING_VERSION,
configured, configured,
compiled, compiled,
@ -52,7 +53,7 @@ ircd::info::dump()
// This message flashes information about our API dependencies from compile time. // This message flashes information about our API dependencies from compile time.
log::info log::info
{ {
"SD-6 %s. glibcxx %s. glibc %s. boost %s. RocksDB %s. sodium %s. %s. magic %ld.", log::star, "SD-6 %s. glibcxx %s. glibc %s. boost %s. RocksDB %s. sodium %s. %s. magic %ld.",
string_view{sd6_version}, string_view{sd6_version},
string_view{glibcxx_version_api}, string_view{glibcxx_version_api},
string_view{glibc_version_api}, string_view{glibc_version_api},
@ -66,7 +67,7 @@ ircd::info::dump()
// This message flashes information about our ABI dependencies on this system. // This message flashes information about our ABI dependencies on this system.
log::info log::info
{ {
"Linked: glibc %s. boost %s. RocksDB %s. sodium %s. %s. magic %ld.", log::star, "Linked: glibc %s. boost %s. RocksDB %s. sodium %s. %s. magic %ld.",
string_view{glibc_version_abi}, string_view{glibc_version_abi},
string_view{boost_version_abi}, string_view{boost_version_abi},
string_view{db::version_abi}, string_view{db::version_abi},
@ -75,12 +76,24 @@ ircd::info::dump()
long(magic::version_abi), long(magic::version_abi),
}; };
#ifdef RB_DEBUG
log::logf
{
log::star, log::DEBUG,
"page_size=%zu iov_max=%zu aio_max=%zu aio_reqprio_max=%zu",
page_size,
iov_max,
aio_max,
aio_reqprio_max,
};
#endif
// This message flashes posix information about the system and platform IRCd // This message flashes posix information about the system and platform IRCd
// is running on when ::uname() is available // is running on when ::uname() is available
#ifdef HAVE_SYS_UTSNAME_H #ifdef HAVE_SYS_UTSNAME_H
log::info log::info
{ {
"%s %s %s %s %s", log::star, "%s %s %s %s %s",
utsname.sysname, utsname.sysname,
utsname.nodename, utsname.nodename,
utsname.release, utsname.release,
@ -90,22 +103,22 @@ ircd::info::dump()
#endif #endif
// This message flashes posix information about the resource limits // This message flashes posix information about the resource limits
log::debug #ifdef RB_DEBUG
log::logf
{ {
"AS=%lu DATA=%lu RSS=%lu NOFILE=%lu; RTTIME=%lu" log::star, log::DEBUG,
" page_size=%zu iov_max=%zu aio_max=%zu aio_reqprio_max=%zu", "rlimit AS=%lu DATA=%lu RSS=%lu NOFILE=%lu RTTIME=%lu MEMLOCK=%lu",
rlimit_as, rlimit_as,
rlimit_data, rlimit_data,
rlimit_rss, rlimit_rss,
rlimit_nofile, rlimit_nofile,
rlimit_rttime, rlimit_rttime,
page_size, rlimit_memlock,
iov_max,
aio_max,
aio_reqprio_max,
}; };
#endif
dump_cpu_info(); dump_cpu_info();
} }
// //
@ -421,6 +434,14 @@ _get_rlimit(const int &resource)
} }
#endif #endif
decltype(ircd::info::rlimit_memlock)
ircd::info::rlimit_memlock
{
#ifdef RLIMIT_MEMLOCK
_get_rlimit(RLIMIT_MEMLOCK)
#endif
};
decltype(ircd::info::rlimit_rttime) decltype(ircd::info::rlimit_rttime)
ircd::info::rlimit_rttime ircd::info::rlimit_rttime
{ {
@ -703,7 +724,7 @@ ircd::info::dump_cpu_info()
#if defined(__i386__) or defined(__x86_64__) #if defined(__i386__) or defined(__x86_64__)
log::info log::info
{ {
"%s mmx:%b sse:%b sse2:%b sse3:%b ssse3:%b sse4.1:%b sse4.2:%b avx:%b avx2:%b", log::star, "%s mmx:%b sse:%b sse2:%b sse3:%b ssse3:%b sse4.1:%b sse4.2:%b avx:%b avx2:%b",
hardware::x86::vendor, hardware::x86::vendor,
hardware::x86::mmx, hardware::x86::mmx,
hardware::x86::sse, hardware::x86::sse,
@ -718,17 +739,24 @@ ircd::info::dump_cpu_info()
#endif #endif
// This message flashes language standard information about this platform // This message flashes language standard information about this platform
log::debug #ifdef RB_DEBUG
log::logf
{ {
log::star, log::DEBUG,
"max_align=%zu hw_conc=%zu d_inter=%zu c_inter=%zu", "max_align=%zu hw_conc=%zu d_inter=%zu c_inter=%zu",
hardware::max_align, hardware::max_align,
hardware::hardware_concurrency, hardware::hardware_concurrency,
hardware::destructive_interference, hardware::destructive_interference,
hardware::constructive_interference, hardware::constructive_interference,
}; };
#endif
if(!ircd::debugmode)
return;
log::debug log::debug
{ {
log::star,
"0..00 STD MANUFAC [%08x|%08x|%08x|%08x] " "0..00 STD MANUFAC [%08x|%08x|%08x|%08x] "
"0..01 STD FEATURE [%08x|%08x|%08x|%08x]", "0..01 STD FEATURE [%08x|%08x|%08x|%08x]",
uint32_t(hardware::x86::manufact >> 0), uint32_t(hardware::x86::manufact >> 0),
@ -743,6 +771,7 @@ ircd::info::dump_cpu_info()
log::debug log::debug
{ {
log::star,
"8..00 EXT MANUFAC [%08x|%08x|%08x|%08x] " "8..00 EXT MANUFAC [%08x|%08x|%08x|%08x] "
"8..01 EXT FEATURE [%08x|%08x|%08x|%08x]", "8..01 EXT FEATURE [%08x|%08x|%08x|%08x]",
uint32_t(hardware::x86::_manufact >> 0), uint32_t(hardware::x86::_manufact >> 0),
@ -757,6 +786,7 @@ ircd::info::dump_cpu_info()
log::debug log::debug
{ {
log::star,
"8..07 EXT APMI [%08x|%08x|%08x|%08x] " "8..07 EXT APMI [%08x|%08x|%08x|%08x] "
"8..1C EXT LWPROF [%08x|%08x|%08x|%08x]", "8..1C EXT LWPROF [%08x|%08x|%08x|%08x]",
uint32_t(hardware::x86::_apmi >> 0), uint32_t(hardware::x86::_apmi >> 0),