hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/trace_events.h
....@@ -67,8 +67,6 @@
6767 unsigned char flags;
6868 unsigned char preempt_count;
6969 int pid;
70
- unsigned char migrate_disable;
71
- unsigned char preempt_lazy_count;
7270 };
7371
7472 #define TRACE_EVENT_TYPE_MAX \
....@@ -150,78 +148,17 @@
150148
151149 enum print_line_t trace_handle_return(struct trace_seq *s);
152150
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);
218155 struct trace_event_file;
219156
220157 struct ring_buffer_event *
221158 trace_event_buffer_lock_reserve(struct trace_buffer **current_buffer,
222159 struct trace_event_file *trace_file,
223160 int type, unsigned long len,
224
- unsigned int trace_ctx);
161
+ unsigned long flags, int pc);
225162
226163 #define TRACE_RECORD_CMDLINE BIT(0)
227164 #define TRACE_RECORD_TGID BIT(1)
....@@ -295,7 +232,8 @@
295232 struct ring_buffer_event *event;
296233 struct trace_event_file *trace_file;
297234 void *entry;
298
- unsigned int trace_ctx;
235
+ unsigned long flags;
236
+ int pc;
299237 struct pt_regs *regs;
300238 };
301239