[PATCH v2 5/5] Add user interface to configuration and build, document socket API in man page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


The user interface can be run with `irqbalance-ui` command.

Signed-off-by: Veronika Kabatova <vkabatov at redhat.com>
 Makefile.am  |  8 ++++++--
 configure.ac |  4 +++-
 irqbalance.1 | 29 +++++++++++++++++++++++++++++
 3 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 5e55afb..1decbef 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,14 +24,18 @@ AUTOMAKE_OPTIONS = no-dependencies
 EXTRA_DIST = COPYING autogen.sh misc/irqbalance.service misc/irqbalance.env
+UI_DIR = ui
 AM_CPPFLAGS = -I${top_srcdir} -W -Wall -Wshadow -Wformat -Wundef -D_GNU_SOURCE
 noinst_HEADERS = bitmap.h constants.h cpumask.h irqbalance.h non-atomic.h \
-	types.h
-sbin_PROGRAMS = irqbalance
+	types.h $(UI_DIR)/helpers.h $(UI_DIR)/irqbalance-ui.h $(UI_DIR)/ui.h
+sbin_PROGRAMS = irqbalance irqbalance-ui
 irqbalance_SOURCES = activate.c bitmap.c classify.c cputree.c irqbalance.c \
 	irqlist.c numa.c placement.c procinterrupts.c
 irqbalance_LDADD = $(LIBCAP_NG_LIBS) $(GLIB_LIBS)
+irqbalance_ui_SOURCES = $(UI_DIR)/helpers.c $(UI_DIR)/irqbalance-ui.c \
+	$(UI_DIR)/ui.c
+irqbalance_ui_LDADD = $(GLIB_LIBS) $(CURSES_LIBS)
 dist_man_MANS = irqbalance.1
 CONFIG_CLEAN_FILES = debug*.list config/*
diff --git a/configure.ac b/configure.ac
index 35b8b60..e8ac9b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_PREREQ(2.12)dnl
+AM_INIT_AUTOMAKE([foreign] [subdir-objects])
@@ -26,6 +26,8 @@ AC_CHECK_FUNCS(getopt_long)
 AC_CHECK_LIB(numa, numa_available)
 AC_CHECK_LIB(m, floor)
+AC_CHECK_LIB(curses, mvprintw)
diff --git a/irqbalance.1 b/irqbalance.1
index 559ba85..25e9d0e 100644
--- a/irqbalance.1
+++ b/irqbalance.1
@@ -133,6 +133,35 @@ Provides a mask of CPUs which irqbalance should ignore and never assign interrup
 Forces a rescan of the available IRQs and system topology.
+.SH "API"
+irqbalance is able to communicate via socket and return it's current assignment
+tree and setup, as well as set new settings based on sent values. Socket is abstract,
+with a name in form of
+.B irqbalance<PID>.sock
+, where <PID> is the process ID of irqbalance instance to communicate with.
+Possible values to send:
+.B stats
+Retrieve assignment tree of IRQs to CPUs, in recursive manner. For each CPU node
+in tree, it's type, number, load and whether the save mode is active are sent. For
+each assigned IRQ type, it's number, load, number of IRQs since last rebalancing
+and it's class are sent. Refer to types.h file for explanation of defines.
+.B setup
+Get the current value of sleep interval, mask of banned CPUs and and list of banned IRQs.
+.B settings sleep <s>
+Set new value of sleep interval, <s> >= 1.
+.B settings cpus <cpu_number1> <cpu_number2> ...
+Ban listed CPUs from IRQ handling, all old values of banned CPUs are forgotten.
+.B settings ban irqs <irq1> <irq2> ...
+Ban listed IRQs from being balanced, all old values of banned IRQs are forgotten.
+irqbalance checks SCM_CREDENTIALS of sender (only root user is allowed to interact).
+Based on chosen tools, ancillary message with credentials needs to be sent with request.
 .SH "Homepage"

[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux