3 #define _MARK_TRAP (1 << MARK_TRAP)
7 #define _MARK_PREEMPT (1 << MARK_PREEMPT)
8 Permits blocking calls within probe.
9 How to deal with probe removal :
10 Each site has its per cpu probe_exec counters. The sum of the signed values
11 gives the number of executors. Operations inc/dec on those values are done
12 within preempt disable so they can be done non atomically without risking
13 to be corrupted by another CPU.
14 1 - disable site and remove call
15 2 - while sum of probe_exec counters != 0, sleep 50ms
17 - if someone sleeps in here for a long time or waits for
18 a busy ressource, removal may fail with -EBUSY.
24 probe_exec[smp_processor_id()]++;
28 probe_exec[smp_processor_id()]--;
32 #define MARK_RESCHED 3
33 #define _MARK_RESCHED (1 << MARK_RESCHED)
34 preempt_schedule() will be called by the marker.
36 #define _MARK_DEFAULT (~_MARK_PREEMPT | _MARK_TRAP | _MARK_RESCHED)
38 #define MARK (format, ...) MARK_OPTIONS(MARK_DEFAULT, format, __VA_ARGS__)
41 #define MARK_OPTIONS(opt, format, ...) \
43 if (opt & _MARK_NO_TRAP) \
44 GEN_MARK(opt, format, __VA_ARGS__); \
46 MARK(opt, format, __VA_ARGS__); \
50 #define MARK_OPTIONS(opt, format, ...) MARK(opt, format, __VA_ARGS__);
53 MARK(opt, format, ...) \
54 static declare opt in struct; \
57 if (opt & _MARK_PREEMPT) {
58 probe_exec[smp_processor_id()]++;
59 if (opt & _MARK_RESCHED)
62 preempt_enable_no_resched();
65 if (opt & _MARK_PREEMPT) {
67 probe_exec[smp_processor_id()]--;
69 if (opt & _MARK_RESCHED)
72 preempt_enable_no_resched();