Commit a373d26c authored by Nils Goroll's avatar Nils Goroll

vtc: allow VSL arguments in logexpect

parent 171f3ac5
...@@ -33,6 +33,16 @@ ...@@ -33,6 +33,16 @@
* -g <grouping-mode> * -g <grouping-mode>
* -q <query> * -q <query>
* *
* vsl arguments (vsl_arg.c)
* -b Only display backend records
* -c Only display client records
* -C Caseless regular expressions
* -i <taglist> Include tags
* -I <[taglist:]regex> Include by regex
* -L <limit> Incomplete transaction limit
* -T <seconds> Transaction end timeout
*
*
* logexpect lN -v <id> [-g <grouping>] [-d 0|1] [-q query] { * logexpect lN -v <id> [-g <grouping>] [-d 0|1] [-q query] {
* expect <skip> <vxid> <tag> <regex> * expect <skip> <vxid> <tag> <regex>
* } * }
...@@ -127,7 +137,8 @@ logexp_delete(struct logexp *le) ...@@ -127,7 +137,8 @@ logexp_delete(struct logexp *le)
{ {
CHECK_OBJ_NOTNULL(le, LOGEXP_MAGIC); CHECK_OBJ_NOTNULL(le, LOGEXP_MAGIC);
AZ(le->run); AZ(le->run);
AZ(le->vsl); AN(le->vsl);
VSL_Delete(le->vsl);
AZ(le->vslq); AZ(le->vslq);
logexp_delete_tests(le); logexp_delete_tests(le);
free(le->name); free(le->name);
...@@ -153,7 +164,9 @@ logexp_new(const char *name) ...@@ -153,7 +164,9 @@ logexp_new(const char *name)
le->d_arg = 0; le->d_arg = 0;
le->g_arg = VSL_g_vxid; le->g_arg = VSL_g_vxid;
le->vsm = VSM_New(); le->vsm = VSM_New();
le->vsl = VSL_New();
AN(le->vsm); AN(le->vsm);
AN(le->vsl);
VTAILQ_INSERT_TAIL(&logexps, le, list); VTAILQ_INSERT_TAIL(&logexps, le, list);
return (le); return (le);
...@@ -299,10 +312,6 @@ logexp_close(struct logexp *le) ...@@ -299,10 +312,6 @@ logexp_close(struct logexp *le)
if (le->vslq) if (le->vslq)
VSLQ_Delete(&le->vslq); VSLQ_Delete(&le->vslq);
AZ(le->vslq); AZ(le->vslq);
if (le->vsl) {
VSL_Delete(le->vsl);
le->vsl = NULL;
}
VSM_Close(le->vsm); VSM_Close(le->vsm);
} }
...@@ -312,7 +321,7 @@ logexp_start(struct logexp *le) ...@@ -312,7 +321,7 @@ logexp_start(struct logexp *le)
struct VSL_cursor *c; struct VSL_cursor *c;
CHECK_OBJ_NOTNULL(le, LOGEXP_MAGIC); CHECK_OBJ_NOTNULL(le, LOGEXP_MAGIC);
AZ(le->vsl); AN(le->vsl);
AZ(le->vslq); AZ(le->vslq);
if (le->n_arg == NULL) { if (le->n_arg == NULL) {
...@@ -328,7 +337,6 @@ logexp_start(struct logexp *le) ...@@ -328,7 +337,6 @@ logexp_start(struct logexp *le)
vtc_log(le->vl, 0, "VSM_Open: %s", VSM_Error(le->vsm)); vtc_log(le->vl, 0, "VSM_Open: %s", VSM_Error(le->vsm));
return; return;
} }
le->vsl = VSL_New();
AN(le->vsl); AN(le->vsl);
c = VSL_CursorVSM(le->vsl, le->vsm, c = VSL_CursorVSM(le->vsl, le->vsm,
(le->d_arg ? 0 : VSL_COPT_TAIL) | VSL_COPT_BATCH); (le->d_arg ? 0 : VSL_COPT_TAIL) | VSL_COPT_BATCH);
...@@ -584,6 +592,14 @@ cmd_logexp(CMD_ARGS) ...@@ -584,6 +592,14 @@ cmd_logexp(CMD_ARGS)
continue; continue;
} }
if (**av == '-') { if (**av == '-') {
if (av[1] != NULL) {
if (VSL_Arg(le->vsl, av[0][1], av[1])) {
av++;
continue;
}
vtc_log(le->vl, 0, VSL_Error(le->vsl));
return;
}
vtc_log(le->vl, 0, "Unknown logexp argument: %s", *av); vtc_log(le->vl, 0, "Unknown logexp argument: %s", *av);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment