Re: [systemd-devel] [systemd-commits] src/journal

2015-01-28 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jan 28, 2015 at 01:11:55PM +0100, Lennart Poettering wrote:
 On Wed, 28.01.15 04:04, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:
 
  On Wed, Jan 28, 2015 at 03:50:42AM +0100, Lennart Poettering wrote:
   On Wed, 28.01.15 03:47, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) 
   wrote:
   
On Wed, Jan 28, 2015 at 01:53:17AM +0100, Lennart Poettering wrote:
 On Mon, 19.01.15 10:43, Zbigniew Jędrzejewski-Szmek 
 (zbys...@kemper.freedesktop.org) wrote:
 
   src/journal/journalctl.c |   28 ++--
   1 file changed, 14 insertions(+), 14 deletions(-)
  
  New commits:
  commit 40f0b71b063da6a36b8d7ec75ef20103abd18243
  Author: Zbigniew J??drzejewski-Szmek zbys...@in.waw.pl
  Date:   Mon Jan 19 13:42:34 2015 -0500
  
  journalctl: trim --help to fit in 80 columns
  
  Terminals tend to be 80 columns wide by default, and the help
  text is only supposed to be a terse reminder anyway.
  
 
 Hmm, maybe we should add a test target to the makefile that runs all
 our tools with --help and checks that the output it generates is
 identical to the output pssed through fold -w 79 or so?
 
 (I added this to the TODO list for now)

Done.
   
   Hmm, your commit checks for 80 chars, right? Shouldn't we rather check
   for 79? Many terminals that are 80 chars wide will leave one line free
   if you output 80 consecutive chars plus one newline...
  Are you sure? I though this was fixed already.
  A quick test with the linux console, urxvt, konsole, systemd-subterm,
  and xterm all DTRT.
 
 I know for sure that the old MS-DOS 5.0 console certainly wasn't happy
 with 80ch lines... Because I remember this issue from when I started
 programming back on those machines...

Your concern for backwards compat is touching :)

Zbyszek

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2015-01-28 Thread Andrei Borzenkov
On Wed, Jan 28, 2015 at 6:04 AM, Zbigniew Jędrzejewski-Szmek
zbys...@in.waw.pl wrote:
 On Wed, Jan 28, 2015 at 03:50:42AM +0100, Lennart Poettering wrote:
 On Wed, 28.01.15 03:47, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) 
 wrote:

  On Wed, Jan 28, 2015 at 01:53:17AM +0100, Lennart Poettering wrote:
   On Mon, 19.01.15 10:43, Zbigniew Jędrzejewski-Szmek 
   (zbys...@kemper.freedesktop.org) wrote:
  
 src/journal/journalctl.c |   28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)
   
New commits:
commit 40f0b71b063da6a36b8d7ec75ef20103abd18243
Author: Zbigniew J??drzejewski-Szmek zbys...@in.waw.pl
Date:   Mon Jan 19 13:42:34 2015 -0500
   
journalctl: trim --help to fit in 80 columns
   
Terminals tend to be 80 columns wide by default, and the help
text is only supposed to be a terse reminder anyway.
   
  
   Hmm, maybe we should add a test target to the makefile that runs all
   our tools with --help and checks that the output it generates is
   identical to the output pssed through fold -w 79 or so?
  
   (I added this to the TODO list for now)
 
  Done.

 Hmm, your commit checks for 80 chars, right? Shouldn't we rather check
 for 79? Many terminals that are 80 chars wide will leave one line free
 if you output 80 consecutive chars plus one newline...
 Are you sure? I though this was fixed already.
 A quick test with the linux console, urxvt, konsole, systemd-subterm,
 and xterm all DTRT.

I definitely see it every now and then although I cannot right now
tell exactly under which conditions. This could also depend on
terminfo entry on particular system.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2015-01-28 Thread Lennart Poettering
On Wed, 28.01.15 04:04, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:

 On Wed, Jan 28, 2015 at 03:50:42AM +0100, Lennart Poettering wrote:
  On Wed, 28.01.15 03:47, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) 
  wrote:
  
   On Wed, Jan 28, 2015 at 01:53:17AM +0100, Lennart Poettering wrote:
