diff options
Diffstat (limited to 'kernel/trace/trace_branch.c')
-rw-r--r-- | kernel/trace/trace_branch.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index 4a194f08f88c..8d3538b4ea5f 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c | |||
@@ -143,7 +143,7 @@ static void branch_trace_reset(struct trace_array *tr) | |||
143 | } | 143 | } |
144 | 144 | ||
145 | static enum print_line_t trace_branch_print(struct trace_iterator *iter, | 145 | static enum print_line_t trace_branch_print(struct trace_iterator *iter, |
146 | int flags) | 146 | int flags, struct trace_event *event) |
147 | { | 147 | { |
148 | struct trace_branch *field; | 148 | struct trace_branch *field; |
149 | 149 | ||
@@ -167,9 +167,13 @@ static void branch_print_header(struct seq_file *s) | |||
167 | " |\n"); | 167 | " |\n"); |
168 | } | 168 | } |
169 | 169 | ||
170 | static struct trace_event_functions trace_branch_funcs = { | ||
171 | .trace = trace_branch_print, | ||
172 | }; | ||
173 | |||
170 | static struct trace_event trace_branch_event = { | 174 | static struct trace_event trace_branch_event = { |
171 | .type = TRACE_BRANCH, | 175 | .type = TRACE_BRANCH, |
172 | .trace = trace_branch_print, | 176 | .funcs = &trace_branch_funcs, |
173 | }; | 177 | }; |
174 | 178 | ||
175 | static struct tracer branch_trace __read_mostly = | 179 | static struct tracer branch_trace __read_mostly = |
@@ -307,8 +311,23 @@ static int annotated_branch_stat_cmp(void *p1, void *p2) | |||
307 | return -1; | 311 | return -1; |
308 | if (percent_a > percent_b) | 312 | if (percent_a > percent_b) |
309 | return 1; | 313 | return 1; |
310 | else | 314 | |
311 | return 0; | 315 | if (a->incorrect < b->incorrect) |
316 | return -1; | ||
317 | if (a->incorrect > b->incorrect) | ||
318 | return 1; | ||
319 | |||
320 | /* | ||
321 | * Since the above shows worse (incorrect) cases | ||
322 | * first, we continue that by showing best (correct) | ||
323 | * cases last. | ||
324 | */ | ||
325 | if (a->correct > b->correct) | ||
326 | return -1; | ||
327 | if (a->correct < b->correct) | ||
328 | return 1; | ||
329 | |||
330 | return 0; | ||
312 | } | 331 | } |
313 | 332 | ||
314 | static struct tracer_stat annotated_branch_stats = { | 333 | static struct tracer_stat annotated_branch_stats = { |