File: debug.c

package info (click to toggle)
irqbalance 0.12-7etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 180 kB
  • ctags: 54
  • sloc: ansic: 493; sh: 94; xml: 31; makefile: 10
file content (75 lines) | stat: -rw-r--r-- 1,703 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <limits.h>


#include "prototypes.h"

/*
   Copyright (C) 2003 Red Hat, Inc. All rights reserved.
                                                                                                             
   Usage and distribution of this file are subject to the Open Software License version 2.1
   that can be found at http://www.opensource.org/licenses/osl-2.1.txt and the COPYING file as
   distributed together with this file is included herein by reference. Alternatively you can use 
   and distribute this file under version 1.1 of the same license.
                                                                                                                      
   Author: Arjan van de Ven   <arjanv@redhat.com>

*/

/*
 * This file contains code to help debugging
 */


static void print_type(int type)
{
	switch (type) {
	case IRQ_OTHER:
		printf("other");
		break;
	case IRQ_LEGACY:
		printf("low rate");
		break;
	case IRQ_ETH:
		printf("ethernet");
		break;
	case IRQ_SCSI:
		printf("storage");
		break;
	case IRQ_TIMER:
		printf("timer");
		break;
	case IRQ_GIGE:
		printf("gigabit");
		break;
	default:
		printf("unknown");
	}
}


void dump_settings(void)
{
	int i;
	int t;
	printf("IRQ\t");
	for (i=0; i < cpucount; i++)
		printf("CPU %i\t",i);
	printf("type \n");
	
	for (i=0; i < MAX_INTERRUPTS; i++) {
		if (interrupts[i].type == IRQ_INACTIVE)
			continue;
		printf("%i:\t", i);
		for (t=0; t < cpucount; t++)
			if (((int)interrupts[i].cpu == t) || (interrupts[i].cpu == MAX_CPU))
				printf("%lu\t",interrupts[i].delta);
			else
				printf("\t");
		print_type(interrupts[i].type);
		printf("\n");
	}
	
}