2 #include <aura/private.h>
4 static char *randstring(
size_t length) {
6 static char charset[] =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,.-#'?!";
7 char *randomString = NULL;
10 randomString = malloc(
sizeof(
char) * (length +1));
14 for (n = 0;n < length;n++) {
15 int key = rand() % (int)(
sizeof(charset) -1);
16 randomString[n] = charset[key];
19 randomString[length] =
'\0';
26 static int num_methods = 8192;
27 static int dummy_open(
struct aura_node *node,
const char *opts)
29 num_methods = atoi(opts);
31 BUG(node,
"Bad opts for bench transort");
32 slog(1, SLOG_INFO,
"Opening lookup-bench transport, %d methods", num_methods);
37 static void dummy_populate_etable(
struct aura_node *node)
39 struct aura_export_table *etbl = aura_etable_create(node, num_methods);
41 BUG(node,
"Failed to create etable");
46 char *tmp = randstring(16);
47 aura_etable_add(etbl, tmp,
"1",
"1");
51 aura_etable_activate(etbl);
54 static void dummy_close(
struct aura_node *node)
56 slog(1, SLOG_INFO,
"Closing lookup-bench transport");
59 static void dummy_loop(
struct aura_node *node,
const struct aura_pollfds *fd)
62 if (node->status != AURA_STATUS_ONLINE) {
63 dummy_populate_etable(node);
78 slog(0, SLOG_DEBUG,
"dummy: serializing buf 0x%x", buf);
79 uint64_t ptr = (uintptr_t) buf;
86 slog(0, SLOG_DEBUG,
"dummy: deserializing buf 0x%x", ret);
95 .buffer_overhead = 16,
97 .buffer_get = dummy_buffer_get,
98 .buffer_put = dummy_buffer_put,
100 AURA_TRANSPORT(bench);
void aura_set_status(struct aura_node *node, int status)
struct aura_buffer * aura_dequeue_buffer(struct list_head *head)
const char * name
Required.
struct aura_eventloop * aura_eventloop_get_data(struct aura_node *node)
void aura_buffer_put_u64(struct aura_buffer *buf, uint64_t value)
Put an unsigned 64 bit integer to aura buffer.
uint64_t aura_buffer_get_u64(struct aura_buffer *buf)
Get an unsigned 64 bit integer from aura buffer.
void aura_queue_buffer(struct list_head *list, struct aura_buffer *buf)