typedef int vsl_handler(void *priv, enum shmlogtag tag, unsigned fd, unsigned len, unsigned spec, const char *ptr);
#define VSL_S_CLIENT (1 << 0)
#define VSL_S_BACKEND (1 << 1)
-#define VSL_ARGS "bCcdI:i:r:X:x:"
-#define VSL_USAGE "[-bCcd] [-i tag] [-I regexp] [-r file] [-X regexp] [-x tag]"
+#define VSL_ARGS "bCcdI:i:r:s:X:x:"
+#define VSL_USAGE "[-bCcd] [-i tag] [-I regexp] [-r file] [-s skip] [-X regexp] [-x tag]"
vsl_handler VSL_H_Print;
struct VSL_data;
struct VSL_data *VSL_New(void);
int regflags;
regex_t *regincl;
regex_t *regexcl;
+
+ unsigned long skip;
};
#ifndef MAP_HASSEMAPHORE
default:
break;
}
+ if (vd->skip) {
+ --vd->skip;
+ continue;
+ }
if (vd->map[p[SHMLOG_TAG]] & M_SELECT) {
*pp = p;
return (1);
/*--------------------------------------------------------------------*/
+static int
+vsl_s_arg(struct VSL_data *vd, const char *opt)
+{
+ char *end;
+
+ CHECK_OBJ_NOTNULL(vd, VSL_MAGIC);
+ if (*opt == '\0') {
+ fprintf(stderr, "number required for -s\n");
+ return (-1);
+ }
+ vd->skip = strtoul(opt, &end, 10);
+ if (*end != '\0') {
+ fprintf(stderr, "invalid number for -s\n");
+ return (-1);
+ }
+ return (1);
+}
+
+/*--------------------------------------------------------------------*/
+
int
VSL_Arg(struct VSL_data *vd, int arg, const char *opt)
{
case 'r': return (vsl_r_arg(vd, opt));
case 'I': case 'X': return (vsl_IX_arg(vd, opt, arg));
case 'C': vd->regflags = REG_ICASE; return (1);
+ case 's': return (vsl_s_arg(vd, opt));
default:
return (0);
}