47 size_t len = strlen(str) + 1;
51 return strncpy(
copy, str, len);
62 fprintf(stderr,
"%s, error %d: %s\n",
s, code, strerror(-code));
100 { .max = 1ul << 20, .name =
"KiB" },
101 { .max = 1ul << 30, .name =
"MiB" },
102 { .max = 1ul << 40, .name =
"GiB" },
103 { .max = 1ul << 50, .name =
"TiB" },
104 { .max = 1ul << 60, .name =
"PiB" },
105 { .max = ULONG_MAX, .name =
"EiB" },
108 if (bsize < 1023.5) {
112 if (bsize < suffix[
i].
max - .5)
115 bsize /= suffix[
i].max / (1 << 10);
116 fmt = bsize < 9.995 ?
"%4.2f%s" :
117 bsize < 99.95 ?
"%4.1f%s" :
"%4.0f%s";
134 "m0_net_domain_get_max_buffer_size() = %lu\n",
137 "m0_net_domain_get_max_buffer_segments() = %i\n",
140 "m0_net_domain_get_max_buffer_segment_size() = %lu\n",
147 for (
i = 0; nidstrs !=
NULL && nidstrs[
i] !=
NULL; ++
i)
159 return vprintf(
fmt, argp);
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_segment_size(struct m0_net_domain *dom)
int m0_net_test_u_printf_v(const char *fmt,...)
void m0_net_domain_fini(struct m0_net_domain *dom)
void m0_net_test_u_print_bsize(double bsize)
bool m0_net_test_u_printf_verbose
uint64_t m0_time_nanoseconds(const m0_time_t time)
static struct m0t1fs_fsync_interactions copy
void m0_net_test_u_lnet_info(void)
void m0_net_test_u_print_time(char *name, m0_time_t time)
int m0_net_test_u_printf(const char *fmt,...)
M0_INTERNAL int m0_net_lnet_ifaces_get(struct m0_net_domain *dom, char ***addrs)
static struct m0_stob_domain * dom
static long long max(long long a, long long b)
struct m0_net_xprt * m0_net_xprt_default_get(void)
char * fmt(const char *format,...) __attribute__((format(printf
void * m0_alloc(size_t size)
M0_INTERNAL void m0_net_lnet_ifaces_put(struct m0_net_domain *dom, char ***addrs)
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_size(struct m0_net_domain *dom)
uint64_t m0_time_seconds(const m0_time_t time)
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
void m0_net_test_u_print_error(const char *s, int code)
void m0_net_test_u_print_s(const char *fmt, const char *str)
M0_INTERNAL int32_t m0_net_domain_get_max_buffer_segments(struct m0_net_domain *dom)
void m0_net_test_u_str_free(char *str)
char * m0_net_test_u_str_copy(const char *str)
static struct m0_addb2_source * s
static int net_test_u_printf(bool _verbose, const char *fmt, va_list argp)