On Mon, 19.01.15 10:43, Zbigniew Jędrzejewski-Szmek 
(zbys...@kemper.freedesktop.org) wrote:

  src/journal/journalctl.c |   28 ++--
  1 file changed, 14 insertions(+), 14 deletions(-)
 
 New commits:
 commit 40f0b71b063da6a36b8d7ec75ef20103abd18243
 Author: Zbigniew J??drzejewski-Szmek zbys...@in.waw.pl
 Date:   Mon Jan 19 13:42:34 2015 -0500
 
 journalctl: trim --help to fit in 80 columns
 
 Terminals tend to be 80 columns wide by default, and the help
 text is only supposed to be a terse reminder anyway.
 

Hmm, maybe we should add a test target to the makefile that runs all
our tools with --help and checks that the output it generates is
identical to the output pssed through fold -w 79 or so?

(I added this to the TODO list for now)
   
   Done.
  
  Hmm, your commit checks for 80 chars, right? Shouldn't we rather check
  for 79? Many terminals that are 80 chars wide will leave one line free
  if you output 80 consecutive chars plus one newline...
 Are you sure? I though this was fixed already.
 A quick test with the linux console, urxvt, konsole, systemd-subterm,
 and xterm all DTRT.

I know for sure that the old MS-DOS 5.0 console certainly wasn't happy
with 80ch lines... Because I remember this issue from when I started
programming back on those machines...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2015-01-27 Thread Lennart Poettering
On Mon, 19.01.15 10:43, Zbigniew Jędrzejewski-Szmek 
(zbys...@kemper.freedesktop.org) wrote:

  src/journal/journalctl.c |   28 ++--
  1 file changed, 14 insertions(+), 14 deletions(-)
 
 New commits:
 commit 40f0b71b063da6a36b8d7ec75ef20103abd18243
 Author: Zbigniew J??drzejewski-Szmek zbys...@in.waw.pl
 Date:   Mon Jan 19 13:42:34 2015 -0500
 
 journalctl: trim --help to fit in 80 columns
 
 Terminals tend to be 80 columns wide by default, and the help
 text is only supposed to be a terse reminder anyway.
 

Hmm, maybe we should add a test target to the makefile that runs all
our tools with --help and checks that the output it generates is
identical to the output pssed through fold -w 79 or so?

(I added this to the TODO list for now)

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2015-01-27 Thread Lennart Poettering
On Wed, 28.01.15 03:47, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:

 On Wed, Jan 28, 2015 at 01:53:17AM +0100, Lennart Poettering wrote:
  On Mon, 19.01.15 10:43, Zbigniew Jędrzejewski-Szmek 
  (zbys...@kemper.freedesktop.org) wrote:
  
src/journal/journalctl.c |   28 ++--
1 file changed, 14 insertions(+), 14 deletions(-)
   
   New commits:
   commit 40f0b71b063da6a36b8d7ec75ef20103abd18243
   Author: Zbigniew J??drzejewski-Szmek zbys...@in.waw.pl
   Date:   Mon Jan 19 13:42:34 2015 -0500
   
   journalctl: trim --help to fit in 80 columns
   
   Terminals tend to be 80 columns wide by default, and the help
   text is only supposed to be a terse reminder anyway.
   
  
  Hmm, maybe we should add a test target to the makefile that runs all
  our tools with --help and checks that the output it generates is
  identical to the output pssed through fold -w 79 or so?
  
  (I added this to the TODO list for now)
 
 Done.

Hmm, your commit checks for 80 chars, right? Shouldn't we rather check
for 79? Many terminals that are 80 chars wide will leave one line free
if you output 80 consecutive chars plus one newline...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2015-01-27 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jan 28, 2015 at 03:50:42AM +0100, Lennart Poettering wrote:
 On Wed, 28.01.15 03:47, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote:
 
  On Wed, Jan 28, 2015 at 01:53:17AM +0100, Lennart Poettering wrote:
   On Mon, 19.01.15 10:43, Zbigniew Jędrzejewski-Szmek 
   (zbys...@kemper.freedesktop.org) wrote:
   
 src/journal/journalctl.c |   28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 40f0b71b063da6a36b8d7ec75ef20103abd18243
Author: Zbigniew J??drzejewski-Szmek zbys...@in.waw.pl
Date:   Mon Jan 19 13:42:34 2015 -0500

journalctl: trim --help to fit in 80 columns

Terminals tend to be 80 columns wide by default, and the help
text is only supposed to be a terse reminder anyway.

   
   Hmm, maybe we should add a test target to the makefile that runs all
   our tools with --help and checks that the output it generates is
   identical to the output pssed through fold -w 79 or so?
   
   (I added this to the TODO list for now)
  
  Done.
 
 Hmm, your commit checks for 80 chars, right? Shouldn't we rather check
 for 79? Many terminals that are 80 chars wide will leave one line free
 if you output 80 consecutive chars plus one newline...
