2022-06-10 00:30:40 +02:00
|
|
|
From 35072fc06b9efe923f6ac1bd73b67c33d3ae619b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Rosen Penev <rosenp@gmail.com>
|
|
|
|
Date: Fri, 10 Jun 2022 23:14:27 -0700
|
|
|
|
Subject: [PATCH] add meson
|
|
|
|
|
|
|
|
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
irqbalance: Fix log spam and correct meson version
Irqbalance 1.9.3 changed the handling of certain errors.
Specifically EINVAL, trying to set an invalid CPU core,
was changed to be a temporary error, causing log spam from
repeated balancing runs in some devices. See log and strace below.
Mark EINVAL as permanent.
Also correct the version in our own meson.build patch.
Log and strace:
Sat Dec 9 10:17:27 2023 daemon.warn irqbalance: Cannot change IRQ 48 affinity: Invalid argument
open("/proc/irq/48/smp_affinity", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 6
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ed9000
ioctl(6, TIOCGWINSZ, 0xbeb134e8) = -1 ENOTTY (Not a tty)
writev(6, [{iov_base="00000001", iov_len=8}, {iov_base=NULL, iov_len=0}], 2) = -1 EINVAL (Invalid argument)
close(6) = 0
munmap(0xb6ed9000, 4096) = 0
clock_gettime64(CLOCK_REALTIME, {tv_sec=1702109847, tv_nsec=340549081}) = 0
sendto(5, "<28>Dec 9 08:17:27 irqbalance: "..., 80, 0, NULL, 0) = 80
writev(1, [{iov_base="Cannot change IRQ 48 affinity: I"..., iov_len=47}, {iov_base="\n", iov_len=1}], 2Cannot change IRQ 48 affinity: Invalid argument
) = 48
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2023-12-09 11:13:27 +01:00
|
|
|
|
2024-03-24 19:39:05 +01:00
|
|
|
[update version string to 1.9.4]
|
irqbalance: Fix log spam and correct meson version
Irqbalance 1.9.3 changed the handling of certain errors.
Specifically EINVAL, trying to set an invalid CPU core,
was changed to be a temporary error, causing log spam from
repeated balancing runs in some devices. See log and strace below.
Mark EINVAL as permanent.
Also correct the version in our own meson.build patch.
Log and strace:
Sat Dec 9 10:17:27 2023 daemon.warn irqbalance: Cannot change IRQ 48 affinity: Invalid argument
open("/proc/irq/48/smp_affinity", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = 6
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6ed9000
ioctl(6, TIOCGWINSZ, 0xbeb134e8) = -1 ENOTTY (Not a tty)
writev(6, [{iov_base="00000001", iov_len=8}, {iov_base=NULL, iov_len=0}], 2) = -1 EINVAL (Invalid argument)
close(6) = 0
munmap(0xb6ed9000, 4096) = 0
clock_gettime64(CLOCK_REALTIME, {tv_sec=1702109847, tv_nsec=340549081}) = 0
sendto(5, "<28>Dec 9 08:17:27 irqbalance: "..., 80, 0, NULL, 0) = 80
writev(1, [{iov_base="Cannot change IRQ 48 affinity: I"..., iov_len=47}, {iov_base="\n", iov_len=1}], 2Cannot change IRQ 48 affinity: Invalid argument
) = 48
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2023-12-09 11:13:27 +01:00
|
|
|
|
2022-06-10 00:30:40 +02:00
|
|
|
---
|
|
|
|
meson.build | 43 +++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
meson_options.txt | 11 +++++++++++
|
|
|
|
2 files changed, 54 insertions(+)
|
|
|
|
create mode 100644 meson.build
|
|
|
|
create mode 100644 meson_options.txt
|
|
|
|
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/meson.build
|
|
|
|
@@ -0,0 +1,43 @@
|
|
|
|
+project('irqbalance', 'c',
|
2024-03-24 19:39:05 +01:00
|
|
|
+ version : '1.9.4',
|
2022-06-10 00:30:40 +02:00
|
|
|
+ default_options : ['warning_level=1']
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+cc = meson.get_compiler('c')
|
|
|
|
+
|
|
|
|
+glib_dep = dependency('glib-2.0', static: true)
|
|
|
|
+m_dep = cc.find_library('m', required: false)
|
|
|
|
+capng_dep = dependency('libcap-ng', required: get_option('capng'))
|
|
|
|
+ncurses_dep = dependency('curses', required: get_option('ui'))
|
|
|
|
+systemd_dep = dependency('libsystemd', required: get_option('systemd'))
|
|
|
|
+
|
|
|
|
+cdata = configuration_data()
|
|
|
|
+cdata.set('HAVE_GETOPT_LONG', cc.has_function('getopt_long'))
|
|
|
|
+cdata.set('HAVE_IRQBALANCEUI', ncurses_dep.found())
|
|
|
|
+cdata.set('HAVE_NUMA_H', cc.has_header('numa.h'))
|
|
|
|
+cdata.set('HAVE_LIBCAP_NG', capng_dep.found())
|
|
|
|
+cdata.set('HAVE_LIBSYSTEMD', systemd_dep.found())
|
|
|
|
+cdata.set_quoted('VERSION', meson.project_version())
|
|
|
|
+cfile = configure_file(
|
|
|
|
+ output: 'config.h',
|
|
|
|
+ configuration: cdata
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+if cdata.get('HAVE_IRQBALANCEUI')
|
|
|
|
+ add_project_arguments('-D_GNU_SOURCE', language: 'c')
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+executable('irqbalance',
|
|
|
|
+ 'activate.c',
|
|
|
|
+ 'bitmap.c',
|
|
|
|
+ 'classify.c',
|
|
|
|
+ 'cputree.c',
|
|
|
|
+ 'irqbalance.c',
|
|
|
|
+ 'irqlist.c',
|
|
|
|
+ 'numa.c',
|
|
|
|
+ 'placement.c',
|
|
|
|
+ 'procinterrupts.c',
|
|
|
|
+ dependencies: [ glib_dep, m_dep, capng_dep, ncurses_dep, systemd_dep ],
|
|
|
|
+ install : true
|
|
|
|
+)
|
|
|
|
--- /dev/null
|
|
|
|
+++ b/meson_options.txt
|
|
|
|
@@ -0,0 +1,11 @@
|
|
|
|
+option('capng', type : 'feature',
|
|
|
|
+ description : 'Build with libcap-ng support',
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+option('systemd', type : 'feature',
|
|
|
|
+ description : 'Build with systemd support',
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+option('ui', type : 'feature',
|
|
|
|
+ description : 'Build the UI component',
|
|
|
|
+)
|