summaryrefslogtreecommitdiff
path: root/src/jio.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2021-08-23 15:34:12 -0700
committerVito Caputo <vcaputo@pengaru.com>2021-08-24 00:48:46 -0700
commitdb549aa7f63621e1b81d32e59456303c5003b4b9 (patch)
tree277d51fca2c89e2fdf7002ffee051bcd70b21ef8 /src/jio.c
parentb53cc8e61a27f948df5f11da07c7c395ebae1dd1 (diff)
verify-hashed-objects: add `jio verify hashed-objects`
This is currently very hacky and unfinished, but does enough for some performance comparisons against a zstd-using journalctl --verify that has been hacked to return early after the first pass. It's currently rather leaky, the whole per-object-dispatch thingy is illuminating a thunk_h shortcoming and forcing addressing the issue... soon.
Diffstat (limited to 'src/jio.c')
-rw-r--r--src/jio.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/jio.c b/src/jio.c
index a2491ff..2730eac 100644
--- a/src/jio.c
+++ b/src/jio.c
@@ -24,6 +24,7 @@
#include "report-layout.h"
#include "report-tail-waste.h"
#include "report-usage.h"
+#include "verify-hashed-objects.h"
#include "upstream/journal-def.h"
@@ -39,7 +40,7 @@ int main(int argc, char *argv[])
int r;
if (argc < 2) {
- printf("Usage: %s {help,reclaim,report} [subcommand-args]\n", argv[0]);
+ printf("Usage: %s {help,reclaim,report,verify} [subcommand-args]\n", argv[0]);
return 0;
}
@@ -134,6 +135,22 @@ int main(int argc, char *argv[])
fprintf(stderr, "Unsupported report subcommand: \"%s\"\n", argv[2]);
return 1;
}
+ } else if (!strcmp(argv[1], "verify")) {
+ if (argc < 3) {
+ printf("Usage: %s verify {hashed-objects}\n", argv[0]);
+ return 0;
+ }
+
+ if (!strcmp(argv[2], "hashed-objects")) {
+ r = jio_verify_hashed_objects(iou, argc, argv);
+ if (r < 0) {
+ fprintf(stderr, "failed to verify hashed objects: %s\n", strerror(-r));
+ return 1;
+ }
+ } else {
+ fprintf(stderr, "Unsupported verify subcommand: \"%s\"\n", argv[2]);
+ return 1;
+ }
} else if (!strcmp(argv[1], "version")) {
puts("jio version " VERSION);
return 0;
© All Rights Reserved