Are you sure? I though this was fixed already.
A quick test with the linux console, urxvt, konsole, systemd-subterm,
and xterm all DTRT.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2015-01-27 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jan 28, 2015 at 01:53:17AM +0100, Lennart Poettering wrote:
 On Mon, 19.01.15 10:43, Zbigniew Jędrzejewski-Szmek 
 (zbys...@kemper.freedesktop.org) wrote:
 
   src/journal/journalctl.c |   28 ++--
   1 file changed, 14 insertions(+), 14 deletions(-)
  
  New commits:
  commit 40f0b71b063da6a36b8d7ec75ef20103abd18243
  Author: Zbigniew J??drzejewski-Szmek zbys...@in.waw.pl
  Date:   Mon Jan 19 13:42:34 2015 -0500
  
  journalctl: trim --help to fit in 80 columns
  
  Terminals tend to be 80 columns wide by default, and the help
  text is only supposed to be a terse reminder anyway.
  
 
 Hmm, maybe we should add a test target to the makefile that runs all
 our tools with --help and checks that the output it generates is
 identical to the output pssed through fold -w 79 or so?
 
 (I added this to the TODO list for now)

Done.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2014-12-19 Thread Filipe Brandenburger
Hi,

This seems to have fixed test-journal-stream but
test-journal-interleaving is still broken for me, it fails with:

NUMBER=1
NUMBER=2
Assertion 'r == 1' failed at
src/journal/test-journal-interleaving.c:101, function
test_check_numbers_down(). Aborting.
Aborted (core dumped)

Can you please double check?

Can you please make sure that make check passes before pushing the commits?

Thanks!
Filipe


