0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-01-13 16:33:53 +01:00

ircd::info: Reorg / add some more info.

This commit is contained in:
Jason Volk 2018-12-18 15:58:15 -08:00
parent 0006fa85ce
commit bd5ecceb65
3 changed files with 36 additions and 25 deletions

View file

@ -39,7 +39,6 @@ namespace ircd::info
extern const string_view startup;
// System / platform information
extern const size_t page_size;
extern const size_t max_align;
extern const size_t hardware_concurrency;
extern const size_t destructive_interference;
@ -52,9 +51,11 @@ namespace ircd::info
extern const int glibc_version[3];
extern const string_view glibc_version_str;
extern const int aio_max_ops;
extern const int aio_reqprio_max;
extern const size_t page_size;
extern const size_t iov_max;
extern const size_t aio_max;
extern const size_t aio_reqprio_max;
extern const size_t clk_tck;
#ifdef HAVE_SYS_UTSNAME_H
extern const ::utsname utsname;
#endif

View file

@ -204,7 +204,7 @@ ircd::fs::aio::reqprio(int input)
input = std::max(input, 0);
// value is reduced to system maximum.
input = std::min(input, ircd::info::aio_reqprio_max);
input = std::min(input, int(ircd::info::aio_reqprio_max));
return input;
}

View file

@ -77,14 +77,16 @@ ircd::info::dump()
// This message flashes posix information about the resource limits
log::debug
{
"AS=%lu DATA=%lu RSS=%lu NOFILE=%lu; RTTIME=%lu aio_max_ops=%d aio_reqprio_max=%d",
"AS=%lu DATA=%lu RSS=%lu NOFILE=%lu; RTTIME=%lu iov_max=%zu aio_max=%zu aio_reqprio_max=%zu clk_tck=%zu",
rlimit_as,
rlimit_data,
rlimit_rss,
rlimit_nofile,
rlimit_rttime,
aio_max_ops,
iov_max,
aio_max,
aio_reqprio_max,
clk_tck
};
}
@ -200,20 +202,10 @@ ircd::info::glibc_version_str
glibc_version[2])
);
decltype(ircd::info::aio_max_ops)
ircd::info::aio_max_ops
decltype(ircd::info::page_size)
ircd::info::page_size
{
#ifdef _SC_AIO_MAX
int(syscall(::sysconf, _SC_AIO_MAX))
#endif
};
decltype(ircd::info::aio_reqprio_max)
ircd::info::aio_reqprio_max
{
#ifdef _SC_AIO_PRIO_DELTA_MAX
int(syscall(::sysconf, _SC_AIO_PRIO_DELTA_MAX))
#endif
size_t(syscall(::sysconf, _SC_PAGESIZE))
};
decltype(ircd::info::iov_max)
@ -224,6 +216,30 @@ ircd::info::iov_max
#endif
};
decltype(ircd::info::aio_max)
ircd::info::aio_max
{
#ifdef _SC_AIO_MAX
0 //size_t(syscall(::sysconf, _SC_AIO_MAX))
#endif
};
decltype(ircd::info::aio_reqprio_max)
ircd::info::aio_reqprio_max
{
#ifdef _SC_AIO_PRIO_DELTA_MAX
size_t(syscall(::sysconf, _SC_AIO_PRIO_DELTA_MAX))
#endif
};
decltype(ircd::info::clk_tck)
ircd::info::clk_tck
{
#ifdef _SC_CLK_TCK
size_t(syscall(::sysconf, _SC_CLK_TCK))
#endif
};
#ifdef HAVE_SYS_UTSNAME_H
decltype(ircd::info::utsname)
ircd::info::utsname{[]
@ -280,12 +296,6 @@ ircd::info::rlimit_rttime
_get_rlimit(RLIMIT_RTTIME)
};
decltype(ircd::info::page_size)
ircd::info::page_size
{
size_t(syscall(::sysconf, _SC_PAGESIZE))
};
decltype(ircd::info::max_align)
ircd::info::max_align
{