X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fcoredumpctl.c;h=f9cebb7a423dbb4b225b20b283b4684fc8e1f0f9;hb=e42e801b55740df1e2007336c8e2cb1e538849e1;hp=60bba7f0e83b0d0ecd256a56fdf8f64d43286251;hpb=4f76ae1b4bfca0975373b78349928a60e94b000c;p=elogind.git
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 60bba7f0e..f9cebb7a4 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -19,6 +19,7 @@
along with systemd; If not, see .
***/
+#include
#include
#include
#include
@@ -87,6 +88,8 @@ static int help(void) {
"Commands:\n"
" -h --help Show this help\n"
" --version Print version string\n"
+ " -F --field=FIELD List all values a certain field takes\n"
+ " gdb Start gdb for the first matching coredump\n"
" list List available coredumps\n"
" dump PID Print coredump to stdout\n"
" dump PATH Print coredump to stdout\n"
@@ -339,6 +342,11 @@ static int dump_list(sd_journal *j) {
assert(j);
+ /* The coredumps are likely to compressed, and for just
+ * listing them we don#t need to decompress them, so let's
+ * pick a fairly low data threshold here */
+ sd_journal_set_data_threshold(j, 4096);
+
SD_JOURNAL_FOREACH(j) {
if (field)
print_field(stdout, j);
@@ -378,6 +386,9 @@ static int dump_core(sd_journal* j) {
assert(j);
+ /* We want full data, nothing truncated. */
+ sd_journal_set_data_threshold(j, 0);
+
r = focus(j);
if (r < 0)
return r;
@@ -425,6 +436,8 @@ static int run_gdb(sd_journal *j) {
assert(j);
+ sd_journal_set_data_threshold(j, 0);
+
r = focus(j);
if (r < 0)
return r;
@@ -512,6 +525,7 @@ int main(int argc, char *argv[]) {
Iterator it;
int r = 0;
+ setlocale(LC_ALL, "");
log_parse_environment();
log_open();