From: Jens Axboe Date: Tue, 4 Oct 2011 11:46:08 +0000 (+0200) Subject: server: more debug dumping X-Git-Tag: fio-1.99~28 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=39e8e01691c9d5765795417ee49a40d5ae08cb8b server: more debug dumping Signed-off-by: Jens Axboe --- diff --git a/client.c b/client.c index 4d233415..fd9727e8 100644 --- a/client.c +++ b/client.c @@ -75,7 +75,7 @@ static struct fio_client *find_client_by_name(const char *name) static void remove_client(struct fio_client *client) { - dprint(FD_NET, "removed client <%s>\n", client->hostname); + dprint(FD_NET, "client: removed <%s>\n", client->hostname); flist_del(&client->list); nr_clients--; @@ -89,9 +89,12 @@ static void remove_client(struct fio_client *client) static void __fio_client_add_cmd_option(struct fio_client *client, const char *opt) { - client->argc++; + int index; + + index = client->argc++; client->argv = realloc(client->argv, sizeof(char *) * client->argc); - client->argv[client->argc - 1] = strdup(opt); + client->argv[index] = strdup(opt); + dprint(FD_NET, "client: add cmd %d: %s\n", index, opt); } void fio_client_add_cmd_option(const char *hostname, const char *opt) @@ -114,7 +117,7 @@ void fio_client_add(const char *hostname) { struct fio_client *client; - dprint(FD_NET, "added client <%s>\n", hostname); + dprint(FD_NET, "client: added <%s>\n", hostname); client = malloc(sizeof(*client)); memset(client, 0, sizeof(*client)); @@ -131,7 +134,7 @@ static int fio_client_connect(struct fio_client *client) { int fd; - dprint(FD_NET, "connect to host %s\n", client->hostname); + dprint(FD_NET, "client: connect to host %s\n", client->hostname); memset(&client->addr, 0, sizeof(client->addr)); client->addr.sin_family = AF_INET; @@ -214,7 +217,7 @@ static int send_client_cmd_line(struct fio_client *client) struct cmd_line_pdu *pdu; int i, ret; - dprint(FD_NET, "client: send cmdline\n"); + dprint(FD_NET, "client: send cmdline %d\n", client->argc); pdu = malloc(sizeof(*pdu)); for (i = 0; i < client->argc; i++) diff --git a/server.c b/server.c index 6a228ce2..4c12f65c 100644 --- a/server.c +++ b/server.c @@ -299,8 +299,12 @@ static int handle_jobline_cmd(struct fio_net_cmd *cmd) pdu->argc = le16_to_cpu(pdu->argc); - for (i = 0; i < pdu->argc; i++) + dprint(FD_NET, "server: %d command line args\n", pdu->argc); + + for (i = 0; i < pdu->argc; i++) { argv[i] = (char *) pdu->argv[i]; + dprint(FD_NET, "server: %d: %s\n", i, argv[i]); + } if (parse_cmd_line(pdu->argc, argv)) return -1;