summaryrefslogtreecommitdiff
path: root/src/journal/coredumpctl.c
AgeCommit message (Collapse)Author
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
2014-11-28treewide: more log_*_errno + return simplificationsMichal Schmidt
2014-11-28treewide: more log_*_errno() conversions, multiline callsMichal Schmidt
Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-09-11journal: do not dereference already freed patternsPhilippe De Swert
In case set_consume goes wrong, the pattern name has already been freed. So we do not try to print it in the logs, assuming the pattern addition print will be printed just before the failure anyway. Found with coverity. Fixes: CID#1237798
2014-08-03Unify parse_argv styleZbigniew Jędrzejewski-Szmek
getopt is usually good at printing out a nice error message when commandline options are invalid. It distinguishes between an unknown option and a known option with a missing arg. It is better to let it do its job and not use opterr=0 unless we actually want to suppress messages. So remove opterr=0 in the few places where it wasn't really useful. When an error in options is encountered, we should not print a lengthy help() and overwhelm the user, when we know precisely what is wrong with the commandline. In addition, since help() prints to stdout, it should not be used except when requested with -h or --help. Also, simplify things here and there.
2014-07-31Always prefer our headers to system headersZbigniew Jędrzejewski-Szmek
In practice this shouldn't make much difference, but sometimes our headers might be newer, and we want to test them.
2014-07-18Small modernizationsZbigniew Jędrzejewski-Szmek
2014-07-06coredumpctl: show a useful error on permission problemsZbigniew Jędrzejewski-Szmek
2014-07-06journal: add LZ4 as optional compressorZbigniew Jędrzejewski-Szmek
Add liblz4 as an optional dependency when requested with --enable-lz4, and use it in preference to liblzma for journal blob and coredump compression. To retain backwards compatibility, XZ is used to decompress old blobs. Things will function correctly only with lz4-119. Based on the benchmarks found on the web, lz4 seems to be the best choice for "quick" compressors atm. For pkg-config status, see http://code.google.com/p/lz4/issues/detail?id=135.
2014-06-27coredumpctl: fix potential deref of null pointerThomas Hindoe Paaboel Andersen
2014-06-26coredumpctl: remove unused variableThomas Hindoe Paaboel Andersen
2014-06-26coredumpctl: fix HAVE_XZ checkDaniel Mack
2014-06-26coredumpctl: fix build with !HAVE_XZDaniel Mack
Fixes the following build error: CCLD coredumpctl src/journal/coredumpctl.o: In function `save_core': /src/systemd-master/src/journal/coredumpctl.c:656: undefined reference to `decompress_stream' collect2: error: ld returned 1 exit status make[2]: *** [coredumpctl] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
2014-06-26coredump+coredumpctl: add COREDUMP_FILENAME, use in coredumpctlZbigniew Jędrzejewski-Szmek
2014-06-23coredump: never write more than the configured processing size limit to diskLennart Poettering
2014-06-23coredumpctl: show comm name next to PIDLennart Poettering
2014-06-23coredumpctl: include timestamp information in "coredumpctl info" outputLennart Poettering
2014-06-23coredump: also escape spaces in comm fields when formatting file namesLennart Poettering
2014-06-19coredumpctl: add missing entries to --helpLennart Poettering
2014-06-19coredumpctl: fix columns sizing for timestampLennart Poettering
2014-06-19coredumpctl: introduce new -1 switch for showing a single, most recent entry ↵Lennart Poettering
only "coredumpctl info -1" is now incredibly useful for showing the most recent stacktrace.
2014-06-19coredump: include stacktrace of coredumps in the log messageLennart Poettering
elfutils' libdw is maintained, can read DWARF debug data and appears to be the library of choice for generating backtraces today.
2014-06-19coredump: add 3 more metadata fields to coredump entriesLennart Poettering
2014-06-19coredump: add new "info" verb to coredumpctl showing detailed information ↵Lennart Poettering
about a coredump
2014-06-19coredump: make sure coredumpctl can handle externally stored coredumpsLennart Poettering
2014-03-18util: replace close_nointr_nofail() by a more useful safe_close()Lennart Poettering
safe_close() automatically becomes a NOP when a negative fd is passed, and returns -1 unconditionally. This makes it easy to write lines like this: fd = safe_close(fd); Which will close an fd if it is open, and reset the fd variable correctly. By making use of this new scheme we can drop a > 200 lines of code that was required to test for non-negative fds or to reset the closed fd variable afterwards.
2014-01-28always use the same code for creating temporary filesLennart Poettering
Let's unify our code here, and also always specifiy O_CLOEXEC.
2014-01-15Revert "Revert "coredumpctl: in case of error free pattern after print""Lukas Nykryn
In the case of the error set_consume will free the pointer 'pattern' which is later used in log_error. Either we should stop priniting that or use simple set_put and free pattern manually. This reverts commit ece6b8fd5bbc1fee16f652e680e3033f2f3efc4a.
2014-01-14Revert "coredumpctl: in case of error free pattern after print"Zbigniew Jędrzejewski-Szmek
This reverts commit cf50a55277ee432e1217ad894afcbd9a664ff96c. set_consume frees on error.
2014-01-14coredumpctl: in case of error free pattern after printLukas Nykryn
2013-12-24log: log_error() and friends add a newline after each line anyway, so avoid ↵Lennart Poettering
including it in the log strings
2013-12-03trivial coding style clean upsThomas Hindoe Paaboel Andersen
- Add space between if/for and the opening parentheses - Place the opening brace on same line as the function (not for udev) From the CODING_STYLE Try to use this: void foo() { } instead of this: void foo() { }
2013-11-26tree-wide usage of %m specifier instead of strerror(errno)Daniel Buch
Also for log_error() except where a specific error is specified e.g. errno ? strerror(errno) : "Some user specified message"
2013-11-06clients: unify how we invoke getopt_long()Lennart Poettering
Among other things this makes sure we always expose a --version command and show it in the help texts.
2013-08-02coredumpctl: add more debug outputZbigniew Jędrzejewski-Szmek
It can be quite useful when somebody confuses _PID with COREDUMP_PID :).
2013-05-21man: Document missing optionsJan Janssen
2013-04-24Add set_consume which always takes ownershipZbigniew Jędrzejewski-Szmek
Freeing in error path is the common pattern with set_put().
2013-04-18move _cleanup_ attribute in front of the typeHarald Hoyer
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-16macro: rework how we define cleanup macrosLennart Poettering
There's now a generic _cleanup_ macro with an argument. The macros for specific types are now defined using this macro, and in the header files where they belong. All cleanup handlers are now inline functions.
2013-03-18journal,shared: add _cleanup_journal_close_Zbigniew Jędrzejewski-Szmek
2013-03-07pager: introduce "jump to end" optionHarald Hoyer
$ journalctl -be is what you want :) https://bugzilla.redhat.com/show_bug.cgi?id=867841
2013-01-04build-sys: drop all distribution specfic checksLennart Poettering
Yay, we now have a completely generic systemd. No distribution specific checks anymore!
2012-12-19coredumpctl: check return of strndupLukas Nykryn
2012-11-21journal: by default do not decompress dat objects larger than 64KLennart Poettering
This introduces a new data threshold setting for sd_journal objects which controls the maximum size of objects to decompress. This is relieves the library from having to decompress full data objects even if a client program is only interested in the initial part of them. This speeds up "systemd-coredumpctl" drastically when invoked without parameters.
2012-11-12enable localization for common *ctl commandsDave Reisner
2012-11-09coredumpctl: add missing -F, --field option to helpDave Reisner