On Fri, Dec 19, 2014 at 6:38 AM, Michal Schmidt
mich...@kemper.freedesktop.org wrote:
  src/journal/sd-journal.c |   66 
 +--
  1 file changed, 30 insertions(+), 36 deletions(-)

 New commits:
 commit 487d37209b30a536636c95479cfeba931fea25c5
 Author: Michal Schmidt mschm...@redhat.com
 Date:   Fri Dec 19 15:05:30 2014 +0100

 journal: fix skipping of duplicate entries in iteration

 I accidentally broke the detection of duplicate entries in 7943f42275
 journal: optimize iteration by returning previously found candidate
 entry.

 When we have a known location of a candidate entry, we must not return
 from next_beyond_location() immediately. We must go through the
 duplicates detection to make sure the candidate differs from the
 already iterated entry.

 This fix slows down iteration a bit, but it's still faster than it
 was before the rework.

 $ time ./journalctl --since=2014-06-01 --until=2014-07-01  /dev/null

 real0m4.448s
 user0m4.298s
 sys 0m0.149s

 (Compare with results from commit 7943f42275, where real was 5.3s before
 the rework.)

 diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
 index 285e5e3..173f948 100644
 --- a/src/journal/sd-journal.c
 +++ b/src/journal/sd-journal.c
 @@ -412,60 +412,51 @@ _public_ void sd_journal_flush_matches(sd_journal *j) {
  detach_location(j);
  }

 -_pure_ static int compare_with_location(JournalFile *af, Object *ao, 
 Location *l) {
 -uint64_t a;
 -
 -assert(af);
 -assert(ao);
 +_pure_ static int compare_with_location(JournalFile *f, Location *l) {
 +assert(f);
  assert(l);
 +assert(f-location_type == LOCATION_SEEK);
  assert(l-type == LOCATION_DISCRETE || l-type == LOCATION_SEEK);

  if (l-monotonic_set 
 -sd_id128_equal(ao-entry.boot_id, l-boot_id) 
 +sd_id128_equal(f-current_boot_id, l-boot_id) 
  l-realtime_set 
 -le64toh(ao-entry.realtime) == l-realtime 
 +f-current_realtime == l-realtime 
  l-xor_hash_set 
 -le64toh(ao-entry.xor_hash) == l-xor_hash)
 +f-current_xor_hash == l-xor_hash)
  return 0;

  if (l-seqnum_set 
 -sd_id128_equal(af-header-seqnum_id, l-seqnum_id)) {
 +sd_id128_equal(f-header-seqnum_id, l-seqnum_id)) {

 -a = le64toh(ao-entry.seqnum);
 -
 -if (a  l-seqnum)
 +if (f-current_seqnum  l-seqnum)
  return -1;
 -if (a  l-seqnum)
 +if (f-current_seqnum  l-seqnum)
  return 1;
  }

  if (l-monotonic_set 
 -sd_id128_equal(ao-entry.boot_id, l-boot_id)) {
 -
 -a = le64toh(ao-entry.monotonic);
 +sd_id128_equal(f-current_boot_id, l-boot_id)) {

 -if (a  l-monotonic)
 +if (f-current_monotonic  l-monotonic)
  return -1;
 -if (a  l-monotonic)
 +if (f-current_monotonic  l-monotonic)
  return 1;
  }

  if (l-realtime_set) {

 -a = le64toh(ao-entry.realtime);
 -
 -if (a  l-realtime)
 +if (f-current_realtime  l-realtime)
  return -1;
 -if (a  l-realtime)
 +if (f-current_realtime  l-realtime)
  return 1;
  }

  if (l-xor_hash_set) {
 -a = le64toh(ao-entry.xor_hash);

 -if (a  l-xor_hash)
 +if (f-current_xor_hash  l-xor_hash)
  return -1;
 -if (a  l-xor_hash)
 +if (f-current_xor_hash  l-xor_hash)
  return 1;
  }

 @@ -740,21 +731,24 @@ static int next_beyond_location(sd_journal *j, 
 JournalFile *f, direction_t direc
  f-last_n_entries = n_entries;

  if (f-last_direction == direction  f-current_offset  0) {
 +cp = f-current_offset;
 +
  /* LOCATION_SEEK here means we did the work in a previous
   * iteration and the current location already points to a
   * candidate entry. */
 -if (f-location_type == LOCATION_SEEK)
 -return 1;
 -
 -cp = f-current_offset;
 +if (f-location_type != 

Re: [systemd-devel] [systemd-commits] src/journal

2014-12-19 Thread Michal Schmidt
On 12/19/2014 04:49 PM, Filipe Brandenburger wrote:
 This seems to have fixed test-journal-stream but
 test-journal-interleaving is still broken for me, it fails with:
 
 NUMBER=1
 NUMBER=2
 Assertion 'r == 1' failed at
 src/journal/test-journal-interleaving.c:101, function
 test_check_numbers_down(). Aborting.
 Aborted (core dumped)
 
 Can you please double check?

Hello Filipe,

thanks for pinging me about this.

This should be fixed now with 668c965af4e journal: skipping of
exhausted journal files is bad if direction changed.

 Can you please make sure that make check passes before pushing the commits?

I usually do, but sometimes I forget :) Sorry!

Michal
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2014-12-19 Thread Filipe Brandenburger
On Fri, Dec 19, 2014 at 8:30 AM, Michal Schmidt mschm...@redhat.com wrote:
 On 12/19/2014 04:49 PM, Filipe Brandenburger wrote:
 This seems to have fixed test-journal-stream but
 test-journal-interleaving is still broken for me, it fails with:

 NUMBER=1
 NUMBER=2
 Assertion 'r == 1' failed at
 src/journal/test-journal-interleaving.c:101, function
 test_check_numbers_down(). Aborting.
 Aborted (core dumped)

 Can you please double check?

 Hello Filipe,

 thanks for pinging me about this.

 This should be fixed now with 668c965af4e journal: skipping of
 exhausted journal files is bad if direction changed.

It's working now, thanks!
Filipe
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2014-01-15 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jan 15, 2014 at 03:57:08AM -0800, Lukas Nykryn wrote:
  src/journal/coredumpctl.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 New commits:
 commit 1b2457e16dbbaa5e587c5e36d274a48c585d4840
 Author: Lukas Nykryn lnyk...@redhat.com
 Date:   Wed Jan 15 12:46:44 2014 +0100
 
 Revert Revert coredumpctl: in case of error free pattern after print
 
 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.
Yeah, you're right.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [systemd-commits] src/journal

2013-03-22 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Mar 22, 2013 at 05:13:37PM -0700, Lennart Poettering wrote:
  src/journal/journalctl.c |   42 ++
  src/journal/sd-journal.c |   30 +++---
  2 files changed, 41 insertions(+), 31 deletions(-)
 
 New commits:
 commit 3ac251b81a41295a90c89c164f0d72ce6de651aa
 Author: Lennart Poettering lenn...@poettering.net
 Date:   Sat Mar 23 01:12:22 2013 +0100
 
 journalctl: various fixes to the access check logic
 
 - Reword messages a bit
 
 - Correct check whether EACCES is in the set of errors
Ooops. That was copypasterebase gone wrong. Thanks for fixing that.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel