projects
/
bluesky.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hook John's kvstore up to the BlueSky implementation.
[bluesky.git]
/
nfs3
/
synclient.c
diff --git
a/nfs3/synclient.c
b/nfs3/synclient.c
index
d96ae13
..
4db3cc8
100644
(file)
--- a/
nfs3/synclient.c
+++ b/
nfs3/synclient.c
@@
-35,6
+35,9
@@
/* Maximum size of a single RPC message that we will accept (8 MB). */
#define MAX_RPC_MSGSIZE (8 << 20)
/* 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;
struct rpc_reply {
uint32_t xid;
uint32_t type;
@@
-173,13
+176,17
@@
static void process_reply(NFSConnection *nfs, GString *msg)
}
info->end = now_hires();
}
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);
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,
}
static gboolean read_handler(GIOChannel *channel,
@@
-266,7
+273,7
@@
static gboolean idle_handler(gpointer data)
int i;
g_print("Sending requests...\n");
int i;
g_print("Sending requests...\n");
- for (i = 0; i <
8
; i++) {
+ for (i = 0; i <
threads
; i++) {
char buf[64];
struct diropargs3 lookup;
uint64_t rootfh = GUINT64_TO_BE(1);
char buf[64];
struct diropargs3 lookup;
uint64_t rootfh = GUINT64_TO_BE(1);
@@
-336,6
+343,10
@@
int main(int argc, char *argv[])
g_set_prgname("synclient");
g_print("Launching synthetic NFS RPC client...\n");
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");
main_loop = g_main_loop_new(NULL, FALSE);
nfs_connect("niniel.sysnet.ucsd.edu");