]> git.saurik.com Git - apple/system_cmds.git/blob - kdprof/SummaryPrinting.cpp
system_cmds-643.30.1.tar.gz
[apple/system_cmds.git] / kdprof / SummaryPrinting.cpp
1 //
2 // SummaryPrinting.cpp
3 // kdprof
4 //
5 // Created by James McIlree on 4/19/13.
6 // Copyright (c) 2013 Apple. All rights reserved.
7 //
8
9 #include "global.h"
10
11 constexpr const char* const SummaryLineData::indent_string[];
12
13 void print_summary_header(const Globals& globals) {
14 // Header is...
15 // Avg Actual Wanted Actual Wanted Jetsam
16 // All CPU Thr Avg Actual Wanted Concurrency Processes To Run Threads To Run VMFault VMFault IO Wait # IO IO Bytes Jetsam Proc
17 // [Time(mS)] Name Run% Idle% Intr% Idle% #Intr #CSW On CPU/µS CPU/mS CPU/mS (# CPU) Ran Processes Ran Threads Count Time (mS) Time (mS) Ops Completed Time (mS) Count
18 // 123456789abcdef0 123456789012345678901234567890 1234567 1234567 1234567 1234567 1234567 12345678 123456789 123456789abc 123456789abc 123456789ab 123456789 123456789 1234567 1234567 1234567 123456789abc 123456789abc 1234567 1234567890 123456789 123456
19 // 1119100000.00 76.58 16.53 6.89 0.00 230 112 10000.00 100000.00 100000.00 1.55 2 3 12 13 2280 230.48 1998.22 3318 123.40 MB 0.00
20
21 const char* time1 = "";
22 const char* time2 = "";
23 const char* time3 = "";
24 char time_buffer1[32];
25 char time_buffer2[32];
26 char time_buffer3[32];
27
28 // If we're printing the entire data set, don't print a timestamp.
29 if (globals.is_summary_start_set() || globals.is_summary_stop_set() || globals.is_summary_step_set()) {
30 sprintf(time_buffer1, "%16s ", "");
31 sprintf(time_buffer2, "%16s ", "");
32 sprintf(time_buffer3, "%-16s ", globals.should_print_mach_absolute_timestamps() ? "Time(mach-abs)" : "Time(mS)");
33
34 time1 = time_buffer1;
35 time2 = time_buffer2;
36 time3 = time_buffer3;
37 }
38
39 dprintf(globals.output_fd(), "%s%-30s %7s %7s %7s %7s %7s %8s %9s %12s %12s %11s %9s %9s %7s %7s %7s %12s %12s %7s %10s %9s %6s\n", time1, "", "", "", "", "", "", "", "", "", "", "Avg", "Actual", "Wanted", "Actual", "Wanted", "", "", "", "", "", "", "Jetsam");
40 dprintf(globals.output_fd(), "%s%-30s %7s %7s %7s %7s %7s %8s %9s %12s %12s %11s %9s %9s %7s %7s %7s %12s %12s %7s %10s %9s %6s\n", time2, "", "", "", "", "All-CPU", "", "", "Thr Avg", "Actual", "Wanted", "Concurrency", "Processes", "To Run", "Threads", "To Run", "VMFault", "VMFault", "IO Wait", "# IO", "IO Bytes", "Jetsam", "Proc");
41 dprintf(globals.output_fd(), "%s%-30s %7s %7s %7s %7s %7s %8s %9s %12s %12s %11s %9s %9s %7s %7s %7s %12s %12s %7s %10s %9s %6s\n", time3, "Name", "Run%", "Idle%", "Intr%", "Idle%", "#Intr", "#CSW", "On CPU/µS", "CPU/mS", "CPU/mS", "(# CPU)", "Ran", "Processes", "Ran", "Threads", "Count", "Time (mS)", "Time (mS)", "Ops", "Completed", "Time (mS)", "Count");
42 }