diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-09-30 23:58:44 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-10-01 00:02:08 +0200 |
commit | 69ae3ee07ee4dc7592f6d2d5f181b478a772a644 (patch) | |
tree | f871ab9f4aed214d166b32f451c37e0288a0b0c7 /src/shared/logs-show.c | |
parent | ceadabb102b05b237bfab11e1f742975ee4daeb1 (diff) |
logs-show.c: show all messages for a slice
Diffstat (limited to 'src/shared/logs-show.c')
-rw-r--r-- | src/shared/logs-show.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index 2dd5025bc3..7bb19b4006 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -1048,6 +1048,16 @@ int add_matches_for_unit(sd_journal *j, const char *unit) { (r = sd_journal_add_match(j, m4, 0)) ); + if (r == 0 && endswith(unit, ".slice")) { + char *m5 = strappend("_SYSTEMD_SLICE=", unit); + + /* Show all messages belonging to a slice */ + (void)( + (r = sd_journal_add_disjunction(j)) || + (r = sd_journal_add_match(j, m5, 0)) + ); + } + return r; } @@ -1087,6 +1097,18 @@ int add_matches_for_user_unit(sd_journal *j, const char *unit, uid_t uid) { (r = sd_journal_add_match(j, muid, 0)) || (r = sd_journal_add_match(j, "_UID=0", 0)) ); + + if (r == 0 && endswith(unit, ".slice")) { + char *m5 = strappend("_SYSTEMD_SLICE=", unit); + + /* Show all messages belonging to a slice */ + (void)( + (r = sd_journal_add_disjunction(j)) || + (r = sd_journal_add_match(j, m5, 0)) || + (r = sd_journal_add_match(j, muid, 0)) + ); + } + return r; } |