diff options
-rw-r--r-- | parse-events.c | 85 | ||||
-rw-r--r-- | parse-events.h | 10 | ||||
-rw-r--r-- | plugin_sched_switch.c | 56 | ||||
-rw-r--r-- | trace-ftrace.c | 65 |
4 files changed, 133 insertions, 83 deletions
diff --git a/parse-events.c b/parse-events.c index 8fd93ec..53dc8ad 100644 --- a/parse-events.c +++ b/parse-events.c | |||
@@ -4421,6 +4421,91 @@ int pevent_parse_event(struct pevent *pevent, | |||
4421 | return -1; | 4421 | return -1; |
4422 | } | 4422 | } |
4423 | 4423 | ||
4424 | int get_field_val(struct trace_seq *s, struct format_field *field, | ||
4425 | const char *name, struct record *record, | ||
4426 | unsigned long long *val, int err) | ||
4427 | { | ||
4428 | if (!field) { | ||
4429 | if (err) | ||
4430 | trace_seq_printf(s, "<CANT FIND FIELD %s>", name); | ||
4431 | return -1; | ||
4432 | } | ||
4433 | |||
4434 | if (pevent_read_number_field(field, record->data, val)) { | ||
4435 | if (err) | ||
4436 | trace_seq_printf(s, " %s=INVALID", name); | ||
4437 | return -1; | ||
4438 | } | ||
4439 | |||
4440 | return 0; | ||
4441 | } | ||
4442 | |||
4443 | /** | ||
4444 | * pevent_get_field_val - find a field and return its value | ||
4445 | * @s: The seq to print to on error | ||
4446 | * @event: the event that the field is for | ||
4447 | * @name: The name of the field | ||
4448 | * @record: The record with the field name. | ||
4449 | * @val: place to store the value of the field. | ||
4450 | * @err: print default error if failed. | ||
4451 | * | ||
4452 | * Returns 0 on success -1 on field not found. | ||
4453 | */ | ||
4454 | int pevent_get_field_val(struct trace_seq *s, struct event_format *event, | ||
4455 | const char *name, struct record *record, | ||
4456 | unsigned long long *val, int err) | ||
4457 | { | ||
4458 | struct format_field *field; | ||
4459 | |||
4460 | field = pevent_find_field(event, name); | ||
4461 | |||
4462 | return get_field_val(s, field, name, record, val, err); | ||
4463 | } | ||
4464 | |||
4465 | /** | ||
4466 | * pevent_get_common_field_val - find a common field and return its value | ||
4467 | * @s: The seq to print to on error | ||
4468 | * @event: the event that the field is for | ||
4469 | * @name: The name of the field | ||
4470 | * @record: The record with the field name. | ||
4471 | * @val: place to store the value of the field. | ||
4472 | * @err: print default error if failed. | ||
4473 | * | ||
4474 | * Returns 0 on success -1 on field not found. | ||
4475 | */ | ||
4476 | int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, | ||
4477 | const char *name, struct record *record, | ||
4478 | unsigned long long *val, int err) | ||
4479 | { | ||
4480 | struct format_field *field; | ||
4481 | |||
4482 | field = pevent_find_common_field(event, name); | ||
4483 | |||
4484 | return get_field_val(s, field, name, record, val, err); | ||
4485 | } | ||
4486 | |||
4487 | /** | ||
4488 | * pevent_get_any_field_val - find a any field and return its value | ||
4489 | * @s: The seq to print to on error | ||
4490 | * @event: the event that the field is for | ||
4491 | * @name: The name of the field | ||
4492 | * @record: The record with the field name. | ||
4493 | * @val: place to store the value of the field. | ||
4494 | * @err: print default error if failed. | ||
4495 | * | ||
4496 | * Returns 0 on success -1 on field not found. | ||
4497 | */ | ||
4498 | int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event, | ||
4499 | const char *name, struct record *record, | ||
4500 | unsigned long long *val, int err) | ||
4501 | { | ||
4502 | struct format_field *field; | ||
4503 | |||
4504 | field = pevent_find_any_field(event, name); | ||
4505 | |||
4506 | return get_field_val(s, field, name, record, val, err); | ||
4507 | } | ||
4508 | |||
4424 | /** | 4509 | /** |
4425 | * pevent_print_num_field - print a field and a format | 4510 | * pevent_print_num_field - print a field and a format |
4426 | * @s: The seq to print to | 4511 | * @s: The seq to print to |
diff --git a/parse-events.h b/parse-events.h index d90a698..d879084 100644 --- a/parse-events.h +++ b/parse-events.h | |||
@@ -448,6 +448,16 @@ int pevent_parse_header_page(struct pevent *pevent, char *buf, unsigned long siz | |||
448 | int pevent_parse_event(struct pevent *pevent, const char *buf, | 448 | int pevent_parse_event(struct pevent *pevent, const char *buf, |
449 | unsigned long size, const char *sys); | 449 | unsigned long size, const char *sys); |
450 | 450 | ||
451 | int pevent_get_field_val(struct trace_seq *s, struct event_format *event, | ||
452 | const char *name, struct record *record, | ||
453 | unsigned long long *val, int err); | ||
454 | int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, | ||
455 | const char *name, struct record *record, | ||
456 | unsigned long long *val, int err); | ||
457 | int pevent_get_any_field_val(struct trace_seq *s, struct event_format *event, | ||
458 | const char *name, struct record *record, | ||
459 | unsigned long long *val, int err); | ||
460 | |||
451 | int pevent_print_num_field(struct trace_seq *s, const char *fmt, | 461 | int pevent_print_num_field(struct trace_seq *s, const char *fmt, |
452 | struct event_format *event, const char *name, | 462 | struct event_format *event, const char *name, |
453 | struct record *record, int err); | 463 | struct record *record, int err); |
diff --git a/plugin_sched_switch.c b/plugin_sched_switch.c index 01e8298..7490e16 100644 --- a/plugin_sched_switch.c +++ b/plugin_sched_switch.c | |||
@@ -24,28 +24,6 @@ | |||
24 | 24 | ||
25 | #include "trace-cmd.h" | 25 | #include "trace-cmd.h" |
26 | 26 | ||
27 | static int get_field_val(struct trace_seq *s, void *data, | ||
28 | struct event_format *event, const char *name, | ||
29 | unsigned long long *val, int fail) | ||
30 | { | ||
31 | struct format_field *field; | ||
32 | |||
33 | field = pevent_find_any_field(event, name); | ||
34 | if (!field) { | ||
35 | if (fail) | ||
36 | trace_seq_printf(s, "<CANT FIND FIELD %s>", name); | ||
37 | return -1; | ||
38 | } | ||
39 | |||
40 | if (pevent_read_number_field(field, data, val)) { | ||
41 | if (fail) | ||
42 | trace_seq_printf(s, " %s=INVALID", name); | ||
43 | return -1; | ||
44 | } | ||
45 | |||
46 | return 0; | ||
47 | } | ||
48 | |||
49 | static void write_state(struct trace_seq *s, int val) | 27 | static void write_state(struct trace_seq *s, int val) |
50 | { | 28 | { |
51 | const char states[] = "SDTtZXxW"; | 29 | const char states[] = "SDTtZXxW"; |
@@ -72,54 +50,53 @@ static int sched_wakeup_handler(struct trace_seq *s, struct record *record, | |||
72 | { | 50 | { |
73 | struct format_field *field; | 51 | struct format_field *field; |
74 | unsigned long long val; | 52 | unsigned long long val; |
75 | void *data = record->data; | ||
76 | 53 | ||
77 | if (get_field_val(s, data, event, "common_pid", &val, 1)) | 54 | if (pevent_get_common_field_val(s, event, "common_pid", record, &val, 1)) |
78 | return trace_seq_putc(s, '!'); | 55 | return trace_seq_putc(s, '!'); |
79 | 56 | ||
80 | trace_seq_printf(s, "%lld:", val); | 57 | trace_seq_printf(s, "%lld:", val); |
81 | 58 | ||
82 | if (get_field_val(s, data, event, "prev_prio", &val, 0)) | 59 | if (pevent_get_field_val(s, event, "prev_prio", record, &val, 0)) |
83 | trace_seq_puts(s, "?:"); | 60 | trace_seq_puts(s, "?:"); |
84 | else | 61 | else |
85 | trace_seq_printf(s, "%lld:", val); | 62 | trace_seq_printf(s, "%lld:", val); |
86 | 63 | ||
87 | if (get_field_val(s, data, event, "prev_state", &val, 0)) | 64 | if (pevent_get_field_val(s, event, "prev_state", record, &val, 0)) |
88 | trace_seq_putc(s, '?'); | 65 | trace_seq_putc(s, '?'); |
89 | else | 66 | else |
90 | write_state(s, val); | 67 | write_state(s, val); |
91 | 68 | ||
92 | trace_seq_puts(s, " + "); | 69 | trace_seq_puts(s, " + "); |
93 | 70 | ||
94 | if (get_field_val(s, data, event, "pid", &val, 1)) | 71 | if (pevent_get_field_val(s, event, "pid", record, &val, 1)) |
95 | return trace_seq_putc(s, '!'); | 72 | return trace_seq_putc(s, '!'); |
96 | 73 | ||
97 | trace_seq_printf(s, "%lld:", val); | 74 | trace_seq_printf(s, "%lld:", val); |
98 | 75 | ||
99 | if (get_field_val(s, data, event, "prio", &val, 1)) | 76 | if (pevent_get_field_val(s, event, "prio", record, &val, 1)) |
100 | return trace_seq_putc(s, '!'); | 77 | return trace_seq_putc(s, '!'); |
101 | 78 | ||
102 | trace_seq_printf(s, "%lld:", val); | 79 | trace_seq_printf(s, "%lld:", val); |
103 | 80 | ||
104 | if (get_field_val(s, data, event, "state", &val, 0)) | 81 | if (pevent_get_field_val(s, event, "state", record, &val, 0)) |
105 | trace_seq_putc(s, '?'); | 82 | trace_seq_putc(s, '?'); |
106 | else | 83 | else |
107 | write_state(s, val); | 84 | write_state(s, val); |
108 | 85 | ||
109 | trace_seq_putc(s, ' '); | 86 | trace_seq_putc(s, ' '); |
110 | 87 | ||
111 | field = pevent_find_any_field(event, "comm"); | 88 | field = pevent_find_field(event, "comm"); |
112 | if (!field) { | 89 | if (!field) { |
113 | trace_seq_printf(s, "<CANT FIND FIELD %s>", "next_comm"); | 90 | trace_seq_printf(s, "<CANT FIND FIELD %s>", "next_comm"); |
114 | return trace_seq_putc(s, '!'); | 91 | return trace_seq_putc(s, '!'); |
115 | } | 92 | } |
116 | 93 | ||
117 | trace_seq_printf(s, "%.*s", field->size, (char *)(data + field->offset)); | 94 | trace_seq_printf(s, "%.*s", field->size, (char *)(record->data + field->offset)); |
118 | 95 | ||
119 | if (get_field_val(s, data, event, "target_cpu", &val, 0) == 0) | 96 | if (pevent_get_field_val(s, event, "target_cpu", record, &val, 0) == 0) |
120 | trace_seq_printf(s, " [%03llu]", val); | 97 | trace_seq_printf(s, " [%03llu]", val); |
121 | 98 | ||
122 | if (get_field_val(s, data, event, "success", &val, 0) == 0) | 99 | if (pevent_get_field_val(s, event, "success", record, &val, 0) == 0) |
123 | trace_seq_puts(s, val ? " Success" : " Failed"); | 100 | trace_seq_puts(s, val ? " Success" : " Failed"); |
124 | 101 | ||
125 | return 0; | 102 | return 0; |
@@ -130,31 +107,30 @@ static int sched_switch_handler(struct trace_seq *s, struct record *record, | |||
130 | { | 107 | { |
131 | struct format_field *field; | 108 | struct format_field *field; |
132 | unsigned long long val; | 109 | unsigned long long val; |
133 | void *data = record->data; | ||
134 | 110 | ||
135 | if (get_field_val(s, data, event, "prev_pid", &val, 1)) | 111 | if (pevent_get_field_val(s, event, "prev_pid", record, &val, 1)) |
136 | return trace_seq_putc(s, '!'); | 112 | return trace_seq_putc(s, '!'); |
137 | 113 | ||
138 | trace_seq_printf(s, "%lld:", val); | 114 | trace_seq_printf(s, "%lld:", val); |
139 | 115 | ||
140 | if (get_field_val(s, data, event, "prev_prio", &val, 1)) | 116 | if (pevent_get_field_val(s, event, "prev_prio", record, &val, 1)) |
141 | return trace_seq_putc(s, '!'); | 117 | return trace_seq_putc(s, '!'); |
142 | 118 | ||
143 | trace_seq_printf(s, "%lld:", val); | 119 | trace_seq_printf(s, "%lld:", val); |
144 | 120 | ||
145 | if (get_field_val(s, data, event, "prev_state", &val, 1)) | 121 | if (pevent_get_field_val(s, event, "prev_state", record, &val, 1)) |
146 | return trace_seq_putc(s, '!'); | 122 | return trace_seq_putc(s, '!'); |
147 | 123 | ||
148 | write_state(s, val); | 124 | write_state(s, val); |
149 | 125 | ||
150 | trace_seq_puts(s, " ==> "); | 126 | trace_seq_puts(s, " ==> "); |
151 | 127 | ||
152 | if (get_field_val(s, data, event, "next_pid", &val, 1)) | 128 | if (pevent_get_field_val(s, event, "next_pid", record, &val, 1)) |
153 | return trace_seq_putc(s, '!'); | 129 | return trace_seq_putc(s, '!'); |
154 | 130 | ||
155 | trace_seq_printf(s, "%lld:", val); | 131 | trace_seq_printf(s, "%lld:", val); |
156 | 132 | ||
157 | if (get_field_val(s, data, event, "next_prio", &val, 1)) | 133 | if (pevent_get_field_val(s, event, "next_prio", record, &val, 1)) |
158 | return trace_seq_putc(s, '!'); | 134 | return trace_seq_putc(s, '!'); |
159 | 135 | ||
160 | trace_seq_printf(s, "%lld:", val); | 136 | trace_seq_printf(s, "%lld:", val); |
@@ -167,7 +143,7 @@ static int sched_switch_handler(struct trace_seq *s, struct record *record, | |||
167 | return trace_seq_putc(s, '!'); | 143 | return trace_seq_putc(s, '!'); |
168 | } | 144 | } |
169 | 145 | ||
170 | trace_seq_printf(s, "%.*s", field->size, (char *)(data + field->offset)); | 146 | trace_seq_printf(s, "%.*s", field->size, (char *)(record->data + field->offset)); |
171 | 147 | ||
172 | return 0; | 148 | return 0; |
173 | } | 149 | } |
diff --git a/trace-ftrace.c b/trace-ftrace.c index 181a00f..f12b221 100644 --- a/trace-ftrace.c +++ b/trace-ftrace.c | |||
@@ -29,35 +29,14 @@ static struct event_format *fgraph_ret_event; | |||
29 | static int fgraph_ret_id; | 29 | static int fgraph_ret_id; |
30 | static int long_size; | 30 | static int long_size; |
31 | 31 | ||
32 | static int get_field_val(struct trace_seq *s, void *data, | ||
33 | struct event_format *event, const char *name, | ||
34 | unsigned long long *val) | ||
35 | { | ||
36 | struct format_field *field; | ||
37 | |||
38 | field = pevent_find_any_field(event, name); | ||
39 | if (!field) { | ||
40 | trace_seq_printf(s, "<CANT FIND FIELD %s>", name); | ||
41 | return -1; | ||
42 | } | ||
43 | |||
44 | if (pevent_read_number_field(field, data, val)) { | ||
45 | trace_seq_printf(s, " %s=INVALID", name); | ||
46 | return -1; | ||
47 | } | ||
48 | |||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | static int function_handler(struct trace_seq *s, struct record *record, | 32 | static int function_handler(struct trace_seq *s, struct record *record, |
53 | struct event_format *event, void *context) | 33 | struct event_format *event, void *context) |
54 | { | 34 | { |
55 | struct pevent *pevent = event->pevent; | 35 | struct pevent *pevent = event->pevent; |
56 | unsigned long long function; | 36 | unsigned long long function; |
57 | const char *func; | 37 | const char *func; |
58 | void *data = record->data; | ||
59 | 38 | ||
60 | if (get_field_val(s, data, event, "ip", &function)) | 39 | if (pevent_get_field_val(s, event, "ip", record, &function, 1)) |
61 | return trace_seq_putc(s, '!'); | 40 | return trace_seq_putc(s, '!'); |
62 | 41 | ||
63 | func = pevent_find_function(pevent, function); | 42 | func = pevent_find_function(pevent, function); |
@@ -66,7 +45,7 @@ static int function_handler(struct trace_seq *s, struct record *record, | |||
66 | else | 45 | else |
67 | trace_seq_printf(s, "0x%llx", function); | 46 | trace_seq_printf(s, "0x%llx", function); |
68 | 47 | ||
69 | if (get_field_val(s, data, event, "parent_ip", &function)) | 48 | if (pevent_get_field_val(s, event, "parent_ip", record, &function, 1)) |
70 | return trace_seq_putc(s, '!'); | 49 | return trace_seq_putc(s, '!'); |
71 | 50 | ||
72 | func = pevent_find_function(pevent, function); | 51 | func = pevent_find_function(pevent, function); |
@@ -89,20 +68,20 @@ get_return_for_leaf(struct trace_seq *s, int cpu, int cur_pid, | |||
89 | unsigned long long pid; | 68 | unsigned long long pid; |
90 | 69 | ||
91 | /* Searching a common field, can use any event */ | 70 | /* Searching a common field, can use any event */ |
92 | if (get_field_val(s, next->data, fgraph_ret_event, "common_type", &type)) | 71 | if (pevent_get_common_field_val(s, fgraph_ret_event, "common_type", next, &type, 1)) |
93 | return NULL; | 72 | return NULL; |
94 | 73 | ||
95 | if (type != fgraph_ret_id) | 74 | if (type != fgraph_ret_id) |
96 | return NULL; | 75 | return NULL; |
97 | 76 | ||
98 | if (get_field_val(s, next->data, fgraph_ret_event, "common_pid", &pid)) | 77 | if (pevent_get_common_field_val(s, fgraph_ret_event, "common_pid", next, &pid, 1)) |
99 | return NULL; | 78 | return NULL; |
100 | 79 | ||
101 | if (cur_pid != pid) | 80 | if (cur_pid != pid) |
102 | return NULL; | 81 | return NULL; |
103 | 82 | ||
104 | /* We aleady know this is a funcgraph_ret_event */ | 83 | /* We aleady know this is a funcgraph_ret_event */ |
105 | if (get_field_val(s, next->data, fgraph_ret_event, "func", &val)) | 84 | if (pevent_get_field_val(s, fgraph_ret_event, "func", next, &val, 1)) |
106 | return NULL; | 85 | return NULL; |
107 | 86 | ||
108 | if (cur_func != val) | 87 | if (cur_func != val) |
@@ -166,7 +145,8 @@ static void print_graph_duration(struct trace_seq *s, unsigned long long duratio | |||
166 | 145 | ||
167 | static int | 146 | static int |
168 | print_graph_entry_leaf(struct trace_seq *s, | 147 | print_graph_entry_leaf(struct trace_seq *s, |
169 | struct event_format *event, void *data, struct record *ret_rec) | 148 | struct event_format *event, |
149 | struct record *record, struct record *ret_rec) | ||
170 | { | 150 | { |
171 | struct pevent *pevent = event->pevent; | 151 | struct pevent *pevent = event->pevent; |
172 | unsigned long long rettime, calltime; | 152 | unsigned long long rettime, calltime; |
@@ -176,10 +156,10 @@ print_graph_entry_leaf(struct trace_seq *s, | |||
176 | int i; | 156 | int i; |
177 | 157 | ||
178 | 158 | ||
179 | if (get_field_val(s, ret_rec->data, fgraph_ret_event, "rettime", &rettime)) | 159 | if (pevent_get_field_val(s, fgraph_ret_event, "rettime", ret_rec, &rettime, 1)) |
180 | return trace_seq_putc(s, '!'); | 160 | return trace_seq_putc(s, '!'); |
181 | 161 | ||
182 | if (get_field_val(s, ret_rec->data, fgraph_ret_event, "calltime", &calltime)) | 162 | if (pevent_get_field_val(s, fgraph_ret_event, "calltime", ret_rec, &calltime, 1)) |
183 | return trace_seq_putc(s, '!'); | 163 | return trace_seq_putc(s, '!'); |
184 | 164 | ||
185 | duration = rettime - calltime; | 165 | duration = rettime - calltime; |
@@ -190,14 +170,14 @@ print_graph_entry_leaf(struct trace_seq *s, | |||
190 | /* Duration */ | 170 | /* Duration */ |
191 | print_graph_duration(s, duration); | 171 | print_graph_duration(s, duration); |
192 | 172 | ||
193 | if (get_field_val(s, data, event, "depth", &depth)) | 173 | if (pevent_get_field_val(s, event, "depth", record, &depth, 1)) |
194 | return trace_seq_putc(s, '!'); | 174 | return trace_seq_putc(s, '!'); |
195 | 175 | ||
196 | /* Function */ | 176 | /* Function */ |
197 | for (i = 0; i < (int)(depth * TRACE_GRAPH_INDENT); i++) | 177 | for (i = 0; i < (int)(depth * TRACE_GRAPH_INDENT); i++) |
198 | trace_seq_putc(s, ' '); | 178 | trace_seq_putc(s, ' '); |
199 | 179 | ||
200 | if (get_field_val(s, data, event, "func", &val)) | 180 | if (pevent_get_field_val(s, event, "func", record, &val, 1)) |
201 | return trace_seq_putc(s, '!'); | 181 | return trace_seq_putc(s, '!'); |
202 | func = pevent_find_function(pevent, val); | 182 | func = pevent_find_function(pevent, val); |
203 | 183 | ||
@@ -208,7 +188,8 @@ print_graph_entry_leaf(struct trace_seq *s, | |||
208 | } | 188 | } |
209 | 189 | ||
210 | static int print_graph_nested(struct trace_seq *s, | 190 | static int print_graph_nested(struct trace_seq *s, |
211 | struct event_format *event, void *data) | 191 | struct event_format *event, |
192 | struct record *record) | ||
212 | { | 193 | { |
213 | struct pevent *pevent = event->pevent; | 194 | struct pevent *pevent = event->pevent; |
214 | unsigned long long depth; | 195 | unsigned long long depth; |
@@ -222,14 +203,14 @@ static int print_graph_nested(struct trace_seq *s, | |||
222 | /* No time */ | 203 | /* No time */ |
223 | trace_seq_puts(s, " | "); | 204 | trace_seq_puts(s, " | "); |
224 | 205 | ||
225 | if (get_field_val(s, data, event, "depth", &depth)) | 206 | if (pevent_get_field_val(s, event, "depth", record, &depth, 1)) |
226 | return trace_seq_putc(s, '!'); | 207 | return trace_seq_putc(s, '!'); |
227 | 208 | ||
228 | /* Function */ | 209 | /* Function */ |
229 | for (i = 0; i < (int)(depth * TRACE_GRAPH_INDENT); i++) | 210 | for (i = 0; i < (int)(depth * TRACE_GRAPH_INDENT); i++) |
230 | trace_seq_putc(s, ' '); | 211 | trace_seq_putc(s, ' '); |
231 | 212 | ||
232 | if (get_field_val(s, data, event, "func", &val)) | 213 | if (pevent_get_field_val(s, event, "func", record, &val, 1)) |
233 | return trace_seq_putc(s, '!'); | 214 | return trace_seq_putc(s, '!'); |
234 | 215 | ||
235 | func = pevent_find_function(pevent, val); | 216 | func = pevent_find_function(pevent, val); |
@@ -246,13 +227,12 @@ fgraph_ent_handler(struct trace_seq *s, struct record *record, | |||
246 | { | 227 | { |
247 | struct record *rec; | 228 | struct record *rec; |
248 | unsigned long long val, pid; | 229 | unsigned long long val, pid; |
249 | void *data = record->data; | ||
250 | int cpu = record->cpu; | 230 | int cpu = record->cpu; |
251 | 231 | ||
252 | if (get_field_val(s, data, event, "common_pid", &pid)) | 232 | if (pevent_get_common_field_val(s, event, "common_pid", record, &pid, 1)) |
253 | return trace_seq_putc(s, '!'); | 233 | return trace_seq_putc(s, '!'); |
254 | 234 | ||
255 | if (get_field_val(s, data, event, "func", &val)) | 235 | if (pevent_get_field_val(s, event, "func", record, &val, 1)) |
256 | return trace_seq_putc(s, '!'); | 236 | return trace_seq_putc(s, '!'); |
257 | 237 | ||
258 | rec = tracecmd_peek_data(tracecmd_curr_thread_handle, cpu); | 238 | rec = tracecmd_peek_data(tracecmd_curr_thread_handle, cpu); |
@@ -264,10 +244,10 @@ fgraph_ent_handler(struct trace_seq *s, struct record *record, | |||
264 | * If this is a leaf function, then get_return_for_leaf | 244 | * If this is a leaf function, then get_return_for_leaf |
265 | * returns the return of the function | 245 | * returns the return of the function |
266 | */ | 246 | */ |
267 | print_graph_entry_leaf(s, event, data, rec); | 247 | print_graph_entry_leaf(s, event, record, rec); |
268 | free_record(rec); | 248 | free_record(rec); |
269 | } else | 249 | } else |
270 | print_graph_nested(s, event, data); | 250 | print_graph_nested(s, event, record); |
271 | 251 | ||
272 | return 0; | 252 | return 0; |
273 | } | 253 | } |
@@ -278,13 +258,12 @@ fgraph_ret_handler(struct trace_seq *s, struct record *record, | |||
278 | { | 258 | { |
279 | unsigned long long rettime, calltime; | 259 | unsigned long long rettime, calltime; |
280 | unsigned long long duration, depth; | 260 | unsigned long long duration, depth; |
281 | void *data = record->data; | ||
282 | int i; | 261 | int i; |
283 | 262 | ||
284 | if (get_field_val(s, data, event, "rettime", &rettime)) | 263 | if (pevent_get_field_val(s, event, "rettime", record, &rettime, 1)) |
285 | return trace_seq_putc(s, '!'); | 264 | return trace_seq_putc(s, '!'); |
286 | 265 | ||
287 | if (get_field_val(s, data, event, "calltime", &calltime)) | 266 | if (pevent_get_field_val(s, event, "calltime", record, &calltime, 1)) |
288 | return trace_seq_putc(s, '!'); | 267 | return trace_seq_putc(s, '!'); |
289 | 268 | ||
290 | duration = rettime - calltime; | 269 | duration = rettime - calltime; |
@@ -295,7 +274,7 @@ fgraph_ret_handler(struct trace_seq *s, struct record *record, | |||
295 | /* Duration */ | 274 | /* Duration */ |
296 | print_graph_duration(s, duration); | 275 | print_graph_duration(s, duration); |
297 | 276 | ||
298 | if (get_field_val(s, data, event, "depth", &depth)) | 277 | if (pevent_get_field_val(s, event, "depth", record, &depth, 1)) |
299 | return trace_seq_putc(s, '!'); | 278 | return trace_seq_putc(s, '!'); |
300 | 279 | ||
301 | /* Function */ | 280 | /* Function */ |