mirror of
https://github.com/matrix-construct/construct
synced 2024-06-02 01:59:33 +02:00
ircd::info: Involve utsname on supported; improve startup information.
This commit is contained in:
parent
5133553359
commit
1d9d5fab49
|
@ -440,6 +440,7 @@ RB_CHK_SYSHEADER(unistd.h, [UNISTD_H])
|
||||||
RB_CHK_SYSHEADER(sys/time.h, [SYS_TIME_H])
|
RB_CHK_SYSHEADER(sys/time.h, [SYS_TIME_H])
|
||||||
RB_CHK_SYSHEADER(sys/resource.h, [SYS_RESOURCE_H])
|
RB_CHK_SYSHEADER(sys/resource.h, [SYS_RESOURCE_H])
|
||||||
RB_CHK_SYSHEADER(sys/syscall.h, [SYS_SYSCALL_H])
|
RB_CHK_SYSHEADER(sys/syscall.h, [SYS_SYSCALL_H])
|
||||||
|
RB_CHK_SYSHEADER(sys/utsname.h, [SYS_UTSNAME_H])
|
||||||
|
|
||||||
dnl linux platform
|
dnl linux platform
|
||||||
RB_CHK_SYSHEADER(sys/eventfd.h, [SYS_EVENTFD_H])
|
RB_CHK_SYSHEADER(sys/eventfd.h, [SYS_EVENTFD_H])
|
||||||
|
|
|
@ -48,6 +48,10 @@ namespace ircd::info
|
||||||
extern const size_t destructive_interference;
|
extern const size_t destructive_interference;
|
||||||
extern const size_t constructive_interference;
|
extern const size_t constructive_interference;
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_UTSNAME_H
|
||||||
|
extern const ::utsname utsname;
|
||||||
|
#endif
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ extern "C"
|
||||||
#include <RB_INC_ASSERT_H
|
#include <RB_INC_ASSERT_H
|
||||||
#include <RB_INC_STDARG_H
|
#include <RB_INC_STDARG_H
|
||||||
#include <RB_INC_SYS_TIME_H
|
#include <RB_INC_SYS_TIME_H
|
||||||
|
#include <RB_INC_SYS_UTSNAME_H
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
155
ircd/info.cc
155
ircd/info.cc
|
@ -26,33 +26,56 @@ void
|
||||||
ircd::info::init()
|
ircd::info::init()
|
||||||
{
|
{
|
||||||
// This message flashes information about IRCd itself for this execution.
|
// This message flashes information about IRCd itself for this execution.
|
||||||
log::info("%s %ld %s. configured: %s; compiled: %s; executed: %s; %s",
|
log::info
|
||||||
BRANDING_VERSION,
|
{
|
||||||
__cplusplus,
|
"%s %ld %s. configured: %s; compiled: %s; executed: %s; %s",
|
||||||
__VERSION__,
|
BRANDING_VERSION,
|
||||||
configured,
|
__cplusplus,
|
||||||
compiled,
|
__VERSION__,
|
||||||
startup,
|
configured,
|
||||||
RB_DEBUG_LEVEL? "(DEBUG MODE)" : "");
|
compiled,
|
||||||
|
startup,
|
||||||
|
RB_DEBUG_LEVEL? "(DEBUG MODE)" : ""
|
||||||
|
};
|
||||||
|
|
||||||
// This message flashes information about our dependencies which are being
|
// This message flashes information about our dependencies which are being
|
||||||
// assumed for this execution.
|
// assumed for this execution.
|
||||||
log::info("%s. boost %u.%u.%u. rocksdb %s. sodium %s. %s.",
|
log::info
|
||||||
PACKAGE_STRING,
|
{
|
||||||
boost_version[0],
|
"%s. boost %u.%u.%u. rocksdb %s. sodium %s. %s.",
|
||||||
boost_version[1],
|
PACKAGE_STRING,
|
||||||
boost_version[2],
|
boost_version[0],
|
||||||
db::version,
|
boost_version[1],
|
||||||
nacl::version(),
|
boost_version[2],
|
||||||
openssl::version());
|
db::version,
|
||||||
|
nacl::version(),
|
||||||
|
openssl::version()
|
||||||
|
};
|
||||||
|
|
||||||
// This message flashes information about our dependencies which are being
|
// This message flashes posix information about the system and platform IRCd
|
||||||
// assumed for this execution.
|
// is running on when ::uname() is available
|
||||||
log::debug("max_align=%zu hardware_concurrency=%zu destructive_interference=%zu constructive_interference=%zu",
|
#ifdef HAVE_SYS_UTSNAME_H
|
||||||
max_align,
|
log::info
|
||||||
hardware_concurrency,
|
{
|
||||||
destructive_interference,
|
"%s %s %s %s %s",
|
||||||
constructive_interference);
|
utsname.sysname,
|
||||||
|
utsname.nodename,
|
||||||
|
utsname.release,
|
||||||
|
utsname.version,
|
||||||
|
utsname.machine
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// This message flashes standard information about the system and platform
|
||||||
|
// IRCd is compiled for and running on.
|
||||||
|
log::debug
|
||||||
|
{
|
||||||
|
"max_align=%zu hw_conc=%zu d_inter=%zu c_inter=%zu",
|
||||||
|
max_align,
|
||||||
|
hardware_concurrency,
|
||||||
|
destructive_interference,
|
||||||
|
constructive_interference
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX: integrate CREDITS text again somehow */
|
/* XXX: integrate CREDITS text again somehow */
|
||||||
|
@ -73,6 +96,10 @@ ircd::info::credits
|
||||||
" ",
|
" ",
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//
|
||||||
|
// IRCd / build information
|
||||||
|
//
|
||||||
|
|
||||||
decltype(ircd::info::configured_time)
|
decltype(ircd::info::configured_time)
|
||||||
ircd::info::configured_time
|
ircd::info::configured_time
|
||||||
{
|
{
|
||||||
|
@ -130,6 +157,10 @@ ircd::info::ircd_version
|
||||||
RB_VERSION
|
RB_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// Third party dependency information
|
||||||
|
//
|
||||||
|
|
||||||
/// Boost version indicator for compiled header files.
|
/// Boost version indicator for compiled header files.
|
||||||
decltype(ircd::info::boost_version)
|
decltype(ircd::info::boost_version)
|
||||||
ircd::info::boost_version
|
ircd::info::boost_version
|
||||||
|
@ -155,6 +186,52 @@ ircd::tc_version::tc_version()
|
||||||
{}
|
{}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// System / platform information
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_UTSNAME_H
|
||||||
|
decltype(ircd::info::utsname)
|
||||||
|
ircd::info::utsname{[]
|
||||||
|
{
|
||||||
|
struct ::utsname utsname;
|
||||||
|
syscall(::uname, &utsname);
|
||||||
|
return utsname;
|
||||||
|
}()};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
decltype(ircd::info::max_align)
|
||||||
|
ircd::info::max_align
|
||||||
|
{
|
||||||
|
alignof(std::max_align_t)
|
||||||
|
};
|
||||||
|
|
||||||
|
decltype(ircd::info::hardware_concurrency)
|
||||||
|
ircd::info::hardware_concurrency
|
||||||
|
{
|
||||||
|
std::thread::hardware_concurrency()
|
||||||
|
};
|
||||||
|
|
||||||
|
decltype(ircd::info::destructive_interference)
|
||||||
|
ircd::info::destructive_interference
|
||||||
|
{
|
||||||
|
#ifdef __cpp_lib_hardware_interference_size
|
||||||
|
std::hardware_destructive_interference_size
|
||||||
|
#else
|
||||||
|
0
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
decltype(ircd::info::constructive_interference)
|
||||||
|
ircd::info::constructive_interference
|
||||||
|
{
|
||||||
|
#ifdef __cpp_lib_hardware_interference_size
|
||||||
|
std::hardware_constructive_interference_size
|
||||||
|
#else
|
||||||
|
0
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
decltype(ircd::info::myinfo)
|
decltype(ircd::info::myinfo)
|
||||||
ircd::info::myinfo
|
ircd::info::myinfo
|
||||||
{{
|
{{
|
||||||
|
@ -272,35 +349,3 @@ ircd::info::myinfo
|
||||||
{"USE_IODEBUG_HOOKS", "NO", 0, "IO Debugging support"},
|
{"USE_IODEBUG_HOOKS", "NO", 0, "IO Debugging support"},
|
||||||
#endif
|
#endif
|
||||||
}};
|
}};
|
||||||
|
|
||||||
decltype(ircd::info::max_align)
|
|
||||||
ircd::info::max_align
|
|
||||||
{
|
|
||||||
alignof(std::max_align_t)
|
|
||||||
};
|
|
||||||
|
|
||||||
decltype(ircd::info::hardware_concurrency)
|
|
||||||
ircd::info::hardware_concurrency
|
|
||||||
{
|
|
||||||
std::thread::hardware_concurrency()
|
|
||||||
};
|
|
||||||
|
|
||||||
decltype(ircd::info::destructive_interference)
|
|
||||||
ircd::info::destructive_interference
|
|
||||||
{
|
|
||||||
#ifdef __cpp_lib_hardware_interference_size
|
|
||||||
std::hardware_destructive_interference_size
|
|
||||||
#else
|
|
||||||
0
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
decltype(ircd::info::constructive_interference)
|
|
||||||
ircd::info::constructive_interference
|
|
||||||
{
|
|
||||||
#ifdef __cpp_lib_hardware_interference_size
|
|
||||||
std::hardware_constructive_interference_size
|
|
||||||
#else
|
|
||||||
0
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in a new issue