From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/dlm/tests/usertest dlmtest2.c
Date: 21 Feb 2008 17:49:16 -0000 [thread overview]
Message-ID: <20080221174916.8132.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2008-02-21 17:49:16
Modified files:
dlm/tests/usertest: dlmtest2.c
Log message:
updates
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm/tests/usertest/dlmtest2.c.diff?cvsroot=cluster&r1=1.11&r2=1.12
--- cluster/dlm/tests/usertest/dlmtest2.c 2008/01/17 21:49:00 1.11
+++ cluster/dlm/tests/usertest/dlmtest2.c 2008/02/21 17:49:15 1.12
@@ -61,18 +61,37 @@
static unsigned int sts_eunlock, sts_ecancel, sts_etimedout, sts_edeadlk, sts_eagain, sts_other, sts_zero;
static unsigned int bast_unlock, bast_skip;
+
#define log_print(fmt, args...) \
do { \
if (!quiet) \
printf(fmt , ##args); \
} while (0)
-#define log_verbose(fmt, args...) \
+#define log_op(fmt, args...) \
+do { \
+ if (!quiet) \
+ printf(fmt , ##args); \
+} while (0)
+
+#define log_ast(fmt, args...) \
do { \
if (verbose) \
printf(fmt , ##args); \
} while (0)
+#define log_bast(fmt, args...) \
+do { \
+ if (verbose > 1) \
+ printf(fmt , ##args); \
+} while (0)
+
+#define log_verbose(fmt, args...) \
+do { \
+ if (verbose > 2) \
+ printf(fmt , ##args); \
+} while (0)
+
struct client {
int fd;
char type[32];
@@ -220,10 +239,10 @@
if (skip) {
bast_skip++;
- printf(" bast: skip %3d\t%x\n", lk->id, lk->lksb.sb_lkid);
+ log_bast(" bast: skip %3d\t%x\n", lk->id, lk->lksb.sb_lkid);
} else {
bast_unlock++;
- printf(" bast: unlockf %3d\t%x\n", lk->id, lk->lksb.sb_lkid);
+ log_bast(" bast: unlockf %3d\t%x\n", lk->id, lk->lksb.sb_lkid);
unlockf(lk->id);
}
lk->bast = 0;
@@ -261,8 +280,8 @@
op_str(lk->lastop), status_str(lk->last_status));
}
- log_print(" ast: %s %3d\t%x\n",
- status_str(lk->lksb.sb_status), i, lk->lksb.sb_lkid);
+ log_ast(" ast: %s %3d\t%x\n",
+ status_str(lk->lksb.sb_status), i, lk->lksb.sb_lkid);
lk->last_status = lk->lksb.sb_status;
@@ -845,7 +864,7 @@
lock(i, rand_int(0, 5));
lock_ops++;
- printf("%8x: lock %3d\t%x\n", n, i, lk->lksb.sb_lkid);
+ log_op("%8x: lock %3d\t%x\n", n, i, lk->lksb.sb_lkid);
break;
case Op_unlock:
@@ -864,7 +883,7 @@
unlock(i);
unlock_ops++;
- printf("%8x: unlock %3d\t%x\n", n, i, lk->lksb.sb_lkid);
+ log_op("%8x: unlock %3d\t%x\n", n, i, lk->lksb.sb_lkid);
break;
case Op_unlockf:
@@ -879,7 +898,7 @@
unlockf(i);
unlockf_ops++;
- printf("%8x: unlockf %3d\t%x\n", n, i, lk->lksb.sb_lkid);
+ log_op("%8x: unlockf %3d\t%x\n", n, i, lk->lksb.sb_lkid);
break;
case Op_cancel:
@@ -894,7 +913,7 @@
cancel(i);
cancel_ops++;
- printf("%8x: cancel %3d\t%x\n", n, i, lk->lksb.sb_lkid);
+ log_op("%8x: cancel %3d\t%x\n", n, i, lk->lksb.sb_lkid);
break;
}
@@ -1253,7 +1272,7 @@
int optchar;
while (cont) {
- optchar = getopt(argc, argv, "n:r:c:i:thVo");
+ optchar = getopt(argc, argv, "n:r:c:i:thVoq:v:");
switch (optchar) {
@@ -1282,6 +1301,14 @@
openclose_ls = 1;
break;
+ case 'q':
+ quiet = atoi(optarg);
+ break;
+
+ case 'v':
+ verbose = atoi(optarg);
+ break;
+
case 'h':
print_usage();
exit(EXIT_SUCCESS);
@@ -1398,7 +1425,7 @@
client_add(libdlm_fd, &maxi);
- if (opt_cmd) {
+ if (cmd) {
process_command(&quit);
goto out;
}
next reply other threads:[~2008-02-21 17:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-21 17:49 teigland [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-01-17 21:49 [Cluster-devel] cluster/dlm/tests/usertest dlmtest2.c teigland
2007-08-23 19:13 teigland
2007-08-22 14:01 teigland
2007-05-30 19:31 teigland
2007-04-27 19:09 teigland
2007-03-27 19:04 teigland
2007-02-27 18:55 teigland
2007-01-04 20:34 teigland
2006-12-12 21:17 teigland
2006-12-08 19:25 teigland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080221174916.8132.qmail@sourceware.org \
--to=teigland@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).