diff options
Diffstat (limited to 'drivers/acpi/debug.c')
-rw-r--r-- | drivers/acpi/debug.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/acpi/debug.c b/drivers/acpi/debug.c index bf513e07b773..6df564f4ca6e 100644 --- a/drivers/acpi/debug.c +++ b/drivers/acpi/debug.c | |||
@@ -130,6 +130,63 @@ static int param_get_debug_level(char *buffer, struct kernel_param *kp) { | |||
130 | module_param_call(debug_layer, param_set_uint, param_get_debug_layer, &acpi_dbg_layer, 0644); | 130 | module_param_call(debug_layer, param_set_uint, param_get_debug_layer, &acpi_dbg_layer, 0644); |
131 | module_param_call(debug_level, param_set_uint, param_get_debug_level, &acpi_dbg_level, 0644); | 131 | module_param_call(debug_level, param_set_uint, param_get_debug_level, &acpi_dbg_level, 0644); |
132 | 132 | ||
133 | static char trace_method_name[6]; | ||
134 | module_param_string(trace_method_name, trace_method_name, 6, 0644); | ||
135 | static unsigned int trace_debug_layer; | ||
136 | module_param(trace_debug_layer, uint, 0644); | ||
137 | static unsigned int trace_debug_level; | ||
138 | module_param(trace_debug_level, uint, 0644); | ||
139 | |||
140 | static int param_set_trace_state(const char *val, struct kernel_param *kp) | ||
141 | { | ||
142 | int result = 0; | ||
143 | |||
144 | if (!strncmp(val, "enable", strlen("enable") - 1)) { | ||
145 | result = acpi_debug_trace(trace_method_name, trace_debug_level, | ||
146 | trace_debug_layer, 0); | ||
147 | if (result) | ||
148 | result = -EBUSY; | ||
149 | goto exit; | ||
150 | } | ||
151 | |||
152 | if (!strncmp(val, "disable", strlen("disable") - 1)) { | ||
153 | int name = 0; | ||
154 | result = acpi_debug_trace((char *)&name, trace_debug_level, | ||
155 | trace_debug_layer, 0); | ||
156 | if (result) | ||
157 | result = -EBUSY; | ||
158 | goto exit; | ||
159 | } | ||
160 | |||
161 | if (!strncmp(val, "1", 1)) { | ||
162 | result = acpi_debug_trace(trace_method_name, trace_debug_level, | ||
163 | trace_debug_layer, 1); | ||
164 | if (result) | ||
165 | result = -EBUSY; | ||
166 | goto exit; | ||
167 | } | ||
168 | |||
169 | result = -EINVAL; | ||
170 | exit: | ||
171 | return result; | ||
172 | } | ||
173 | |||
174 | static int param_get_trace_state(char *buffer, struct kernel_param *kp) | ||
175 | { | ||
176 | if (!acpi_gbl_trace_method_name) | ||
177 | return sprintf(buffer, "disable"); | ||
178 | else { | ||
179 | if (acpi_gbl_trace_flags & 1) | ||
180 | return sprintf(buffer, "1"); | ||
181 | else | ||
182 | return sprintf(buffer, "enable"); | ||
183 | } | ||
184 | return 0; | ||
185 | } | ||
186 | |||
187 | module_param_call(trace_state, param_set_trace_state, param_get_trace_state, | ||
188 | NULL, 0644); | ||
189 | |||
133 | /* -------------------------------------------------------------------------- | 190 | /* -------------------------------------------------------------------------- |
134 | FS Interface (/proc) | 191 | FS Interface (/proc) |
135 | -------------------------------------------------------------------------- */ | 192 | -------------------------------------------------------------------------- */ |