Commit 6fc84ea7 authored by Steven Rostedt (Red Hat)'s avatar Steven Rostedt (Red Hat) Committed by Steven Rostedt

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: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 042b10d8
...@@ -712,6 +712,8 @@ extern unsigned long trace_flags; ...@@ -712,6 +712,8 @@ extern unsigned long trace_flags;
#define TRACE_GRAPH_PRINT_PROC 0x8 #define TRACE_GRAPH_PRINT_PROC 0x8
#define TRACE_GRAPH_PRINT_DURATION 0x10 #define TRACE_GRAPH_PRINT_DURATION 0x10
#define TRACE_GRAPH_PRINT_ABS_TIME 0x20 #define TRACE_GRAPH_PRINT_ABS_TIME 0x20
#define TRACE_GRAPH_PRINT_FILL_SHIFT 28
#define TRACE_GRAPH_PRINT_FILL_MASK (0x3 << TRACE_GRAPH_PRINT_FILL_SHIFT)
extern enum print_line_t extern enum print_line_t
print_graph_function_flags(struct trace_iterator *iter, u32 flags); print_graph_function_flags(struct trace_iterator *iter, u32 flags);
......
...@@ -82,9 +82,9 @@ static struct trace_array *graph_array; ...@@ -82,9 +82,9 @@ static struct trace_array *graph_array;
* to fill in space into DURATION column. * to fill in space into DURATION column.
*/ */
enum { enum {
DURATION_FILL_FULL = -1, FLAGS_FILL_FULL = 1 << TRACE_GRAPH_PRINT_FILL_SHIFT,
DURATION_FILL_START = -2, FLAGS_FILL_START = 2 << TRACE_GRAPH_PRINT_FILL_SHIFT,
DURATION_FILL_END = -3, FLAGS_FILL_END = 3 << TRACE_GRAPH_PRINT_FILL_SHIFT,
}; };
static enum print_line_t static enum print_line_t
...@@ -702,7 +702,7 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr, ...@@ -702,7 +702,7 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr,
} }
/* No overhead */ /* No overhead */
ret = print_graph_duration(DURATION_FILL_START, s, flags); ret = print_graph_duration(0, s, flags | FLAGS_FILL_START);
if (ret != TRACE_TYPE_HANDLED) if (ret != TRACE_TYPE_HANDLED)
return ret; return ret;
...@@ -714,7 +714,7 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr, ...@@ -714,7 +714,7 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr,
if (!ret) if (!ret)
return TRACE_TYPE_PARTIAL_LINE; return TRACE_TYPE_PARTIAL_LINE;
ret = print_graph_duration(DURATION_FILL_END, s, flags); ret = print_graph_duration(0, s, flags | FLAGS_FILL_END);
if (ret != TRACE_TYPE_HANDLED) if (ret != TRACE_TYPE_HANDLED)
return ret; return ret;
...@@ -779,14 +779,14 @@ print_graph_duration(unsigned long long duration, struct trace_seq *s, ...@@ -779,14 +779,14 @@ print_graph_duration(unsigned long long duration, struct trace_seq *s,
return TRACE_TYPE_HANDLED; return TRACE_TYPE_HANDLED;
/* No real adata, just filling the column with spaces */ /* No real adata, just filling the column with spaces */
switch (duration) { switch (flags & TRACE_GRAPH_PRINT_FILL_MASK) {
case DURATION_FILL_FULL: case FLAGS_FILL_FULL:
ret = trace_seq_puts(s, " | "); ret = trace_seq_puts(s, " | ");
return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE; return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
case DURATION_FILL_START: case FLAGS_FILL_START:
ret = trace_seq_puts(s, " "); ret = trace_seq_puts(s, " ");
return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE; return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
case DURATION_FILL_END: case FLAGS_FILL_END:
ret = trace_seq_puts(s, " |"); ret = trace_seq_puts(s, " |");
return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE; return ret ? TRACE_TYPE_HANDLED : TRACE_TYPE_PARTIAL_LINE;
} }
...@@ -902,7 +902,7 @@ print_graph_entry_nested(struct trace_iterator *iter, ...@@ -902,7 +902,7 @@ print_graph_entry_nested(struct trace_iterator *iter,
} }
/* No time */ /* No time */
ret = print_graph_duration(DURATION_FILL_FULL, s, flags); ret = print_graph_duration(0, s, flags | FLAGS_FILL_FULL);
if (ret != TRACE_TYPE_HANDLED) if (ret != TRACE_TYPE_HANDLED)
return ret; return ret;
...@@ -1222,7 +1222,7 @@ print_graph_comment(struct trace_seq *s, struct trace_entry *ent, ...@@ -1222,7 +1222,7 @@ print_graph_comment(struct trace_seq *s, struct trace_entry *ent,
return TRACE_TYPE_PARTIAL_LINE; return TRACE_TYPE_PARTIAL_LINE;
/* No time */ /* No time */
ret = print_graph_duration(DURATION_FILL_FULL, s, flags); ret = print_graph_duration(0, s, flags | FLAGS_FILL_FULL);
if (ret != TRACE_TYPE_HANDLED) if (ret != TRACE_TYPE_HANDLED)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment