Browse Source

Scan for CPUs. Ignore HT

Serj Kalichev 10 years ago
parent
commit
908cca630a
2 changed files with 11 additions and 1 deletions
  1. 3 1
      Makefile.am
  2. 8 0
      birq.c

+ 3 - 1
Makefile.am

@@ -18,12 +18,14 @@ noinst_HEADERS = \
 	nl.h \
 	cpumask.h \
 	bitmap.h \
-	non-atomic.h
+	non-atomic.h \
+	cpu.h
 
 birq_SOURCES = \
 	birq.c \
 	nl.c \
 	irq_parse.c \
+	cpu_parse.c \
 	bitmap.c
 
 birq_LDADD = liblub.a

+ 8 - 0
birq.c

@@ -31,6 +31,7 @@
 #include "lub/log.h"
 #include "lub/list.h"
 #include "irq.h"
+#include "cpu.h"
 #include "nl.h"
 
 #define BIRQ_PIDFILE "/var/run/birq.pid"
@@ -77,6 +78,8 @@ int main(int argc, char **argv)
 
 	/* IRQ list. It contain all found irqs. */
 	lub_list_t *irqs;
+	/* CPU list. It contain all found CPUs. */
+	lub_list_t *cpus;
 
 	/* Parse command line options */
 	opts = opts_init();
@@ -140,6 +143,10 @@ int main(int argc, char **argv)
 	/* Prepare data structures */
 	irqs = lub_list_new(irq_list_compare);
 
+cpus = lub_list_new(cpu_list_compare);
+scan_cpus(cpus);
+show_cpus(cpus);
+
 	/* Main loop */
 	while (!sigterm) {
 		int n;
@@ -171,6 +178,7 @@ int main(int argc, char **argv)
 end:
 	/* Free data structures */
 	irq_list_free(irqs);
+	cpu_list_free(cpus);
 
 	retval = 0;
 err: