/* Maximum size of a single RPC message that we will accept (8 MB). */
#define MAX_RPC_MSGSIZE (8 << 20)
+int threads;
+int completed = 0;
+
struct rpc_reply {
uint32_t xid;
uint32_t type;
}
info->end = now_hires();
- g_print("Call(XID = %d) duration: %"PRIi64" ns\n",
- xid, info->end - info->start);
+ printf("XID %d: Time = %"PRIi64"\n", xid, info->end - info->start);
if (info->callback != NULL)
info->callback(nfs, info->user_data);
g_hash_table_remove(nfs->xid_table, key);
g_free(info);
+
+ completed++;
+ if (completed == threads) {
+ g_main_loop_quit(main_loop);
+ }
}
static gboolean read_handler(GIOChannel *channel,
int i;
g_print("Sending requests...\n");
- for (i = 0; i < 64; i++) {
+ for (i = 0; i < threads; i++) {
char buf[64];
struct diropargs3 lookup;
uint64_t rootfh = GUINT64_TO_BE(1);
g_set_prgname("synclient");
g_print("Launching synthetic NFS RPC client...\n");
+ threads = 8;
+ if (argc > 1)
+ threads = atoi(argv[1]);
+
main_loop = g_main_loop_new(NULL, FALSE);
nfs_connect("niniel.sysnet.ucsd.edu");