Irqbalance / irqbalance

The irqbalance source tree - The new official site for irqbalance
http://irqbalance.github.io/irqbalance/
GNU General Public License v2.0
576 stars 139 forks source link

Useless empty log line in journal #281

Closed tetraf closed 9 months ago

tetraf commented 9 months ago

On my system irqbalance is started by systemd so its logs are retrieved by journald. However, irqbalance emits logs containing only line jumps and dashes which seems to correspond to https://github.com/Irqbalance/irqbalance/blob/v1.9.3/irqbalance.c#L292

But this line mentions TO_CONSOLE so I think there is something missing in the log() function.

Especially before this line https://github.com/Irqbalance/irqbalance/blob/v1.9.3/irqbalance.h#L141 (and perhaps the line 154). Maybe something like if (log_mask & mask & TO_SYSLOG).

nhorman commented 9 months ago

Everything should be going to the console and systemd should redirect it to its journal.

Questions: 1) What version of irqbalance are you using? 2) What happens when you run irqbalance in the foreground manually. Do the logs get printed properly? 3) What does your irqbalance systemd unit file look like? 4) Whats the output of journalctl -u irqbalance?

tetraf commented 9 months ago

Everything should be going to the console and systemd should redirect it to its journal.

I'm OK with that, but while \n\n\n-----------------------------------------------------------------------------\n may be useful in debug mode for console, it's not (IMHO) for logging.

And:

  1. 1.9.3 (from archlinux repository: https://archlinux.org/packages/extra/x86_64/irqbalance/)

  2. that:

    $ sudo systemctl stop irqbalance
    $ sudo irqbalance --foreground
    [it runs but print nothing after waiting several minutes while doing other stuff]
    $ sudo irqbalance --foreground --journal
    [same thing for this command]

    If I start it with --debug it does print lots of lines (including the famous line-jumps-and-dashes).

  3. this one: https://github.com/Irqbalance/irqbalance/blob/v1.9.3/misc/irqbalance.service

  4. that:

    
    $ journalctl -u irqbalance -n 10 -o cat
    Selecting irq 40 for rebalancing

Selecting irq 40 for rebalancing




Selecting irq 40 for rebalancing


Selecting irq 40 for rebalancing


nhorman commented 9 months ago

I see what you're saying now, you just don't want the delimiter (-----) in the journal output. Yeah, I definately want to keep that for console logging, but we can turn it off for journal output

nhorman commented 9 months ago

please test with https://github.com/Irqbalance/irqbalance/pull/282 and confirm that the issue is resolved

tetraf commented 9 months ago

It works fine. No blank line written in logs. Thank you :)

Edu4rdSHL commented 9 months ago

Sorry for necro-bumping this, but, is there a plan to create a new release including this soon? Or should I tell the maintainers to cherry-pick the commit.

Thanks!

nhorman commented 9 months ago

The latter, a new release just came out a few weeks ago

liutgnu commented 4 months ago

Hi, the issue still exists in 1, and the patch is in irqbalance-1.9.4-2.fc40. Don't know if there is something I missed? Thanks!

sean-anderson-seco commented 1 month ago

I see this line in the journal as well with 1.9.4. It's pretty confusing.

nhorman commented 1 month ago

Does the fedora systemd unit pass --journal to the executable, or does it just redirect foreground console output?

sean-anderson-seco commented 1 month ago

I see this issue on 1.9.4 with the default systemd unit file with and without --journal.