]> git.pld-linux.org Git - packages/lttng-modules.git/blob - lttng-modules-linux-3.13.patch
- upstream fixes for linux 3.13
[packages/lttng-modules.git] / lttng-modules-linux-3.13.patch
1 From 33673ee7b705adb6b24350c30966d4937d41ed95 Mon Sep 17 00:00:00 2001
2 From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
3 Date: Mon, 20 Jan 2014 11:31:30 -0500
4 Subject: [PATCH] Update sched instrumentation to Linux 3.13
5
6 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
7 ---
8  instrumentation/events/lttng-module/sched.h |   38 ++++++++++++++++++++++++---
9  1 file changed, 34 insertions(+), 4 deletions(-)
10
11 diff --git a/instrumentation/events/lttng-module/sched.h b/instrumentation/events/lttng-module/sched.h
12 index 25faad0..9e490cf 100644
13 --- a/instrumentation/events/lttng-module/sched.h
14 +++ b/instrumentation/events/lttng-module/sched.h
15 @@ -15,7 +15,24 @@
16  #ifndef _TRACE_SCHED_DEF_
17  #define _TRACE_SCHED_DEF_
18  
19 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
20 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
21 +
22 +static inline long __trace_sched_switch_state(struct task_struct *p)
23 +{
24 +       long state = p->state;
25 +
26 +#ifdef CONFIG_PREEMPT
27 +       /*
28 +        * For all intents and purposes a preempted task is a running task.
29 +        */
30 +       if (task_preempt_count(p) & PREEMPT_ACTIVE)
31 +               state = TASK_RUNNING | TASK_STATE_MAX;
32 +#endif
33 +
34 +       return state;
35 +}
36 +
37 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
38  
39  static inline long __trace_sched_switch_state(struct task_struct *p)
40  {
41 @@ -26,11 +43,24 @@ static inline long __trace_sched_switch_state(struct task_struct *p)
42          * For all intents and purposes a preempted task is a running task.
43          */
44         if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
45 -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
46                 state = TASK_RUNNING | TASK_STATE_MAX;
47 -#else
48 -               state = TASK_RUNNING;
49  #endif
50 +
51 +       return state;
52 +}
53 +
54 +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
55 +
56 +static inline long __trace_sched_switch_state(struct task_struct *p)
57 +{
58 +       long state = p->state;
59 +
60 +#ifdef CONFIG_PREEMPT
61 +       /*
62 +        * For all intents and purposes a preempted task is a running task.
63 +        */
64 +       if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
65 +               state = TASK_RUNNING;
66  #endif
67  
68         return state;
69 -- 
70 1.7.10.4
71
72 From 0d019e70c4c0acccbaed913487c4f0ce96aeda17 Mon Sep 17 00:00:00 2001
73 From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
74 Date: Mon, 20 Jan 2014 11:37:25 -0500
75 Subject: [PATCH] Update kvm instrumentation to Linux 3.13
76
77 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
78 ---
79  instrumentation/events/lttng-module/kvm.h |   25 +++++++++++++++++++++++++
80  1 file changed, 25 insertions(+)
81
82 diff --git a/instrumentation/events/lttng-module/kvm.h b/instrumentation/events/lttng-module/kvm.h
83 index ba4e528..99d1788 100644
84 --- a/instrumentation/events/lttng-module/kvm.h
85 +++ b/instrumentation/events/lttng-module/kvm.h
86 @@ -325,6 +325,29 @@ DEFINE_EVENT(kvm_async_pf_nopresent_ready, kvm_async_pf_ready,
87         TP_ARGS(token, gva)
88  )
89  
90 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0))
91 +
92 +TRACE_EVENT(
93 +       kvm_async_pf_completed,
94 +       TP_PROTO(unsigned long address, u64 gva),
95 +       TP_ARGS(address, gva),
96 +
97 +       TP_STRUCT__entry(
98 +               __field(unsigned long, address)
99 +               __field(u64, gva)
100 +               ),
101 +
102 +       TP_fast_assign(
103 +               tp_assign(address, address)
104 +               tp_assign(gva, gva)
105 +               ),
106 +
107 +       TP_printk("gva %#llx address %#lx",  __entry->gva,
108 +                 __entry->address)
109 +)
110 +
111 +#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) */
112 +
113  TRACE_EVENT(
114         kvm_async_pf_completed,
115         TP_PROTO(unsigned long address, struct page *page, u64 gva),
116 @@ -346,6 +369,8 @@ TRACE_EVENT(
117                   __entry->address, __entry->pfn)
118  )
119  
120 +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0)) */
121 +
122  #endif
123  
124  #endif
125 -- 
126 1.7.10.4
127
This page took 0.754186 seconds and 3 git commands to generate.