]>
Commit | Line | Data |
---|---|---|
bd6521f0 A |
1 | // |
2 | // EventPrinting.cpp | |
3 | // kdprof | |
4 | // | |
5 | // Created by James McIlree on 6/6/13. | |
6 | // Copyright (c) 2013 Apple. All rights reserved. | |
7 | // | |
8 | ||
9 | #include "global.h" | |
10 | ||
11 | void print_event_header(const Globals& globals, bool is_64_bit) { | |
12 | ||
13 | // Header is... | |
14 | // | |
15 | // [Index] Time Type Code arg1 arg2 arg3 arg4 thread cpu# command/IOP-name pid | |
16 | // 8 16 4 34 8/16 8/16 8/16 8/16 10 4 16 6 | |
17 | ||
18 | ||
19 | if (globals.should_print_event_index()) | |
20 | dprintf(globals.output_fd(), "%8s ", "Event#"); | |
21 | ||
22 | // The character counting for "Time(µS)" is OBO, it treats the µ as two characters. | |
23 | // This means the %16s misaligns. We force it by making the input string 16 printable chars long, | |
24 | // which overflows the %16s to the correct actual output length. | |
25 | const char* time = globals.should_print_mach_absolute_timestamps() ? "Time(mach-abs)" : " Time(µS)"; | |
26 | ||
27 | if (is_64_bit) | |
28 | dprintf(globals.output_fd(), "%16s %4s %-34s %-16s %-16s %-16s %-16s %10s %4s %-16s %-6s\n", time, "Type", "Code", "arg1", "arg2", "arg3", "arg4", "thread", "cpu#", "command", "pid"); | |
29 | else | |
30 | dprintf(globals.output_fd(), "%16s %4s %-34s %-8s %-8s %-8s %-8s %10s %4s %-16s %-6s\n", time, "Type", "Code", "arg1", "arg2", "arg3", "arg4", "thread", "cpu#", "command", "pid"); | |
31 | } |