summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-07-16 22:24:02 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-17 00:59:03 +0200
commitdca6219e04505e9fa10b32e71059ce2abfae1dad (patch)
tree29b7c20c60afa197e471d2ed8a44cca92cc68249 /src/journal/journalctl.c
parent7653b3c29adbad9d299fe9ff09ed30fbcc606acc (diff)
journal: automatically rotate journal files if the data hash table is full > 75%
Previously, when the main data hash table grows too full the performance simply started to decrease drastically. Instead, now simply rotate to a new journal file as the hash table gets to full, so that we can start with a new fresh empty hash table.
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 65b3bd5a86..0d37107874 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -40,6 +40,7 @@
#include "pager.h"
#include "logs-show.h"
#include "strv.h"
+#include "journal-internal.h"
static OutputMode arg_output = OUTPUT_SHORT;
static bool arg_follow = false;
@@ -48,6 +49,7 @@ static bool arg_no_pager = false;
static int arg_lines = -1;
static bool arg_no_tail = false;
static bool arg_new_id128 = false;
+static bool arg_print_header = false;
static bool arg_quiet = false;
static bool arg_local = false;
static bool arg_this_boot = false;
@@ -70,6 +72,7 @@ static int help(void) {
" -l --local Only local entries\n"
" -b --this-boot Show data only from current boot\n"
" -D --directory=PATH Show journal files from directory\n"
+ " --header Show journal header information\n"
" --new-id128 Generate a new 128 Bit id\n",
program_invocation_short_name);
@@ -82,7 +85,8 @@ static int parse_argv(int argc, char *argv[]) {
ARG_VERSION = 0x100,
ARG_NO_PAGER,
ARG_NO_TAIL,
- ARG_NEW_ID128
+ ARG_NEW_ID128,
+ ARG_HEADER
};
static const struct option options[] = {
@@ -99,6 +103,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "local", no_argument, NULL, 'l' },
{ "this-boot", no_argument, NULL, 'b' },
{ "directory", required_argument, NULL, 'D' },
+ { "header", no_argument, NULL, ARG_HEADER },
{ NULL, 0, NULL, 0 }
};
@@ -174,6 +179,10 @@ static int parse_argv(int argc, char *argv[]) {
arg_directory = optarg;
break;
+ case ARG_HEADER:
+ arg_print_header = true;
+ break;
+
case '?':
return -EINVAL;
@@ -331,6 +340,12 @@ int main(int argc, char *argv[]) {
goto finish;
}
+ if (arg_print_header) {
+ journal_print_header(j);
+ r = 0;
+ goto finish;
+ }
+
r = add_this_boot(j);
if (r < 0)
goto finish;