diff options
Diffstat (limited to 'tools/lib/traceevent/plugin_sched_switch.c')
| -rw-r--r-- | tools/lib/traceevent/plugin_sched_switch.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/tools/lib/traceevent/plugin_sched_switch.c b/tools/lib/traceevent/plugin_sched_switch.c index ec30c2fcbac0..eecb4bd95c11 100644 --- a/tools/lib/traceevent/plugin_sched_switch.c +++ b/tools/lib/traceevent/plugin_sched_switch.c | |||
| @@ -45,7 +45,7 @@ static void write_state(struct trace_seq *s, int val) | |||
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static void write_and_save_comm(struct format_field *field, | 47 | static void write_and_save_comm(struct format_field *field, |
| 48 | struct pevent_record *record, | 48 | struct tep_record *record, |
| 49 | struct trace_seq *s, int pid) | 49 | struct trace_seq *s, int pid) |
| 50 | { | 50 | { |
| 51 | const char *comm; | 51 | const char *comm; |
| @@ -61,100 +61,100 @@ static void write_and_save_comm(struct format_field *field, | |||
| 61 | comm = &s->buffer[len]; | 61 | comm = &s->buffer[len]; |
| 62 | 62 | ||
| 63 | /* Help out the comm to ids. This will handle dups */ | 63 | /* Help out the comm to ids. This will handle dups */ |
| 64 | pevent_register_comm(field->event->pevent, comm, pid); | 64 | tep_register_comm(field->event->pevent, comm, pid); |
| 65 | } | 65 | } |
| 66 | 66 | ||
| 67 | static int sched_wakeup_handler(struct trace_seq *s, | 67 | static int sched_wakeup_handler(struct trace_seq *s, |
| 68 | struct pevent_record *record, | 68 | struct tep_record *record, |
| 69 | struct event_format *event, void *context) | 69 | struct event_format *event, void *context) |
| 70 | { | 70 | { |
| 71 | struct format_field *field; | 71 | struct format_field *field; |
| 72 | unsigned long long val; | 72 | unsigned long long val; |
| 73 | 73 | ||
| 74 | if (pevent_get_field_val(s, event, "pid", record, &val, 1)) | 74 | if (tep_get_field_val(s, event, "pid", record, &val, 1)) |
| 75 | return trace_seq_putc(s, '!'); | 75 | return trace_seq_putc(s, '!'); |
| 76 | 76 | ||
| 77 | field = pevent_find_any_field(event, "comm"); | 77 | field = tep_find_any_field(event, "comm"); |
| 78 | if (field) { | 78 | if (field) { |
| 79 | write_and_save_comm(field, record, s, val); | 79 | write_and_save_comm(field, record, s, val); |
| 80 | trace_seq_putc(s, ':'); | 80 | trace_seq_putc(s, ':'); |
| 81 | } | 81 | } |
| 82 | trace_seq_printf(s, "%lld", val); | 82 | trace_seq_printf(s, "%lld", val); |
| 83 | 83 | ||
| 84 | if (pevent_get_field_val(s, event, "prio", record, &val, 0) == 0) | 84 | if (tep_get_field_val(s, event, "prio", record, &val, 0) == 0) |
| 85 | trace_seq_printf(s, " [%lld]", val); | 85 | trace_seq_printf(s, " [%lld]", val); |
| 86 | 86 | ||
| 87 | if (pevent_get_field_val(s, event, "success", record, &val, 1) == 0) | 87 | if (tep_get_field_val(s, event, "success", record, &val, 1) == 0) |
| 88 | trace_seq_printf(s, " success=%lld", val); | 88 | trace_seq_printf(s, " success=%lld", val); |
| 89 | 89 | ||
| 90 | if (pevent_get_field_val(s, event, "target_cpu", record, &val, 0) == 0) | 90 | if (tep_get_field_val(s, event, "target_cpu", record, &val, 0) == 0) |
| 91 | trace_seq_printf(s, " CPU:%03llu", val); | 91 | trace_seq_printf(s, " CPU:%03llu", val); |
| 92 | 92 | ||
| 93 | return 0; | 93 | return 0; |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | static int sched_switch_handler(struct trace_seq *s, | 96 | static int sched_switch_handler(struct trace_seq *s, |
| 97 | struct pevent_record *record, | 97 | struct tep_record *record, |
| 98 | struct event_format *event, void *context) | 98 | struct event_format *event, void *context) |
| 99 | { | 99 | { |
| 100 | struct format_field *field; | 100 | struct format_field *field; |
| 101 | unsigned long long val; | 101 | unsigned long long val; |
| 102 | 102 | ||
| 103 | if (pevent_get_field_val(s, event, "prev_pid", record, &val, 1)) | 103 | if (tep_get_field_val(s, event, "prev_pid", record, &val, 1)) |
| 104 | return trace_seq_putc(s, '!'); | 104 | return trace_seq_putc(s, '!'); |
| 105 | 105 | ||
| 106 | field = pevent_find_any_field(event, "prev_comm"); | 106 | field = tep_find_any_field(event, "prev_comm"); |
| 107 | if (field) { | 107 | if (field) { |
| 108 | write_and_save_comm(field, record, s, val); | 108 | write_and_save_comm(field, record, s, val); |
| 109 | trace_seq_putc(s, ':'); | 109 | trace_seq_putc(s, ':'); |
| 110 | } | 110 | } |
| 111 | trace_seq_printf(s, "%lld ", val); | 111 | trace_seq_printf(s, "%lld ", val); |
| 112 | 112 | ||
| 113 | if (pevent_get_field_val(s, event, "prev_prio", record, &val, 0) == 0) | 113 | if (tep_get_field_val(s, event, "prev_prio", record, &val, 0) == 0) |
| 114 | trace_seq_printf(s, "[%d] ", (int) val); | 114 | trace_seq_printf(s, "[%d] ", (int) val); |
| 115 | 115 | ||
| 116 | if (pevent_get_field_val(s, event, "prev_state", record, &val, 0) == 0) | 116 | if (tep_get_field_val(s, event, "prev_state", record, &val, 0) == 0) |
| 117 | write_state(s, val); | 117 | write_state(s, val); |
| 118 | 118 | ||
| 119 | trace_seq_puts(s, " ==> "); | 119 | trace_seq_puts(s, " ==> "); |
| 120 | 120 | ||
| 121 | if (pevent_get_field_val(s, event, "next_pid", record, &val, 1)) | 121 | if (tep_get_field_val(s, event, "next_pid", record, &val, 1)) |
| 122 | return trace_seq_putc(s, '!'); | 122 | return trace_seq_putc(s, '!'); |
| 123 | 123 | ||
| 124 | field = pevent_find_any_field(event, "next_comm"); | 124 | field = tep_find_any_field(event, "next_comm"); |
| 125 | if (field) { | 125 | if (field) { |
| 126 | write_and_save_comm(field, record, s, val); | 126 | write_and_save_comm(field, record, s, val); |
| 127 | trace_seq_putc(s, ':'); | 127 | trace_seq_putc(s, ':'); |
| 128 | } | 128 | } |
| 129 | trace_seq_printf(s, "%lld", val); | 129 | trace_seq_printf(s, "%lld", val); |
| 130 | 130 | ||
| 131 | if (pevent_get_field_val(s, event, "next_prio", record, &val, 0) == 0) | 131 | if (tep_get_field_val(s, event, "next_prio", record, &val, 0) == 0) |
| 132 | trace_seq_printf(s, " [%d]", (int) val); | 132 | trace_seq_printf(s, " [%d]", (int) val); |
| 133 | 133 | ||
| 134 | return 0; | 134 | return 0; |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | int PEVENT_PLUGIN_LOADER(struct pevent *pevent) | 137 | int TEP_PLUGIN_LOADER(struct tep_handle *pevent) |
| 138 | { | 138 | { |
| 139 | pevent_register_event_handler(pevent, -1, "sched", "sched_switch", | 139 | tep_register_event_handler(pevent, -1, "sched", "sched_switch", |
| 140 | sched_switch_handler, NULL); | 140 | sched_switch_handler, NULL); |
| 141 | 141 | ||
| 142 | pevent_register_event_handler(pevent, -1, "sched", "sched_wakeup", | 142 | tep_register_event_handler(pevent, -1, "sched", "sched_wakeup", |
| 143 | sched_wakeup_handler, NULL); | 143 | sched_wakeup_handler, NULL); |
| 144 | 144 | ||
| 145 | pevent_register_event_handler(pevent, -1, "sched", "sched_wakeup_new", | 145 | tep_register_event_handler(pevent, -1, "sched", "sched_wakeup_new", |
| 146 | sched_wakeup_handler, NULL); | 146 | sched_wakeup_handler, NULL); |
| 147 | return 0; | 147 | return 0; |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | void PEVENT_PLUGIN_UNLOADER(struct pevent *pevent) | 150 | void TEP_PLUGIN_UNLOADER(struct tep_handle *pevent) |
| 151 | { | 151 | { |
| 152 | pevent_unregister_event_handler(pevent, -1, "sched", "sched_switch", | 152 | tep_unregister_event_handler(pevent, -1, "sched", "sched_switch", |
| 153 | sched_switch_handler, NULL); | 153 | sched_switch_handler, NULL); |
| 154 | 154 | ||
| 155 | pevent_unregister_event_handler(pevent, -1, "sched", "sched_wakeup", | 155 | tep_unregister_event_handler(pevent, -1, "sched", "sched_wakeup", |
| 156 | sched_wakeup_handler, NULL); | 156 | sched_wakeup_handler, NULL); |
| 157 | 157 | ||
| 158 | pevent_unregister_event_handler(pevent, -1, "sched", "sched_wakeup_new", | 158 | tep_unregister_event_handler(pevent, -1, "sched", "sched_wakeup_new", |
| 159 | sched_wakeup_handler, NULL); | 159 | sched_wakeup_handler, NULL); |
| 160 | } | 160 | } |
