Permalink
Browse files

Add autotools scripts to irqbalance

Steve Grubb sent this patch as part of issue 3:
http://code.google.com/p/irqbalance/issues/detail?id=3

He requested that we add the ability to drop capabilities from irqbalance since
it nominally runs as root, and he suggested using the capng library, which makes
that process easier.  Since capng is a fairly new library, and many distros may
not have it, we need to start using a configure script to optionally include it
during the build.  This patch accomplishes all of that.

Signed-off-by: Neil Horman <nhorman@gmail.com>



git-svn-id: https://irqbalance.googlecode.com/svn/trunk@21 46b42954-3823-0410-bd82-eb80b452c9b5
  • Loading branch information...
nhorman
nhorman committed Sep 1, 2009
1 parent 175844b commit 37e0a0963d4c4171bbb83b7b5a1b8c588a2579c2
Showing with 28 additions and 9 deletions.
  1. +3 −0 AUTHORS
  2. +3 −0 ChangeLog
  3. +1 −0 NEWS
  4. 0 README
  5. +1 −0 activate.c
  6. +1 −1 bitmap.c
  7. +1 −0 classify.c
  8. +1 −2 cputree.c
  9. +11 −1 irqbalance.c
  10. +1 −1 irqlist.c
  11. +1 −1 network.c
  12. +1 −1 numa.c
  13. +1 −0 placement.c
  14. +1 −1 powermode.c
  15. +1 −1 procinterrupts.c
@@ -0,0 +1,3 @@
Arjen Van De Ven <arjanvandeven@gmail.com>
Neil Horman <nhorman@gmail.com>
@@ -0,0 +1,3 @@
This is all tracked in the SVN repo. This file is just here to keep the
autotools from complaining
1 NEWS
@@ -0,0 +1 @@
No news currently
0 README
No changes.
@@ -23,6 +23,7 @@
* This file contains the code to communicate a selected distribution / mapping
* of interrupts to the kernel.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -11,7 +11,7 @@ This file is taken from the Linux kernel and minimally adapted for use in usersp
* This source code is licensed under the GNU General Public License,
* Version 2. See the file COPYING for more details.
*/
#include "config.h"
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
@@ -1,3 +1,4 @@
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -24,8 +24,7 @@
* cache domains and processor cores.
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -18,12 +18,15 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#include "config.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <sys/time.h>
#ifdef HAVE_LIBCAP_NG
#include <cap-ng.h>
#endif
#include "irqbalance.h"
int one_shot_mode;
@@ -82,6 +85,13 @@ int main(int argc, char** argv)
if (daemon(0,0))
exit(EXIT_FAILURE);
#ifdef HAVE_LIBCAP_NG
// Drop capabilities
capng_clear(CAPNG_SELECT_BOTH);
capng_lock();
capng_apply(CAPNG_SELECT_BOTH);
#endif
parse_proc_interrupts();
sleep(SLEEP_INTERVAL/4);
reset_counts();
@@ -22,7 +22,7 @@
/*
* This file has the basic functions to manipulate interrupt metadata
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -24,7 +24,7 @@
* even though the amount of work is high; this file is there to compensate for this
* by adding actual package counts to the calculated amount of work of interrupts
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
2 numa.c
@@ -24,7 +24,7 @@
* In addition the PCI class information is used to refine the classification
* of interrupt sources
*/
#define _GNU_SOURCE
#include "config.h"
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@@ -18,6 +18,7 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#define _GNU_SOURCE
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

0 comments on commit 37e0a09

Please sign in to comment.