diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 7b516c7ef9a0..8b9ba41ec146 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -1808,7 +1808,7 @@ static void print_func_help_header(struct seq_file *m) | |||
1808 | } | 1808 | } |
1809 | 1809 | ||
1810 | 1810 | ||
1811 | static void | 1811 | void |
1812 | print_trace_header(struct seq_file *m, struct trace_iterator *iter) | 1812 | print_trace_header(struct seq_file *m, struct trace_iterator *iter) |
1813 | { | 1813 | { |
1814 | unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK); | 1814 | unsigned long sym_flags = (trace_flags & TRACE_ITER_SYM_MASK); |
@@ -2017,7 +2017,7 @@ static enum print_line_t print_bin_fmt(struct trace_iterator *iter) | |||
2017 | return event ? event->binary(iter, 0) : TRACE_TYPE_HANDLED; | 2017 | return event ? event->binary(iter, 0) : TRACE_TYPE_HANDLED; |
2018 | } | 2018 | } |
2019 | 2019 | ||
2020 | static int trace_empty(struct trace_iterator *iter) | 2020 | int trace_empty(struct trace_iterator *iter) |
2021 | { | 2021 | { |
2022 | int cpu; | 2022 | int cpu; |
2023 | 2023 | ||
@@ -2084,6 +2084,23 @@ static enum print_line_t print_trace_line(struct trace_iterator *iter) | |||
2084 | return print_trace_fmt(iter); | 2084 | return print_trace_fmt(iter); |
2085 | } | 2085 | } |
2086 | 2086 | ||
2087 | void trace_default_header(struct seq_file *m) | ||
2088 | { | ||
2089 | struct trace_iterator *iter = m->private; | ||
2090 | |||
2091 | if (iter->iter_flags & TRACE_FILE_LAT_FMT) { | ||
2092 | /* print nothing if the buffers are empty */ | ||
2093 | if (trace_empty(iter)) | ||
2094 | return; | ||
2095 | print_trace_header(m, iter); | ||
2096 | if (!(trace_flags & TRACE_ITER_VERBOSE)) | ||
2097 | print_lat_help_header(m); | ||
2098 | } else { | ||
2099 | if (!(trace_flags & TRACE_ITER_VERBOSE)) | ||
2100 | print_func_help_header(m); | ||
2101 | } | ||
2102 | } | ||
2103 | |||
2087 | static int s_show(struct seq_file *m, void *v) | 2104 | static int s_show(struct seq_file *m, void *v) |
2088 | { | 2105 | { |
2089 | struct trace_iterator *iter = v; | 2106 | struct trace_iterator *iter = v; |
@@ -2096,17 +2113,9 @@ static int s_show(struct seq_file *m, void *v) | |||
2096 | } | 2113 | } |
2097 | if (iter->trace && iter->trace->print_header) | 2114 | if (iter->trace && iter->trace->print_header) |
2098 | iter->trace->print_header(m); | 2115 | iter->trace->print_header(m); |
2099 | else if (iter->iter_flags & TRACE_FILE_LAT_FMT) { | 2116 | else |
2100 | /* print nothing if the buffers are empty */ | 2117 | trace_default_header(m); |
2101 | if (trace_empty(iter)) | 2118 | |
2102 | return 0; | ||
2103 | print_trace_header(m, iter); | ||
2104 | if (!(trace_flags & TRACE_ITER_VERBOSE)) | ||
2105 | print_lat_help_header(m); | ||
2106 | } else { | ||
2107 | if (!(trace_flags & TRACE_ITER_VERBOSE)) | ||
2108 | print_func_help_header(m); | ||
2109 | } | ||
2110 | } else if (iter->leftover) { | 2119 | } else if (iter->leftover) { |
2111 | /* | 2120 | /* |
2112 | * If we filled the seq_file buffer earlier, we | 2121 | * If we filled the seq_file buffer earlier, we |