builtin-timechart.c (753c505dc49a87a4421d452bda048e4b93e8e42b) | builtin-timechart.c (c87097d39dae1c42a5068e00dd3b76a4162ee0fc) |
---|---|
1/* 2 * builtin-timechart.c - make an svg timechart of system activity 3 * 4 * (C) Copyright 2009 Intel Corporation 5 * 6 * Authors: 7 * Arjan van de Ven <arjan@linux.intel.com> 8 * --- 37 unchanged lines hidden (view full) --- 46static unsigned int numcpus; 47static u64 min_freq; /* Lowest CPU frequency seen */ 48static u64 max_freq; /* Highest CPU frequency seen */ 49static u64 turbo_frequency; 50 51static u64 first_time, last_time; 52 53static bool power_only; | 1/* 2 * builtin-timechart.c - make an svg timechart of system activity 3 * 4 * (C) Copyright 2009 Intel Corporation 5 * 6 * Authors: 7 * Arjan van de Ven <arjan@linux.intel.com> 8 * --- 37 unchanged lines hidden (view full) --- 46static unsigned int numcpus; 47static u64 min_freq; /* Lowest CPU frequency seen */ 48static u64 max_freq; /* Highest CPU frequency seen */ 49static u64 turbo_frequency; 50 51static u64 first_time, last_time; 52 53static bool power_only; |
54static bool tasks_only; |
|
54 55 56struct per_pid; 57struct per_pidcomm; 58 59struct cpu_sample; 60struct power_event; 61struct wake_event; --- 904 unchanged lines hidden (view full) --- 966 svg_legenda(); 967 968 for (i = 0; i < numcpus; i++) 969 svg_cpu_box(i, max_freq, turbo_frequency); 970 971 draw_cpu_usage(); 972 if (proc_num) 973 draw_process_bars(); | 55 56 57struct per_pid; 58struct per_pidcomm; 59 60struct cpu_sample; 61struct power_event; 62struct wake_event; --- 904 unchanged lines hidden (view full) --- 967 svg_legenda(); 968 969 for (i = 0; i < numcpus; i++) 970 svg_cpu_box(i, max_freq, turbo_frequency); 971 972 draw_cpu_usage(); 973 if (proc_num) 974 draw_process_bars(); |
974 draw_c_p_states(); | 975 if (!tasks_only) 976 draw_c_p_states(); |
975 if (proc_num) 976 draw_wakeups(); 977 978 svg_close(); 979} 980 981static int __cmd_timechart(const char *output_name) 982{ --- 114 unchanged lines hidden (view full) --- 1097 const char *prefix __maybe_unused) 1098{ 1099 const char *output_name = "output.svg"; 1100 const struct option options[] = { 1101 OPT_STRING('i', "input", &input_name, "file", "input file name"), 1102 OPT_STRING('o', "output", &output_name, "file", "output file name"), 1103 OPT_INTEGER('w', "width", &svg_page_width, "page width"), 1104 OPT_BOOLEAN('P', "power-only", &power_only, "output power data only"), | 977 if (proc_num) 978 draw_wakeups(); 979 980 svg_close(); 981} 982 983static int __cmd_timechart(const char *output_name) 984{ --- 114 unchanged lines hidden (view full) --- 1099 const char *prefix __maybe_unused) 1100{ 1101 const char *output_name = "output.svg"; 1102 const struct option options[] = { 1103 OPT_STRING('i', "input", &input_name, "file", "input file name"), 1104 OPT_STRING('o', "output", &output_name, "file", "output file name"), 1105 OPT_INTEGER('w', "width", &svg_page_width, "page width"), 1106 OPT_BOOLEAN('P', "power-only", &power_only, "output power data only"), |
1107 OPT_BOOLEAN('T', "tasks-only", &tasks_only, 1108 "output processes data only"), |
|
1105 OPT_CALLBACK('p', "process", NULL, "process", 1106 "process selector. Pass a pid or process name.", 1107 parse_process), 1108 OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", 1109 "Look for files with symbols relative to this directory"), 1110 OPT_INTEGER('n', "proc-num", &proc_num, 1111 "min. number of tasks to print"), 1112 OPT_END() 1113 }; 1114 const char * const timechart_usage[] = { 1115 "perf timechart [<options>] {record}", 1116 NULL 1117 }; 1118 1119 argc = parse_options(argc, argv, options, timechart_usage, 1120 PARSE_OPT_STOP_AT_NON_OPTION); 1121 | 1109 OPT_CALLBACK('p', "process", NULL, "process", 1110 "process selector. Pass a pid or process name.", 1111 parse_process), 1112 OPT_STRING(0, "symfs", &symbol_conf.symfs, "directory", 1113 "Look for files with symbols relative to this directory"), 1114 OPT_INTEGER('n', "proc-num", &proc_num, 1115 "min. number of tasks to print"), 1116 OPT_END() 1117 }; 1118 const char * const timechart_usage[] = { 1119 "perf timechart [<options>] {record}", 1120 NULL 1121 }; 1122 1123 argc = parse_options(argc, argv, options, timechart_usage, 1124 PARSE_OPT_STOP_AT_NON_OPTION); 1125 |
1126 if (power_only && tasks_only) { 1127 pr_err("-P and -T options cannot be used at the same time.\n"); 1128 return -1; 1129 } 1130 |
|
1122 symbol__init(); 1123 1124 if (argc && !strncmp(argv[0], "rec", 3)) 1125 return __cmd_record(argc, argv); 1126 else if (argc) 1127 usage_with_options(timechart_usage, options); 1128 1129 setup_pager(); 1130 1131 return __cmd_timechart(output_name); 1132} | 1131 symbol__init(); 1132 1133 if (argc && !strncmp(argv[0], "rec", 3)) 1134 return __cmd_record(argc, argv); 1135 else if (argc) 1136 usage_with_options(timechart_usage, options); 1137 1138 setup_pager(); 1139 1140 return __cmd_timechart(output_name); 1141} |