1 // SPDX-License-Identifier: LGPL-2.1
3 * Copyright (C) 2009 Red Hat Inc, Steven Rostedt <srostedt@redhat.com>
4 * Copyright (C) 2009 Johannes Berg <johannes@sipsolutions.net>
10 #include "event-parse.h"
11 #include "trace-seq.h"
13 static int timer_expire_handler(struct trace_seq
*s
,
14 struct tep_record
*record
,
15 struct tep_event
*event
, void *context
)
17 trace_seq_printf(s
, "hrtimer=");
19 if (tep_print_num_field(s
, "0x%llx", event
, "timer",
21 tep_print_num_field(s
, "0x%llx", event
, "hrtimer",
24 trace_seq_printf(s
, " now=");
26 tep_print_num_field(s
, "%llu", event
, "now", record
, 1);
28 tep_print_func_field(s
, " function=%s", event
, "function",
33 static int timer_start_handler(struct trace_seq
*s
,
34 struct tep_record
*record
,
35 struct tep_event
*event
, void *context
)
37 trace_seq_printf(s
, "hrtimer=");
39 if (tep_print_num_field(s
, "0x%llx", event
, "timer",
41 tep_print_num_field(s
, "0x%llx", event
, "hrtimer",
44 tep_print_func_field(s
, " function=%s", event
, "function",
47 trace_seq_printf(s
, " expires=");
48 tep_print_num_field(s
, "%llu", event
, "expires", record
, 1);
50 trace_seq_printf(s
, " softexpires=");
51 tep_print_num_field(s
, "%llu", event
, "softexpires", record
, 1);
55 int TEP_PLUGIN_LOADER(struct tep_handle
*tep
)
57 tep_register_event_handler(tep
, -1,
58 "timer", "hrtimer_expire_entry",
59 timer_expire_handler
, NULL
);
61 tep_register_event_handler(tep
, -1, "timer", "hrtimer_start",
62 timer_start_handler
, NULL
);
66 void TEP_PLUGIN_UNLOADER(struct tep_handle
*tep
)
68 tep_unregister_event_handler(tep
, -1,
69 "timer", "hrtimer_expire_entry",
70 timer_expire_handler
, NULL
);
72 tep_unregister_event_handler(tep
, -1, "timer", "hrtimer_start",
73 timer_start_handler
, NULL
);