]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - kernel/trace/trace_functions_graph.c
Merge tag 'acpi-5.1-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[linux.git] / kernel / trace / trace_functions_graph.c
index c2af1560e8566d41b211d9200e05972d6af86e0b..69ebf3c2f1b5dd2e369232068f9074e0c48b4b48 100644 (file)
@@ -380,6 +380,7 @@ static void print_graph_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
 {
        trace_seq_putc(s, ' ');
        trace_print_lat_fmt(s, entry);
+       trace_seq_puts(s, " | ");
 }
 
 /* If the pid changed since the last trace, output this event */
@@ -500,6 +501,17 @@ static void print_graph_abs_time(u64 t, struct trace_seq *s)
                         (unsigned long)t, usecs_rem);
 }
 
+static void
+print_graph_rel_time(struct trace_iterator *iter, struct trace_seq *s)
+{
+       unsigned long long usecs;
+
+       usecs = iter->ts - iter->trace_buffer->time_start;
+       do_div(usecs, NSEC_PER_USEC);
+
+       trace_seq_printf(s, "%9llu us |  ", usecs);
+}
+
 static void
 print_graph_irq(struct trace_iterator *iter, unsigned long addr,
                enum trace_type type, int cpu, pid_t pid, u32 flags)
@@ -517,6 +529,10 @@ print_graph_irq(struct trace_iterator *iter, unsigned long addr,
                if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
                        print_graph_abs_time(iter->ts, s);
 
+               /* Relative time */
+               if (flags & TRACE_GRAPH_PRINT_REL_TIME)
+                       print_graph_rel_time(iter, s);
+
                /* Cpu */
                if (flags & TRACE_GRAPH_PRINT_CPU)
                        print_graph_cpu(s, cpu);
@@ -725,6 +741,10 @@ print_graph_prologue(struct trace_iterator *iter, struct trace_seq *s,
        if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
                print_graph_abs_time(iter->ts, s);
 
+       /* Relative time */
+       if (flags & TRACE_GRAPH_PRINT_REL_TIME)
+               print_graph_rel_time(iter, s);
+
        /* Cpu */
        if (flags & TRACE_GRAPH_PRINT_CPU)
                print_graph_cpu(s, cpu);
@@ -1101,6 +1121,8 @@ static void print_lat_header(struct seq_file *s, u32 flags)
 
        if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
                size += 16;
+       if (flags & TRACE_GRAPH_PRINT_REL_TIME)
+               size += 16;
        if (flags & TRACE_GRAPH_PRINT_CPU)
                size += 4;
        if (flags & TRACE_GRAPH_PRINT_PROC)
@@ -1125,12 +1147,14 @@ static void __print_graph_headers_flags(struct trace_array *tr,
        seq_putc(s, '#');
        if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
                seq_puts(s, "     TIME       ");
+       if (flags & TRACE_GRAPH_PRINT_REL_TIME)
+               seq_puts(s, "   REL TIME     ");
        if (flags & TRACE_GRAPH_PRINT_CPU)
                seq_puts(s, " CPU");
        if (flags & TRACE_GRAPH_PRINT_PROC)
                seq_puts(s, "  TASK/PID       ");
        if (lat)
-               seq_puts(s, "||||");
+               seq_puts(s, "||||   ");
        if (flags & TRACE_GRAPH_PRINT_DURATION)
                seq_puts(s, "  DURATION   ");
        seq_puts(s, "               FUNCTION CALLS\n");
@@ -1139,12 +1163,14 @@ static void __print_graph_headers_flags(struct trace_array *tr,
        seq_putc(s, '#');
        if (flags & TRACE_GRAPH_PRINT_ABS_TIME)
                seq_puts(s, "      |         ");
+       if (flags & TRACE_GRAPH_PRINT_REL_TIME)
+               seq_puts(s, "      |         ");
        if (flags & TRACE_GRAPH_PRINT_CPU)
                seq_puts(s, " |  ");
        if (flags & TRACE_GRAPH_PRINT_PROC)
                seq_puts(s, "   |    |        ");
        if (lat)
-               seq_puts(s, "||||");
+               seq_puts(s, "||||   ");
        if (flags & TRACE_GRAPH_PRINT_DURATION)
                seq_puts(s, "   |   |      ");
        seq_puts(s, "               |   |   |   |\n");