aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/sched_trace_external.h
blob: e70e45e4cf51eb017eb425553fa746826376b965 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/*
 * sched_trace.h -- record scheduler events to a byte stream for offline analysis.
 */
#ifndef _LINUX_SCHED_TRACE_EXTERNAL_H_
#define _LINUX_SCHED_TRACE_EXTERNAL_H_


#ifdef CONFIG_SCHED_TASK_TRACE
extern void __sched_trace_tasklet_begin_external(struct task_struct* t);
static inline void sched_trace_tasklet_begin_external(struct task_struct* t)
{
	__sched_trace_tasklet_begin_external(t);
}

extern void __sched_trace_tasklet_end_external(struct task_struct* t, unsigned long flushed);
static inline void sched_trace_tasklet_end_external(struct task_struct* t, unsigned long flushed)
{
	__sched_trace_tasklet_end_external(t, flushed);
}

extern void __sched_trace_work_begin_external(struct task_struct* t, struct task_struct* e);
static inline void sched_trace_work_begin_external(struct task_struct* t, struct task_struct* e)
{
	__sched_trace_work_begin_external(t, e);
}

extern void __sched_trace_work_end_external(struct task_struct* t, struct task_struct* e, unsigned long f);
static inline void sched_trace_work_end_external(struct task_struct* t, struct task_struct* e, unsigned long f)
{
	__sched_trace_work_end_external(t, e, f);
}

#ifdef CONFIG_LITMUS_NVIDIA
extern void __sched_trace_nv_interrupt_begin_external(u32 device);
static inline void sched_trace_nv_interrupt_begin_external(u32 device)
{
	__sched_trace_nv_interrupt_begin_external(device);
}

extern void __sched_trace_nv_interrupt_end_external(u32 device);
static inline void sched_trace_nv_interrupt_end_external(u32 device)
{
	__sched_trace_nv_interrupt_end_external(device);
}
#endif

#else

// no tracing.
static inline void sched_trace_tasklet_begin_external(struct task_struct* t){}
static inline void sched_trace_tasklet_end_external(struct task_struct* t, unsigned long flushed){}
static inline void sched_trace_work_begin_external(struct task_struct* t, struct task_struct* e){}
static inline void sched_trace_work_end_external(struct task_struct* t, struct task_struct* e, unsigned long f){}

#ifdef CONFIG_LITMUS_NVIDIA
static inline void sched_trace_nv_interrupt_begin_external(u32 device){}
static inline void sched_trace_nv_interrupt_end_external(u32 device){}
#endif

#endif


#ifdef CONFIG_LITMUS_NVIDIA

#define EX_TS(evt) \
extern void __##evt(void); \
static inline void EX_##evt(void) { __##evt(); }

EX_TS(TS_NV_TOPISR_START)
EX_TS(TS_NV_TOPISR_END)
EX_TS(TS_NV_BOTISR_START)
EX_TS(TS_NV_BOTISR_END)
EX_TS(TS_NV_RELEASE_BOTISR_START)
EX_TS(TS_NV_RELEASE_BOTISR_END)

#endif

#endif