Debian Codegraph @

ui/irqbalance-ui.h

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1
2 #ifndef IRQBALANCE_UI_H
3 #define IRQBALANCE_UI_H
4
5 #include <stdio.h>
6 #include <stdint.h>
7 #include <glib.h>
8 #include <glib-unix.h>
9
10 #define SOCKET_PATH "irqbalance"
11 #define SOCKET_TMPFS "/run/irqbalance"
12
13 #define STATS "stats"
14 #define SET_SLEEP "settings sleep "
15 #define BAN_IRQS "settings ban irqs "
16 #define SETUP "setup"
17
18 /* IRQ CLASSES (same as irqbalance uses) */
19 #define IRQ_NODEF -1
20 #define IRQ_OTHER 0
21 #define IRQ_LEGACY 1
22 #define IRQ_SCSI 2
23 #define IRQ_VIDEO 3
24 #define IRQ_ETH 4
25 #define IRQ_GBETH 5
26 #define IRQ_10GBETH 6
27 #define IRQ_VIRT_EVENT 7
28
29
30 /* Typedefs */
31
32 typedef enum node_type {
33 OBJ_TYPE_CPU,
34 OBJ_TYPE_CACHE,
35 OBJ_TYPE_PACKAGE,
36 OBJ_TYPE_NODE
37 } node_type_e;
38
39 typedef struct irq {
40 int vector;
41 uint64_t load;
42 uint64_t diff;
43 char is_banned;
44 char is_changed;
45 GList *assigned_to;
46 int class;
47 } irq_t;
48
49 typedef struct cpu_node {
50 node_type_e type;
51 int number;
52 uint64_t load;
53 int is_powersave;
54 struct cpu_node *parent;
55 GList *children;
56 GList *irqs;
57 GList *cpu_list;
58 char *cpu_mask;
59 } cpu_node_t;
60
61 typedef struct cpu_ban {
62 int number;
63 char is_banned;
64 char is_changed;
65 } cpu_ban_t;
66
67 typedef struct setup {
68 uint64_t sleep;
69 GList *banned_irqs;
70 GList *banned_cpus;
71 } setup_t;
72
73 /* Function prototypes */
74
75 struct msghdr * create_credentials_msg();
76 int init_connection();
77 void send_settings(char *data);
78 char * get_data(char *string);
79 void parse_setup(char *setup_data);
80 GList * concat_child_lists(cpu_node_t *node);
81 void copy_cpu_list_to_irq(irq_t *irq, void *data);
82 void assign_cpu_lists(cpu_node_t *node, void *data);
83 void assign_cpu_mask(cpu_node_t *node, void *data);
84 void parse_into_tree(char *data);
85 gboolean rescan_tree(gpointer data);
86 int main();
87
88
89 #endif /* IRQBALANCE_UI_H */