]>
Commit | Line | Data |
---|---|---|
bd3239d2 MF |
1 | typedef unsigned long size_t; |
2 | typedef long ssize_t; | |
3 | typedef long long loff_t; | |
4 | int __test_bit(int nr, const void *addr) | |
5 | { | |
6 | int *a = (int *)addr; | |
7 | int mask; | |
8 | a += nr >> 5; | |
9 | mask = 1 << (nr & 0x1f); | |
10 | return ((mask & *a) != 0); | |
11 | } | |
12 | int test_bit(int nr, const void *addr) | |
13 | { | |
14 | return __test_bit(nr, addr); | |
15 | }; | |
16 | typedef struct { | |
17 | } atomic_t; | |
18 | typedef struct cpumask { | |
19 | unsigned long | |
20 | bits[(((1) + (8 * sizeof(long)) - 1) / (8 * sizeof(long)))]; | |
21 | } cpumask_t; | |
22 | struct trace_array_cpu { | |
23 | atomic_t disabled; | |
24 | }; | |
25 | struct trace_array { | |
26 | struct trace_array_cpu *data[1]; | |
27 | }; | |
28 | cpumask_t tracing_buffer_mask; | |
29 | struct trace_array global_trace; | |
30 | cpumask_t tracing_cpumask; | |
31 | cpumask_t tracing_cpumask_new; | |
32 | tracing_cpumask_write(struct file *filp, const char *ubuf, size_t count, | |
33 | loff_t * ppos) | |
34 | { | |
35 | int err; | |
36 | int cpu; | |
37 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)tracing_buffer_mask) { | |
38 | if (test_bit((cpu), (tracing_cpumask).bits) | |
39 | && !test_bit((cpu), (tracing_cpumask_new).bits)) { | |
40 | atomic_inc(&global_trace.data[cpu]->disabled); | |
41 | } | |
42 | if (!test_bit((cpu), (tracing_cpumask).bits) | |
43 | && test_bit((cpu), (tracing_cpumask_new).bits)) { | |
44 | atomic_dec(&global_trace.data[cpu]->disabled); | |
45 | } | |
46 | } | |
47 | } |