aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace.h')
-rw-r--r--kernel/trace/trace.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 37947f6b92bf..9d22618bf99f 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -259,6 +259,29 @@ enum print_line_t {
259 TRACE_TYPE_UNHANDLED = 2 /* Relay to other output functions */ 259 TRACE_TYPE_UNHANDLED = 2 /* Relay to other output functions */
260}; 260};
261 261
262
263/*
264 * An option specific to a tracer. This is a boolean value.
265 * The bit is the bit index that sets its value on the
266 * flags value in struct tracer_flags.
267 */
268struct tracer_opt {
269 const char *name; /* Will appear on the trace_options file */
270 u32 bit; /* Mask assigned in val field in tracer_flags */
271};
272
273/*
274 * The set of specific options for a tracer. Your tracer
275 * have to set the initial value of the flags val.
276 */
277struct tracer_flags {
278 u32 val;
279 struct tracer_opt *opts;
280};
281
282/* Makes more easy to define a tracer opt */
283#define TRACER_OPT(s, b) .name = #s, .bit = b
284
262/* 285/*
263 * A specific tracer, represented by methods that operate on a trace array: 286 * A specific tracer, represented by methods that operate on a trace array:
264 */ 287 */
@@ -280,8 +303,11 @@ struct tracer {
280 struct trace_array *tr); 303 struct trace_array *tr);
281#endif 304#endif
282 enum print_line_t (*print_line)(struct trace_iterator *iter); 305 enum print_line_t (*print_line)(struct trace_iterator *iter);
306 /* If you handled the flag setting, return 0 */
307 int (*set_flag)(u32 old_flags, u32 bit, int set);
283 struct tracer *next; 308 struct tracer *next;
284 int print_max; 309 int print_max;
310 struct tracer_flags *flags;
285}; 311};
286 312
287struct trace_seq { 313struct trace_seq {