aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2013-11-06 14:50:06 -0500
committerSteven Rostedt <rostedt@goodmis.org>2013-11-06 15:26:56 -0500
commit6fc84ea70eae478099c866ace022ecfdef998032 (patch)
tree705f3bffb3513b96de7c9563371676451318700e /kernel
parent042b10d83d05174e50ee861ee3aca55fd6204324 (diff)
tracing: Do not use signed enums with unsigned long long in fgragh output
The duration field of print_graph_duration() can also be used to do the space filling by passing an enum in it: DURATION_FILL_FULL DURATION_FILL_START DURATION_FILL_END The problem is that these are enums and defined as negative, but the duration field is unsigned long long. Most archs are fine with this but blackfin fails to compile because of it: kernel/built-in.o: In function `print_graph_duration': kernel/trace/trace_functions_graph.c:782: undefined reference to `__ucmpdi2' Overloading a unsigned long long with an signed enum is just bad in principle. We can accomplish the same thing by using part of the flags field instead. Cc: Mike Frysinger <vapier@gentoo.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.h2
-rw-r--r--kernel/trace/trace_functions_graph.c22
2 files changed, 13 insertions, 11 deletions
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 4388e16484f1..11a04d6eaa23 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -712,6 +712,8 @@ extern unsigned long trace_flags;
712#define TRACE_GRAPH_PRINT_PROC 0x8 712#define TRACE_GRAPH_PRINT_PROC 0x8
713#define TRACE_GRAPH_PRINT_DURATION 0x10 713#define TRACE_GRAPH_PRINT_DURATION 0x10
714#define TRACE_GRAPH_PRINT_ABS_TIME 0x20 714#define TRACE_GRAPH_PRINT_ABS_TIME 0x20
715#define TRACE_GRAPH_PRINT_FILL_SHIFT 28
716#define TRACE_GRAPH_PRINT_FILL_MASK (0x3 << TRACE_GRAPH_PRINT_FILL_SHIFT)
715 717
716extern enum print_line_t 718extern enum print_line_t
717print_graph_function_flags(struct trace_iterator *iter, u32 flags); 719print_graph_function_flags(struct trace_iterator *iter, u32 flags);
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 80387d1d27e1..0b99120d395c 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -82,9 +82,9 @@ static struct trace_array *graph_array;
82 * to fill in space into DURATION column. 82 * to fill in space into DURATION column.
83 */ 83 */
84enum { 84enum {
85 DURATION_FILL_FULL = -1, 85 FLAGS_FILL_FULL = 1 << TRACE_GRAPH_PRINT_FILL_SHIFT,
86 DURATION_FILL_START = -2, 86 FLAGS_FILL_START = 2 << TRACE_GRAPH_PRINT_FILL_SHIFT,
87 DURATION_FILL_END = -3, 87 FLAGS_FILL_END = 3 << TRACE_GRAPH_PRINT_FILL_SHIFT,
88}; 88};
89 89
90static enum print_line_t 90static enum print_line_t
@@ -702,7 +702,7 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr,
702 } 702 }
703 703
704 /* No overhead */ 704 /* No overhead */
705 ret = print_graph_duration(DURATION_FILL_START, s, flags); 705 ret = print_graph_duration(0, s, flags | FLAGS_FILL_START);
706 if (ret != TRACE_TYPE_HANDLED) 706 if (ret != TRACE_TYPE_HANDLED)
707 return ret; 707 return ret;
708 708
@@ -714,7 +714,7 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr,
714 if (!ret) 714 if (!ret)
715 return TRACE_TYPE_PARTIAL_LINE; 715 return TRACE_TYPE_PARTIAL_LINE;
716 716
717 ret = print_graph_duration(DURATION_FILL_END, s, flags); 717 ret = print_graph_duration(0, s, flags | FLAGS_FILL_END);
718 if (ret != TRACE_TYPE_HANDLED) 718 if (ret != TRACE_TYPE_HANDLED)
719 return ret; 719 return ret;
720 720
@@ -779,14 +779,14 @@ print_graph_duration(unsigned long long duration, struct trace_seq *s,
779 return TRACE_TYPE_HANDLED; 779 return TRACE_TYPE_HANDLED;
780 780
781 /* No real adata, just filling the column with spaces */ 781 /* No real adata, just filling the column with spaces */
782 switch (duration) { 782 switch (flags & TRACE_GRAPH_PRINT_FILL_MASK) {
783 case DURATION_FILL_FULL: 783 case FLAGS_FILL_FULL:
784 ret = trace_seq_puts(s, " | "); 784 ret = trace_seq_puts(s, " | ");
785 return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE; 785 return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
786 case DURATION_FILL_START: 786 case FLAGS_FILL_START:
787 ret = trace_seq_puts(s, " "); 787 ret = trace_seq_puts(s, " ");
788 return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE; 788 return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
789 case DURATION_FILL_END: 789 case FLAGS_FILL_END:
790 ret = trace_seq_puts(s, " |"); 790 ret = trace_seq_puts(s, " |");
791 return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE; 791 return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
792 } 792 }
@@ -902,7 +902,7 @@ print_graph_entry_nested(struct trace_iterator *iter,
902 } 902 }
903 903
904 /* No time */ 904 /* No time */
905 ret = print_graph_duration(DURATION_FILL_FULL, s, flags); 905 ret = print_graph_duration(0, s, flags | FLAGS_FILL_FULL);
906 if (ret != TRACE_TYPE_HANDLED) 906 if (ret != TRACE_TYPE_HANDLED)
907 return ret; 907 return ret;
908 908
@@ -1222,7 +1222,7 @@ print_graph_comment(struct trace_seq *s, struct trace_entry *ent,
1222 return TRACE_TYPE_PARTIAL_LINE; 1222 return TRACE_TYPE_PARTIAL_LINE;
1223 1223
1224 /* No time */ 1224 /* No time */
1225 ret = print_graph_duration(DURATION_FILL_FULL, s, flags); 1225 ret = print_graph_duration(0, s, flags | FLAGS_FILL_FULL);
1226 if (ret != TRACE_TYPE_HANDLED) 1226 if (ret != TRACE_TYPE_HANDLED)
1227 return ret; 1227 return ret;
1228 1228