cifs-load-gen (cifs_bm) failure-analysis improvements
Yuval Yeret
yuvaly at disksites.com
Tue Feb 7 08:50:55 GMT 2006
Hi,
I'm attaching a patch which in my opinion improves the ability to
troubleshoot results of cifs_bm runs, and a sample output.
The fact that the tool uses printf for errors instead of the samba error
infrastructure is unfortunate, but a reasonable solution for me was to
at least provide CLIENTid, line, and thread information whenever a
thread decides to abort.
The patch is self-explanatory I think...
Feel free to take, apply, or disregard.
Yuval
[user at host source]$ bin/cifs_bm -c ./clients/client_plain.txt //ip/share
-Wdomain -Uuser%password -N 2 -O
CLIENT0 - Sleeping for 3 seconds
CLIENT1 - Sleeping for 0 seconds
CLIENT1 - child cmd_info: B75AC1A4
CLIENT0 - child cmd_info: B75AC000
2 clients started
WARNING: Cleaned up 6 files
WARNING: Cleaned up 9 files
ERROR: cli_nt_create_full failed for \clients\client0\filler.002 -
SUCCESS - 0
2006/02/07 10:49:41: ERROR: process 16554 aborting for CLIENT0 on
command NTCreateX in line 88
(52) ERROR: write failed on handle 12121, fd 5293 errno 104 (Connection
reset by peer) (SUCCESS - 0)
File: \clients\client1\filler.001. Asked for 1 bytes, got 0 bytes
2006/02/07 10:49:41: ERROR: process 16555 aborting for CLIENT1 on
command WriteX in line 52
Throughput 1.07004 MB/sec
Total bytes read : 0
Total bytes written: 3145731
Total RO file opens: 0
Total WO file opens: 9
Total RW file opens: 0
cmd_info: B75AC000
cmd_info: B75AC1A4
diff -r base/source/include/proto.h newversion/source/include/proto.h
280,282c280,282
< void nb_setup(struct cli_state *cli);
< void nb_unlink(char *fname);
< void nb_createx(char *fname,
---
> int nb_setup(struct cli_state *cli);
> int nb_unlink(char *fname);
> int nb_createx(char *fname,
284,295c284,295
< void nb_writex(int handle, int offset, int size, int ret_size);
< void nb_readx(int handle, int offset, int size, int ret_size);
< void nb_close(int handle);
< void nb_rmdir(char *fname);
< void nb_rename(char *old, char *new);
< void nb_qpathinfo(char *fname);
< void nb_qfileinfo(int fnum);
< void nb_qfsinfo(int level);
< void nb_findfirst(char *mask);
< void nb_flush(int fnum);
< void nb_deltree(char *dname);
< void nb_cleanup(void);
---
> int nb_writex(int handle, int offset, int size, int ret_size);
> int nb_readx(int handle, int offset, int size, int ret_size);
> int nb_close(int handle);
> int nb_rmdir(char *fname);
> int nb_rename(char *old, char *new);
> int nb_qpathinfo(char *fname);
> int nb_qfileinfo(int fnum);
> int nb_qfsinfo(int level);
> int nb_findfirst(char *mask);
> int nb_flush(int fnum);
> int nb_deltree(char *dname);
> int nb_cleanup(void);
diff -r base/source/include/smb.h newversion/source/include/smb.h
92c92
< exit(status); }
---
> return(status); }
diff -r base/source/torture/cifs_bm.c
newversion/source/torture/cifs_bm.c
286a287,288
> slprintf(myname,sizeof(myname),"CLIENT%d", i);
>
288c290
< fprintf(stderr, "Sleeping for %d seconds\n", t);
---
> fprintf(stderr, "%s - Sleeping for %d seconds\n", myname,
t);
291d292
<
slprintf(myname,sizeof(myname),"CLIENT%d", i);
298c299
< fprintf(stderr, "child cmd_info:
%0X\n", cmd_info);
---
> fprintf(stderr, "%s - child cmd_info:
%0X\n", myname, cmd_info);
423a425
> int st;
442c444
< while (fgets(line, sizeof(line)-1, f)) {
---
> while (fgets(line, sizeof(line)-1, f) && st==0) {
494c496
< nb_createx(params[1], ival(params[2]),
ival(params[3]),
---
> st=nb_createx(params[1], ival(params[2]),
ival(params[3]),
498c500
< nb_close(ival(params[1]));
---
> st=nb_close(ival(params[1]));
501c503
< nb_rename(params[1], params[2]);
---
> st=nb_rename(params[1], params[2]);
504c506
< nb_unlink(params[1]);
---
> st=nb_unlink(params[1]);
507c509
< nb_deltree(params[1]);
---
> st=nb_deltree(params[1]);
510c512
< nb_rmdir(params[1]);
---
> st=nb_rmdir(params[1]);
513c515
< nb_qpathinfo(params[1]);
---
> st=nb_qpathinfo(params[1]);
516c518
< nb_qfileinfo(ival(params[1]));
---
> st=nb_qfileinfo(ival(params[1]));
519c521
< nb_qfsinfo(ival(params[1]));
---
> st=nb_qfsinfo(ival(params[1]));
522c524
< nb_findfirst(params[1]);
---
> st=nb_findfirst(params[1]);
525c527
< nb_writex(ival(params[1]),
---
> st=nb_writex(ival(params[1]),
529c531
< nb_readx(ival(params[1]),
---
> st=nb_readx(ival(params[1]),
533c535
< nb_flush(ival(params[1]));
---
> st=nb_flush(ival(params[1]));
536c538
< nb_lock(ival(params[1]), ival(params[2]),
---
> st=nb_lock(ival(params[1]), ival(params[2]),
542a545,551
>
> if (st!=0) {
> printf("%s: ERROR: process %ld aborting for %s on command
%s in line %ld\n",
> timestring(0), getpid(), myname, line, line_count);
> exit(1);
>
> }
diff -r base/source/torture/nbio.c newversion/source/torture/nbio.c
164c164
< void nb_setup(struct cli_state *cli)
---
> int nb_setup(struct cli_state *cli)
169a170
> return(0);
173c174
< void nb_unlink(char *fname)
---
> int nb_unlink(char *fname)
191a193
> return(0);
195c197
< void nb_createx(char *fname,
---
> int nb_createx(char *fname,
248a251
> return(0);
251c254
< void nb_writex(int handle, int offset, int size, int ret_size)
---
> int nb_writex(int handle, int offset, int size, int ret_size)
271a275
> return(0);
274c278
< void nb_lock(int handle, int offset, int size, int timeout, unsigned
char locktype, NTSTATUS exp)
---
> int nb_lock(int handle, int offset, int size, int timeout, unsigned
char locktype, NTSTATUS exp)
289a294
> return(0);
292c297
< void nb_readx(int handle, int offset, int size, int ret_size)
---
> int nb_readx(int handle, int offset, int size, int ret_size)
308a314
> return(0);
311c317
< void nb_close(int handle)
---
> int nb_close(int handle)
328a335
> return(0);
331c338
< void nb_rmdir(char *fname)
---
> int nb_rmdir(char *fname)
347a355
> return(0);
350c358
< void nb_rename(char *old, char *new)
---
> int nb_rename(char *old, char *new)
368a377
> return(0);
372c381
< void nb_qpathinfo(char *fname)
---
> int nb_qpathinfo(char *fname)
382a392
> return(0);
385c395
< void nb_qfileinfo(int fnum)
---
> int nb_qfileinfo(int fnum)
391a402
> return(0);
394c405
< void nb_qfsinfo(int level)
---
> int nb_qfsinfo(int level)
400a412
> return(0);
408c420
< void nb_findfirst(char *mask)
---
> int nb_findfirst(char *mask)
414a427
> return(0);
417c430
< void nb_flush(int fnum)
---
> int nb_flush(int fnum)
420a434
> return(0);
453c467
< void nb_deltree(char *dname)
---
> int nb_deltree(char *dname)
470a485
> return(0);
474c489
< void nb_cleanup(void)
---
> int nb_cleanup(void)
477a493,494
> return(0);
>
More information about the samba-technical
mailing list