summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO27
-rw-r--r--.gitignore6
-rw-r--r--PKGBUILD46
-rw-r--r--irq-tools.install11
-rw-r--r--irq-tune.patch48
-rw-r--r--irqstat.patch9
-rw-r--r--irqtune-auto.service13
-rw-r--r--irqtune.service13
8 files changed, 173 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..422adb623fc
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+pkgbase = irq-tools
+ pkgdesc = irq-tune for set smp affinity and irqstat for better watch /proc/interrupts, designet for NUMA systems
+ pkgver = 0.1
+ pkgrel = 1
+ url = https://github.com/k0ste/irq-tools
+ install = irq-tools.install
+ arch = any
+ license = GPL
+ makedepends = git
+ makedepends = patch
+ depends = python2
+ depends = numactl
+ source = irq-tune::git+https://github.com/hep-gc/irq-tune
+ source = irqstat::git+https://github.com/lanceshelton/irqstat
+ source = irq-tune.patch
+ source = irqstat.patch
+ source = irqtune.service
+ source = irqtune-auto.service
+ sha256sums = SKIP
+ sha256sums = SKIP
+ sha256sums = b83afbfc604d7195cf75b25f0bf74eb3bb7a8e545736ccda589283e74b291dea
+ sha256sums = 7cc83179add66cf0bd4a012dcd5cf908944359f0b2b76a9d0fdb08cb3d3a2131
+ sha256sums = 3a7575d6ec501b44878cce38d95effd99dfa8d43a8706abfffbed43a16905321
+ sha256sums = 6121ebabc8c6b965fded2944c4ddce2bff79d78eb3661b7260f065a99c3b9725
+
+pkgname = irq-tools
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..740ecc070e2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+pkg/*
+src/*
+irq-tune/*
+irqstat/*
+*.deb
+*.tar.*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..740e5b4722b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Shalygin Konstantin (k0ste@opentech.ru)
+
+pkgname='irq-tools'
+pkgver='0.1'
+pkgrel='1'
+pkgdesc='irq-tune for set smp affinity and irqstat for better watch /proc/interrupts, designet for NUMA systems'
+arch=('any')
+url="https://github.com/k0ste/${pkgname}"
+license=('GPL')
+depends=('python2' 'numactl')
+makedepends=('git' 'patch')
+source=("irq-tune::git+https://github.com/hep-gc/irq-tune"
+ "irqstat::git+https://github.com/lanceshelton/irqstat"
+ "irq-tune.patch"
+ "irqstat.patch"
+ "irqtune.service"
+ "irqtune-auto.service")
+sha256sums=('SKIP'
+ 'SKIP'
+ 'b83afbfc604d7195cf75b25f0bf74eb3bb7a8e545736ccda589283e74b291dea'
+ '7cc83179add66cf0bd4a012dcd5cf908944359f0b2b76a9d0fdb08cb3d3a2131'
+ '3a7575d6ec501b44878cce38d95effd99dfa8d43a8706abfffbed43a16905321'
+ '6121ebabc8c6b965fded2944c4ddce2bff79d78eb3661b7260f065a99c3b9725')
+install="${pkgname}.install"
+
+prepare() {
+ pushd "${srcdir}"
+ cd "irq-tune"
+ patch -p1 -i "${srcdir}/irq-tune.patch"
+ popd
+ cd "irqstat"
+ patch -p1 -i "${srcdir}/irqstat.patch"
+}
+
+package() {
+ pushd "${srcdir}"
+ install -Dm755 "irq-tune/irq-tune.py" "${pkgdir}/usr/bin/irq-tune"
+ install -Dm644 "irq-tune/irq.json" "${pkgdir}/etc/irq-tune/irq.json"
+ install -Dm644 "irq-tune/irq-eth.json.sample" "${pkgdir}/etc/irq-tune/irq-eth.json.sample"
+ install -Dm755 "irqstat/irqstat" "${pkgdir}/usr/bin/irqstat"
+ install -Dm644 "irqtune.service" "${pkgdir}/usr/lib/systemd/system/irqtune.service"
+ install -Dm644 "irqtune-auto.service" "${pkgdir}/usr/lib/systemd/system/irqtune-auto.service"
+ install -Dm644 "irqstat/LICENSE" "$pkgdir/usr/share/doc/${pkgname}/LICENSE"
+ install -Dm644 "irq-tune/README.md" "$pkgdir/usr/share/doc/${pkgname}/README.md"
+ popd
+}
diff --git a/irq-tools.install b/irq-tools.install
new file mode 100644
index 00000000000..9dfa534cf93
--- /dev/null
+++ b/irq-tools.install
@@ -0,0 +1,11 @@
+post_install() {
+ /usr/bin/systemctl daemon-reload
+}
+
+post_upgrade() {
+ /usr/bin/systemctl daemon-reload
+}
+
+post_remove() {
+ /usr/bin/systemctl daemon-reload
+}
diff --git a/irq-tune.patch b/irq-tune.patch
new file mode 100644
index 00000000000..e7bd81315a0
--- /dev/null
+++ b/irq-tune.patch
@@ -0,0 +1,48 @@
+diff -Naupr irq-tune.orig/irq-eth.json.sample irq-tune/irq-eth.json.sample
+--- irq-tune.orig/irq-eth.json.sample 1970-01-01 07:00:00.000000000 +0700
++++ irq-tune/irq-eth.json.sample 2015-11-20 11:27:04.373296735 +0600
+@@ -0,0 +1,13 @@
++## Can be executed '-a -j irq-eth.json'
++[
++ { "cores": [0], "name": "eth0-0" },
++ { "cores": [1], "name": "eth0-txrx-1" },
++ { "cores": [2], "name": "eth0-txrx-2" },
++ { "cores": [3], "name": "eth0-txrx-3" },
++ { "cores": [4], "name": "eth0-txrx-4" },
++ { "cores": [0], "name": "eth1-0" },
++ { "cores": [1], "name": "eth1-txrx-1" },
++ { "cores": [2], "name": "eth1-txrx-2" },
++ { "cores": [3], "name": "eth1-txrx-3" },
++ { "cores": [4], "name": "eth1-txrx-4" }
++]
+diff -Naupr irq-tune.orig/irq-tune.py irq-tune/irq-tune.py
+--- irq-tune.orig/irq-tune.py 2015-11-20 11:22:45.152527711 +0600
++++ irq-tune/irq-tune.py 2015-11-20 11:25:10.592959185 +0600
+@@ -1,4 +1,4 @@
+-#!/bin/python
++#!/usr/bin/python2
+ # vim: set expandtab ts=4 sw=4:
+
+ # irq-tune
+@@ -109,7 +109,6 @@ def main():
+ parse.error("The file: " + options.jsonfile + "does not exist.")
+
+
+- #json_data = open("irq.json").read()
+ json_data = open(options.jsonfile).read()
+ irqdict = json.loads(json_data)
+
+@@ -120,13 +119,3 @@ def main():
+
+ if __name__ == "__main__":
+ main()
+-
+-# Some debugging junk
+-#
+-# ddpprint.pprint(irqdict,width=120)
+-# bmask = total_mask(cpulist,"binary")
+-# hmask1 = total_mask(cpulist,"hex")
+-# hmask2 = total_mask(irqlist[0]['cores'],"hex")
+-# hreal = total_mask([36],"hex")
+-# print hmask2
+-# print hreal
diff --git a/irqstat.patch b/irqstat.patch
new file mode 100644
index 00000000000..95fb82afd81
--- /dev/null
+++ b/irqstat.patch
@@ -0,0 +1,9 @@
+diff -Naupr irqstat.orig/irqstat irqstat/irqstat
+--- irqstat.orig/irqstat 2015-11-20 11:22:45.179194457 +0600
++++ irqstat/irqstat 2015-11-20 11:23:58.476078572 +0600
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python
++#!/usr/bin/python2
+
+ # The MIT License (MIT)
+ #
diff --git a/irqtune-auto.service b/irqtune-auto.service
new file mode 100644
index 00000000000..2838cc49857
--- /dev/null
+++ b/irqtune-auto.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Set IRQ via irq-tune
+After=network.target
+Wants=network.target
+Conflicts=irqtune.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/irq-tune -j /etc/irq-tune/irq.json -a
+
+[Install]
+WantedBy=network.target
diff --git a/irqtune.service b/irqtune.service
new file mode 100644
index 00000000000..9896a7a1eea
--- /dev/null
+++ b/irqtune.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Set IRQ via irq-tune
+After=network.target
+Wants=network.target
+Conflicts=irqtune-auto.service
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/irq-tune -j /etc/irq-tune/irq.json
+
+[Install]
+WantedBy=network.target