~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to kernel/trace/trace_output.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
}
354
354
EXPORT_SYMBOL(ftrace_print_symbols_seq);
355
355
 
 
356
#if BITS_PER_LONG == 32
 
357
const char *
 
358
ftrace_print_symbols_seq_u64(struct trace_seq *p, unsigned long long val,
 
359
                         const struct trace_print_flags_u64 *symbol_array)
 
360
{
 
361
        int i;
 
362
        const char *ret = p->buffer + p->len;
 
363
 
 
364
        for (i = 0;  symbol_array[i].name; i++) {
 
365
 
 
366
                if (val != symbol_array[i].mask)
 
367
                        continue;
 
368
 
 
369
                trace_seq_puts(p, symbol_array[i].name);
 
370
                break;
 
371
        }
 
372
 
 
373
        if (!p->len)
 
374
                trace_seq_printf(p, "0x%llx", val);
 
375
 
 
376
        trace_seq_putc(p, 0);
 
377
 
 
378
        return ret;
 
379
}
 
380
EXPORT_SYMBOL(ftrace_print_symbols_seq_u64);
 
381
#endif
 
382
 
356
383
const char *
357
384
ftrace_print_hex_seq(struct trace_seq *p, const unsigned char *buf, int buf_len)
358
385
{
529
556
 * @entry: The trace entry field from the ring buffer
530
557
 *
531
558
 * Prints the generic fields of irqs off, in hard or softirq, preempt
532
 
 * count and lock depth.
 
559
 * count.
533
560
 */
534
561
int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
535
562
{
536
 
        int hardirq, softirq;
 
563
        char hardsoft_irq;
 
564
        char need_resched;
 
565
        char irqs_off;
 
566
        int hardirq;
 
567
        int softirq;
537
568
        int ret;
538
569
 
539
570
        hardirq = entry->flags & TRACE_FLAG_HARDIRQ;
540
571
        softirq = entry->flags & TRACE_FLAG_SOFTIRQ;
541
572
 
 
573
        irqs_off =
 
574
                (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' :
 
575
                (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ? 'X' :
 
576
                '.';
 
577
        need_resched =
 
578
                (entry->flags & TRACE_FLAG_NEED_RESCHED) ? 'N' : '.';
 
579
        hardsoft_irq =
 
580
                (hardirq && softirq) ? 'H' :
 
581
                hardirq ? 'h' :
 
582
                softirq ? 's' :
 
583
                '.';
 
584
 
542
585
        if (!trace_seq_printf(s, "%c%c%c",
543
 
                              (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' :
544
 
                                (entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ?
545
 
                                  'X' : '.',
546
 
                              (entry->flags & TRACE_FLAG_NEED_RESCHED) ?
547
 
                                'N' : '.',
548
 
                              (hardirq && softirq) ? 'H' :
549
 
                                hardirq ? 'h' : softirq ? 's' : '.'))
 
586
                              irqs_off, need_resched, hardsoft_irq))
550
587
                return 0;
551
588
 
552
589
        if (entry->preempt_count)
554
591
        else
555
592
                ret = trace_seq_putc(s, '.');
556
593
 
557
 
        if (!ret)
558
 
                return 0;
559
 
 
560
 
        if (entry->lock_depth < 0)
561
 
                return trace_seq_putc(s, '.');
562
 
 
563
 
        return trace_seq_printf(s, "%d", entry->lock_depth);
 
594
        return ret;
564
595
}
565
596
 
566
597
static int
826
857
enum print_line_t trace_nop_print(struct trace_iterator *iter, int flags,
827
858
                                  struct trace_event *event)
828
859
{
 
860
        if (!trace_seq_printf(&iter->seq, "type: %d\n", iter->ent->type))
 
861
                return TRACE_TYPE_PARTIAL_LINE;
 
862
 
829
863
        return TRACE_TYPE_HANDLED;
830
864
}
831
865