.. | .. |
---|
67 | 67 | unsigned char flags; |
---|
68 | 68 | unsigned char preempt_count; |
---|
69 | 69 | int pid; |
---|
70 | | - unsigned char migrate_disable; |
---|
71 | | - unsigned char preempt_lazy_count; |
---|
72 | 70 | }; |
---|
73 | 71 | |
---|
74 | 72 | #define TRACE_EVENT_TYPE_MAX \ |
---|
.. | .. |
---|
150 | 148 | |
---|
151 | 149 | enum print_line_t trace_handle_return(struct trace_seq *s); |
---|
152 | 150 | |
---|
153 | | -static inline void tracing_generic_entry_update(struct trace_entry *entry, |
---|
154 | | - unsigned short type, |
---|
155 | | - unsigned int trace_ctx) |
---|
156 | | -{ |
---|
157 | | - entry->preempt_count = trace_ctx & 0xff; |
---|
158 | | - entry->migrate_disable = (trace_ctx >> 8) & 0xff; |
---|
159 | | - entry->preempt_lazy_count = (trace_ctx >> 16) & 0xff; |
---|
160 | | - entry->pid = current->pid; |
---|
161 | | - entry->type = type; |
---|
162 | | - entry->flags = trace_ctx >> 24; |
---|
163 | | -} |
---|
164 | | - |
---|
165 | | -unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status); |
---|
166 | | - |
---|
167 | | -enum trace_flag_type { |
---|
168 | | - TRACE_FLAG_IRQS_OFF = 0x01, |
---|
169 | | - TRACE_FLAG_IRQS_NOSUPPORT = 0x02, |
---|
170 | | - TRACE_FLAG_NEED_RESCHED = 0x04, |
---|
171 | | - TRACE_FLAG_HARDIRQ = 0x08, |
---|
172 | | - TRACE_FLAG_SOFTIRQ = 0x10, |
---|
173 | | - TRACE_FLAG_PREEMPT_RESCHED = 0x20, |
---|
174 | | - TRACE_FLAG_NMI = 0x40, |
---|
175 | | - TRACE_FLAG_NEED_RESCHED_LAZY = 0x80, |
---|
176 | | -}; |
---|
177 | | - |
---|
178 | | -#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT |
---|
179 | | -static inline unsigned int tracing_gen_ctx_flags(unsigned long irqflags) |
---|
180 | | -{ |
---|
181 | | - unsigned int irq_status = irqs_disabled_flags(irqflags) ? |
---|
182 | | - TRACE_FLAG_IRQS_OFF : 0; |
---|
183 | | - return tracing_gen_ctx_irq_test(irq_status); |
---|
184 | | -} |
---|
185 | | -static inline unsigned int tracing_gen_ctx(void) |
---|
186 | | -{ |
---|
187 | | - unsigned long irqflags; |
---|
188 | | - |
---|
189 | | - local_save_flags(irqflags); |
---|
190 | | - return tracing_gen_ctx_flags(irqflags); |
---|
191 | | -} |
---|
192 | | -#else |
---|
193 | | - |
---|
194 | | -static inline unsigned int tracing_gen_ctx_flags(unsigned long irqflags) |
---|
195 | | -{ |
---|
196 | | - return tracing_gen_ctx_irq_test(TRACE_FLAG_IRQS_NOSUPPORT); |
---|
197 | | -} |
---|
198 | | -static inline unsigned int tracing_gen_ctx(void) |
---|
199 | | -{ |
---|
200 | | - return tracing_gen_ctx_irq_test(TRACE_FLAG_IRQS_NOSUPPORT); |
---|
201 | | -} |
---|
202 | | -#endif |
---|
203 | | - |
---|
204 | | -static inline unsigned int tracing_gen_ctx_dec(void) |
---|
205 | | -{ |
---|
206 | | - unsigned int trace_ctx; |
---|
207 | | - |
---|
208 | | - trace_ctx = tracing_gen_ctx(); |
---|
209 | | - /* |
---|
210 | | - * Subtract one from the preeption counter if preemption is enabled, |
---|
211 | | - * see trace_event_buffer_reserve()for details. |
---|
212 | | - */ |
---|
213 | | - if (IS_ENABLED(CONFIG_PREEMPTION)) |
---|
214 | | - trace_ctx--; |
---|
215 | | - return trace_ctx; |
---|
216 | | -} |
---|
217 | | - |
---|
| 151 | +void tracing_generic_entry_update(struct trace_entry *entry, |
---|
| 152 | + unsigned short type, |
---|
| 153 | + unsigned long flags, |
---|
| 154 | + int pc); |
---|
218 | 155 | struct trace_event_file; |
---|
219 | 156 | |
---|
220 | 157 | struct ring_buffer_event * |
---|
221 | 158 | trace_event_buffer_lock_reserve(struct trace_buffer **current_buffer, |
---|
222 | 159 | struct trace_event_file *trace_file, |
---|
223 | 160 | int type, unsigned long len, |
---|
224 | | - unsigned int trace_ctx); |
---|
| 161 | + unsigned long flags, int pc); |
---|
225 | 162 | |
---|
226 | 163 | #define TRACE_RECORD_CMDLINE BIT(0) |
---|
227 | 164 | #define TRACE_RECORD_TGID BIT(1) |
---|
.. | .. |
---|
295 | 232 | struct ring_buffer_event *event; |
---|
296 | 233 | struct trace_event_file *trace_file; |
---|
297 | 234 | void *entry; |
---|
298 | | - unsigned int trace_ctx; |
---|
| 235 | + unsigned long flags; |
---|
| 236 | + int pc; |
---|
299 | 237 | struct pt_regs *regs; |
---|
300 | 238 | }; |
---|
301 | 239 | |
---|