This stack check implementation leverages the compiler's profiling (gcc -p)
[linux-2.6.git] / include / linux / rbce.h
1 /* Rule-based Classification Engine (RBCE) module
2  *
3  * Copyright (C) Hubertus Franke, IBM Corp. 2003
4  *           (C) Chandra Seetharaman, IBM Corp. 2003
5  * 
6  * Module for loading of classification policies and providing
7  * a user API for Class-based Kernel Resource Management (CKRM)
8  *
9  * Latest version, more details at http://ckrm.sf.net
10  * 
11  * This program is free software; you can redistribute it and/or modify it
12  * under the terms of version 2.1 of the GNU Lesser General Public License
13  * as published by the Free Software Foundation.
14  *
15  * This program is distributed in the hope that it would be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18  * 
19  *
20  */
21
22 /* Changes
23  *
24  * 25 Mar 2004
25  *        Integrate RBCE and CRBE into a single module
26  * 
27  */
28
29 #ifndef RBCE_H
30 #define RBCE_H
31
32 // data types defined in main rbcemod.c 
33 struct rbce_private_data;
34 struct rbce_class;
35 struct ckrm_core_class;
36
37 #ifndef RBCE_EXTENSION
38
39 /****************************************************************************
40  *
41  *   RBCE STANDALONE VERSION, NO CHOICE FOR DATA COLLECTION
42  *
43  ****************************************************************************/
44
45 #ifdef RBCE_SHOW_INCL
46 #warning " ... RBCE .."
47 #endif
48
49 #define RBCE_MOD_DESCR "Rule Based Classification Engine Module for CKRM"
50 #define RBCE_MOD_NAME  "rbce"
51
52 /* extension to private data: NONE */
53 struct rbce_ext_private_data {
54         /* empty data */
55 };
56 static inline void init_ext_private_data(struct rbce_private_data *dst)
57 {
58 }
59
60 /* sending notification to user: NONE */
61
62 static void notify_class_action(struct rbce_class *cls, int action)
63 {
64 }
65 static inline void send_fork_notification(struct task_struct *tsk,
66                                           struct ckrm_core_class *cls)
67 {
68 }
69 static inline void send_exit_notification(struct task_struct *tsk)
70 {
71 }
72 static inline void send_manual_notification(struct task_struct *tsk)
73 {
74 }
75
76 /* extension initialization and destruction at module init and exit */
77 static inline int init_rbce_ext_pre(void)
78 {
79         return 0;
80 }
81 static inline int init_rbce_ext_post(void)
82 {
83         return 0;
84 }
85 static inline void exit_rbce_ext(void)
86 {
87 }
88
89 #else
90
91 /***************************************************************************
92  *
93  *   RBCE with User Level Notification
94  *
95  ***************************************************************************/
96
97 #ifdef RBCE_SHOW_INCL
98 #warning " ... CRBCE .."
99 #ifdef RBCE_DO_SAMPLE
100 #warning " ... CRBCE doing sampling ..."
101 #endif
102 #ifdef RBCE_DO_DELAY
103 #warning " ... CRBCE doing delay ..."
104 #endif
105 #endif
106
107 #define RBCE_MOD_DESCR  "Rule Based Classification Engine Module" \
108                         "with Data Sampling/Delivery for CKRM"
109 #define RBCE_MOD_NAME   "crbce"
110
111 #include <linux/crbce.h>
112
113 struct rbce_ext_private_data {
114         struct task_sample_info sample;
115 };
116
117 static void notify_class_action(struct rbce_class *cls, int action);
118 #if 0
119 static void send_fork_notification(struct task_struct *tsk,
120                                    struct ckrm_core_class *cls);
121 static void send_exit_notification(struct task_struct *tsk);
122 static void send_manual_notification(struct task_struct *tsk);
123 #endif
124
125 #endif
126
127 #endif                          // RBCE_H