turbostat.c (2085e12441dc90a126a5f279b3ef03daade901cf) | turbostat.c (3f44a5c62be2f2b15317942fa7bc4a810d2420aa) |
---|---|
1/* 2 * turbostat -- show CPU frequency and C-state residency 3 * on modern Intel turbo-capable processors. 4 * 5 * Copyright (c) 2013 Intel Corporation. 6 * Len Brown <len.brown@intel.com> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 36 unchanged lines hidden (view full) --- 45#include <errno.h> 46 47char *proc_stat = "/proc/stat"; 48FILE *outf; 49int *fd_percpu; 50struct timespec interval_ts = {5, 0}; 51unsigned int debug; 52unsigned int quiet; | 1/* 2 * turbostat -- show CPU frequency and C-state residency 3 * on modern Intel turbo-capable processors. 4 * 5 * Copyright (c) 2013 Intel Corporation. 6 * Len Brown <len.brown@intel.com> 7 * 8 * This program is free software; you can redistribute it and/or modify it --- 36 unchanged lines hidden (view full) --- 45#include <errno.h> 46 47char *proc_stat = "/proc/stat"; 48FILE *outf; 49int *fd_percpu; 50struct timespec interval_ts = {5, 0}; 51unsigned int debug; 52unsigned int quiet; |
53unsigned int shown; |
|
53unsigned int sums_need_wide_columns; 54unsigned int rapl_joules; 55unsigned int summary_only; 56unsigned int list_header_only; 57unsigned int dump_only; 58unsigned int do_snb_cstates; 59unsigned int do_knl_cstates; 60unsigned int do_slm_cstates; --- 280 unchanged lines hidden (view full) --- 341 return 0; 342} 343 344/* 345 * Each string in this array is compared in --show and --hide cmdline. 346 * Thus, strings that are proper sub-sets must follow their more specific peers. 347 */ 348struct msr_counter bic[] = { | 54unsigned int sums_need_wide_columns; 55unsigned int rapl_joules; 56unsigned int summary_only; 57unsigned int list_header_only; 58unsigned int dump_only; 59unsigned int do_snb_cstates; 60unsigned int do_knl_cstates; 61unsigned int do_slm_cstates; --- 280 unchanged lines hidden (view full) --- 342 return 0; 343} 344 345/* 346 * Each string in this array is compared in --show and --hide cmdline. 347 * Thus, strings that are proper sub-sets must follow their more specific peers. 348 */ 349struct msr_counter bic[] = { |
350 { 0x0, "usec" }, 351 { 0x0, "Time_Of_Day_Seconds" }, |
|
349 { 0x0, "Package" }, 350 { 0x0, "Avg_MHz" }, 351 { 0x0, "Bzy_MHz" }, 352 { 0x0, "TSC_MHz" }, 353 { 0x0, "IRQ" }, 354 { 0x0, "SMI", "", 32, 0, FORMAT_DELTA, NULL}, 355 { 0x0, "Busy%" }, 356 { 0x0, "CPU%c1" }, --- 32 unchanged lines hidden (view full) --- 389 { 0x0, "Any%C0" }, 390 { 0x0, "GFX%C0" }, 391 { 0x0, "CPUGFX%" }, 392}; 393 394 395 396#define MAX_BIC (sizeof(bic) / sizeof(struct msr_counter)) | 352 { 0x0, "Package" }, 353 { 0x0, "Avg_MHz" }, 354 { 0x0, "Bzy_MHz" }, 355 { 0x0, "TSC_MHz" }, 356 { 0x0, "IRQ" }, 357 { 0x0, "SMI", "", 32, 0, FORMAT_DELTA, NULL}, 358 { 0x0, "Busy%" }, 359 { 0x0, "CPU%c1" }, --- 32 unchanged lines hidden (view full) --- 392 { 0x0, "Any%C0" }, 393 { 0x0, "GFX%C0" }, 394 { 0x0, "CPUGFX%" }, 395}; 396 397 398 399#define MAX_BIC (sizeof(bic) / sizeof(struct msr_counter)) |
397#define BIC_Package (1ULL << 0) 398#define BIC_Avg_MHz (1ULL << 1) 399#define BIC_Bzy_MHz (1ULL << 2) 400#define BIC_TSC_MHz (1ULL << 3) 401#define BIC_IRQ (1ULL << 4) 402#define BIC_SMI (1ULL << 5) 403#define BIC_Busy (1ULL << 6) 404#define BIC_CPU_c1 (1ULL << 7) 405#define BIC_CPU_c3 (1ULL << 8) 406#define BIC_CPU_c6 (1ULL << 9) 407#define BIC_CPU_c7 (1ULL << 10) 408#define BIC_ThreadC (1ULL << 11) 409#define BIC_CoreTmp (1ULL << 12) 410#define BIC_CoreCnt (1ULL << 13) 411#define BIC_PkgTmp (1ULL << 14) 412#define BIC_GFX_rc6 (1ULL << 15) 413#define BIC_GFXMHz (1ULL << 16) 414#define BIC_Pkgpc2 (1ULL << 17) 415#define BIC_Pkgpc3 (1ULL << 18) 416#define BIC_Pkgpc6 (1ULL << 19) 417#define BIC_Pkgpc7 (1ULL << 20) 418#define BIC_Pkgpc8 (1ULL << 21) 419#define BIC_Pkgpc9 (1ULL << 22) 420#define BIC_Pkgpc10 (1ULL << 23) 421#define BIC_PkgWatt (1ULL << 24) 422#define BIC_CorWatt (1ULL << 25) 423#define BIC_GFXWatt (1ULL << 26) 424#define BIC_PkgCnt (1ULL << 27) 425#define BIC_RAMWatt (1ULL << 28) 426#define BIC_PKG__ (1ULL << 29) 427#define BIC_RAM__ (1ULL << 30) 428#define BIC_Pkg_J (1ULL << 31) 429#define BIC_Cor_J (1ULL << 32) 430#define BIC_GFX_J (1ULL << 33) 431#define BIC_RAM_J (1ULL << 34) 432#define BIC_Core (1ULL << 35) 433#define BIC_CPU (1ULL << 36) 434#define BIC_Mod_c6 (1ULL << 37) 435#define BIC_sysfs (1ULL << 38) 436#define BIC_Totl_c0 (1ULL << 39) 437#define BIC_Any_c0 (1ULL << 40) 438#define BIC_GFX_c0 (1ULL << 41) 439#define BIC_CPUGFX (1ULL << 42) | 400#define BIC_USEC (1ULL << 0) 401#define BIC_TOD (1ULL << 1) 402#define BIC_Package (1ULL << 2) 403#define BIC_Avg_MHz (1ULL << 3) 404#define BIC_Bzy_MHz (1ULL << 4) 405#define BIC_TSC_MHz (1ULL << 5) 406#define BIC_IRQ (1ULL << 6) 407#define BIC_SMI (1ULL << 7) 408#define BIC_Busy (1ULL << 8) 409#define BIC_CPU_c1 (1ULL << 9) 410#define BIC_CPU_c3 (1ULL << 10) 411#define BIC_CPU_c6 (1ULL << 11) 412#define BIC_CPU_c7 (1ULL << 12) 413#define BIC_ThreadC (1ULL << 13) 414#define BIC_CoreTmp (1ULL << 14) 415#define BIC_CoreCnt (1ULL << 15) 416#define BIC_PkgTmp (1ULL << 16) 417#define BIC_GFX_rc6 (1ULL << 17) 418#define BIC_GFXMHz (1ULL << 18) 419#define BIC_Pkgpc2 (1ULL << 19) 420#define BIC_Pkgpc3 (1ULL << 20) 421#define BIC_Pkgpc6 (1ULL << 21) 422#define BIC_Pkgpc7 (1ULL << 22) 423#define BIC_Pkgpc8 (1ULL << 23) 424#define BIC_Pkgpc9 (1ULL << 24) 425#define BIC_Pkgpc10 (1ULL << 25) 426#define BIC_PkgWatt (1ULL << 26) 427#define BIC_CorWatt (1ULL << 27) 428#define BIC_GFXWatt (1ULL << 28) 429#define BIC_PkgCnt (1ULL << 29) 430#define BIC_RAMWatt (1ULL << 30) 431#define BIC_PKG__ (1ULL << 31) 432#define BIC_RAM__ (1ULL << 32) 433#define BIC_Pkg_J (1ULL << 33) 434#define BIC_Cor_J (1ULL << 34) 435#define BIC_GFX_J (1ULL << 35) 436#define BIC_RAM_J (1ULL << 36) 437#define BIC_Core (1ULL << 37) 438#define BIC_CPU (1ULL << 38) 439#define BIC_Mod_c6 (1ULL << 39) 440#define BIC_sysfs (1ULL << 40) 441#define BIC_Totl_c0 (1ULL << 41) 442#define BIC_Any_c0 (1ULL << 42) 443#define BIC_GFX_c0 (1ULL << 43) 444#define BIC_CPUGFX (1ULL << 44) |
440 | 445 |
441unsigned long long bic_enabled = 0xFFFFFFFFFFFFFFFFULL; 442unsigned long long bic_present = BIC_sysfs; | 446#define BIC_DISABLED_BY_DEFAULT (BIC_USEC | BIC_TOD) |
443 | 447 |
448unsigned long long bic_enabled = (0xFFFFFFFFFFFFFFFFULL & ~BIC_DISABLED_BY_DEFAULT); 449unsigned long long bic_present = BIC_USEC | BIC_TOD | BIC_sysfs; 450 |
|
444#define DO_BIC(COUNTER_NAME) (bic_enabled & bic_present & COUNTER_NAME) | 451#define DO_BIC(COUNTER_NAME) (bic_enabled & bic_present & COUNTER_NAME) |
452#define ENABLE_BIC(COUNTER_NAME) (bic_enabled |= COUNTER_NAME) |
|
445#define BIC_PRESENT(COUNTER_BIT) (bic_present |= COUNTER_BIT) 446#define BIC_NOT_PRESENT(COUNTER_BIT) (bic_present &= ~COUNTER_BIT) 447 | 453#define BIC_PRESENT(COUNTER_BIT) (bic_present |= COUNTER_BIT) 454#define BIC_NOT_PRESENT(COUNTER_BIT) (bic_present &= ~COUNTER_BIT) 455 |
456 |
|
448#define MAX_DEFERRED 16 449char *deferred_skip_names[MAX_DEFERRED]; 450int deferred_skip_index; 451 452/* 453 * HIDE_LIST - hide this list of counters, show the rest [default] 454 * SHOW_LIST - show this list of counters, hide the rest 455 */ --- 35 unchanged lines hidden (view full) --- 491 while (name_list) { 492 char *comma; 493 494 comma = strchr(name_list, ','); 495 496 if (comma) 497 *comma = '\0'; 498 | 457#define MAX_DEFERRED 16 458char *deferred_skip_names[MAX_DEFERRED]; 459int deferred_skip_index; 460 461/* 462 * HIDE_LIST - hide this list of counters, show the rest [default] 463 * SHOW_LIST - show this list of counters, hide the rest 464 */ --- 35 unchanged lines hidden (view full) --- 500 while (name_list) { 501 char *comma; 502 503 comma = strchr(name_list, ','); 504 505 if (comma) 506 *comma = '\0'; 507 |
508 if (!strcmp(name_list, "all")) 509 return ~0; 510 |
|
499 for (i = 0; i < MAX_BIC; ++i) { 500 if (!strcmp(name_list, bic[i].name)) { 501 retval |= (1ULL << i); 502 break; 503 } 504 } 505 if (i == MAX_BIC) { 506 if (mode == SHOW_LIST) { --- 20 unchanged lines hidden (view full) --- 527} 528 529 530void print_header(char *delim) 531{ 532 struct msr_counter *mp; 533 int printed = 0; 534 | 511 for (i = 0; i < MAX_BIC; ++i) { 512 if (!strcmp(name_list, bic[i].name)) { 513 retval |= (1ULL << i); 514 break; 515 } 516 } 517 if (i == MAX_BIC) { 518 if (mode == SHOW_LIST) { --- 20 unchanged lines hidden (view full) --- 539} 540 541 542void print_header(char *delim) 543{ 544 struct msr_counter *mp; 545 int printed = 0; 546 |
535 if (debug) 536 outp += sprintf(outp, "usec %s", delim); | 547 if (DO_BIC(BIC_USEC)) 548 outp += sprintf(outp, "%susec", (printed++ ? delim : "")); 549 if (DO_BIC(BIC_TOD)) 550 outp += sprintf(outp, "%sTime_Of_Day_Seconds", (printed++ ? delim : "")); |
537 if (DO_BIC(BIC_Package)) 538 outp += sprintf(outp, "%sPackage", (printed++ ? delim : "")); 539 if (DO_BIC(BIC_Core)) 540 outp += sprintf(outp, "%sCore", (printed++ ? delim : "")); 541 if (DO_BIC(BIC_CPU)) 542 outp += sprintf(outp, "%sCPU", (printed++ ? delim : "")); 543 if (DO_BIC(BIC_Avg_MHz)) 544 outp += sprintf(outp, "%sAvg_MHz", (printed++ ? delim : "")); --- 236 unchanged lines hidden (view full) --- 781 if (show_pkg_only && !(t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE)) 782 return 0; 783 784 /*if not summary line and --cpu is used */ 785 if ((t != &average.threads) && 786 (cpu_subset && !CPU_ISSET_S(t->cpu_id, cpu_subset_size, cpu_subset))) 787 return 0; 788 | 551 if (DO_BIC(BIC_Package)) 552 outp += sprintf(outp, "%sPackage", (printed++ ? delim : "")); 553 if (DO_BIC(BIC_Core)) 554 outp += sprintf(outp, "%sCore", (printed++ ? delim : "")); 555 if (DO_BIC(BIC_CPU)) 556 outp += sprintf(outp, "%sCPU", (printed++ ? delim : "")); 557 if (DO_BIC(BIC_Avg_MHz)) 558 outp += sprintf(outp, "%sAvg_MHz", (printed++ ? delim : "")); --- 236 unchanged lines hidden (view full) --- 795 if (show_pkg_only && !(t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE)) 796 return 0; 797 798 /*if not summary line and --cpu is used */ 799 if ((t != &average.threads) && 800 (cpu_subset && !CPU_ISSET_S(t->cpu_id, cpu_subset_size, cpu_subset))) 801 return 0; 802 |
789 if (debug) { | 803 if (DO_BIC(BIC_USEC)) { |
790 /* on each row, print how many usec each timestamp took to gather */ 791 struct timeval tv; 792 793 timersub(&t->tv_end, &t->tv_begin, &tv); 794 outp += sprintf(outp, "%5ld\t", tv.tv_sec * 1000000 + tv.tv_usec); 795 } 796 | 804 /* on each row, print how many usec each timestamp took to gather */ 805 struct timeval tv; 806 807 timersub(&t->tv_end, &t->tv_begin, &tv); 808 outp += sprintf(outp, "%5ld\t", tv.tv_sec * 1000000 + tv.tv_usec); 809 } 810 |
811 /* Time_Of_Day_Seconds: on each row, print sec.usec last timestamp taken */ 812 if (DO_BIC(BIC_TOD)) 813 outp += sprintf(outp, "%10ld.%06ld\t", t->tv_end.tv_sec, t->tv_end.tv_usec); 814 |
|
797 interval_float = tv_delta.tv_sec + tv_delta.tv_usec/1000000.0; 798 799 tsc = t->tsc * tsc_tweak; 800 801 /* topo columns, print blanks on 1st (average) line */ 802 if (t == &average.threads) { 803 if (DO_BIC(BIC_Package)) 804 outp += sprintf(outp, "%s-", (printed++ ? delim : "")); --- 330 unchanged lines hidden (view full) --- 1135 */ 1136int 1137delta_thread(struct thread_data *new, struct thread_data *old, 1138 struct core_data *core_delta) 1139{ 1140 int i; 1141 struct msr_counter *mp; 1142 | 815 interval_float = tv_delta.tv_sec + tv_delta.tv_usec/1000000.0; 816 817 tsc = t->tsc * tsc_tweak; 818 819 /* topo columns, print blanks on 1st (average) line */ 820 if (t == &average.threads) { 821 if (DO_BIC(BIC_Package)) 822 outp += sprintf(outp, "%s-", (printed++ ? delim : "")); --- 330 unchanged lines hidden (view full) --- 1153 */ 1154int 1155delta_thread(struct thread_data *new, struct thread_data *old, 1156 struct core_data *core_delta) 1157{ 1158 int i; 1159 struct msr_counter *mp; 1160 |
1161 /* 1162 * the timestamps from start of measurement interval are in "old" 1163 * the timestamp from end of measurement interval are in "new" 1164 * over-write old w/ new so we can print end of interval values 1165 */ 1166 1167 old->tv_begin = new->tv_begin; 1168 old->tv_end = new->tv_end; 1169 |
|
1143 old->tsc = new->tsc - old->tsc; 1144 1145 /* check for TSC < 1 Mcycles over interval */ 1146 if (old->tsc < (1000 * 1000)) 1147 errx(-3, "Insanely slow TSC rate, TSC stops in idle?\n" 1148 "You can disable all c-states by booting with \"idle=poll\"\n" 1149 "or just the deep ones with \"processor.max_cstate=1\""); 1150 --- 72 unchanged lines hidden (view full) --- 1223 return retval; 1224} 1225 1226void clear_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p) 1227{ 1228 int i; 1229 struct msr_counter *mp; 1230 | 1170 old->tsc = new->tsc - old->tsc; 1171 1172 /* check for TSC < 1 Mcycles over interval */ 1173 if (old->tsc < (1000 * 1000)) 1174 errx(-3, "Insanely slow TSC rate, TSC stops in idle?\n" 1175 "You can disable all c-states by booting with \"idle=poll\"\n" 1176 "or just the deep ones with \"processor.max_cstate=1\""); 1177 --- 72 unchanged lines hidden (view full) --- 1250 return retval; 1251} 1252 1253void clear_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p) 1254{ 1255 int i; 1256 struct msr_counter *mp; 1257 |
1258 t->tv_begin.tv_sec = 0; 1259 t->tv_begin.tv_usec = 0; 1260 t->tv_end.tv_sec = 0; 1261 t->tv_end.tv_usec = 0; 1262 |
|
1231 t->tsc = 0; 1232 t->aperf = 0; 1233 t->mperf = 0; 1234 t->c1 = 0; 1235 1236 t->irq_count = 0; 1237 t->smi_count = 0; 1238 --- 42 unchanged lines hidden (view full) --- 1281 p->counter[i] = 0; 1282} 1283int sum_counters(struct thread_data *t, struct core_data *c, 1284 struct pkg_data *p) 1285{ 1286 int i; 1287 struct msr_counter *mp; 1288 | 1263 t->tsc = 0; 1264 t->aperf = 0; 1265 t->mperf = 0; 1266 t->c1 = 0; 1267 1268 t->irq_count = 0; 1269 t->smi_count = 0; 1270 --- 42 unchanged lines hidden (view full) --- 1313 p->counter[i] = 0; 1314} 1315int sum_counters(struct thread_data *t, struct core_data *c, 1316 struct pkg_data *p) 1317{ 1318 int i; 1319 struct msr_counter *mp; 1320 |
1321 /* remember first tv_begin */ 1322 if (average.threads.tv_begin.tv_sec == 0) 1323 average.threads.tv_begin = t->tv_begin; 1324 1325 /* remember last tv_end */ 1326 average.threads.tv_end = t->tv_end; 1327 |
|
1289 average.threads.tsc += t->tsc; 1290 average.threads.aperf += t->aperf; 1291 average.threads.mperf += t->mperf; 1292 average.threads.c1 += t->c1; 1293 1294 average.threads.irq_count += t->irq_count; 1295 average.threads.smi_count += t->smi_count; 1296 --- 3658 unchanged lines hidden (view full) --- 4955 return; 4956 4957error: 4958 fprintf(stderr, "\"--cpu %s\" malformed\n", optarg); 4959 help(); 4960 exit(-1); 4961} 4962 | 1328 average.threads.tsc += t->tsc; 1329 average.threads.aperf += t->aperf; 1330 average.threads.mperf += t->mperf; 1331 average.threads.c1 += t->c1; 1332 1333 average.threads.irq_count += t->irq_count; 1334 average.threads.smi_count += t->smi_count; 1335 --- 3658 unchanged lines hidden (view full) --- 4994 return; 4995 4996error: 4997 fprintf(stderr, "\"--cpu %s\" malformed\n", optarg); 4998 help(); 4999 exit(-1); 5000} 5001 |
4963int shown; 4964/* 4965 * parse_show_hide() - process cmdline to set default counter action 4966 */ 4967void parse_show_hide(char *optarg, enum show_hide_mode new_mode) 4968{ 4969 /* 4970 * --show: show only those specified 4971 * The 1st invocation will clear and replace the enabled mask 4972 * subsequent invocations can add to it. 4973 */ 4974 if (new_mode == SHOW_LIST) { 4975 if (shown == 0) 4976 bic_enabled = bic_lookup(optarg, new_mode); 4977 else 4978 bic_enabled |= bic_lookup(optarg, new_mode); 4979 shown = 1; | |
4980 | 5002 |
4981 return; 4982 } 4983 4984 /* 4985 * --hide: do not show those specified 4986 * multiple invocations simply clear more bits in enabled mask 4987 */ 4988 bic_enabled &= ~bic_lookup(optarg, new_mode); 4989 4990} 4991 | |
4992void cmdline(int argc, char **argv) 4993{ 4994 int opt; 4995 int option_index = 0; 4996 static struct option long_options[] = { 4997 {"add", required_argument, 0, 'a'}, 4998 {"cpu", required_argument, 0, 'c'}, 4999 {"Dump", no_argument, 0, 'D'}, 5000 {"debug", no_argument, 0, 'd'}, /* internal, not documented */ | 5003void cmdline(int argc, char **argv) 5004{ 5005 int opt; 5006 int option_index = 0; 5007 static struct option long_options[] = { 5008 {"add", required_argument, 0, 'a'}, 5009 {"cpu", required_argument, 0, 'c'}, 5010 {"Dump", no_argument, 0, 'D'}, 5011 {"debug", no_argument, 0, 'd'}, /* internal, not documented */ |
5012 {"enable", required_argument, 0, 'e'}, |
|
5001 {"interval", required_argument, 0, 'i'}, 5002 {"help", no_argument, 0, 'h'}, 5003 {"hide", required_argument, 0, 'H'}, // meh, -h taken by --help 5004 {"Joules", no_argument, 0, 'J'}, 5005 {"list", no_argument, 0, 'l'}, 5006 {"out", required_argument, 0, 'o'}, 5007 {"quiet", no_argument, 0, 'q'}, 5008 {"show", required_argument, 0, 's'}, 5009 {"Summary", no_argument, 0, 'S'}, 5010 {"TCC", required_argument, 0, 'T'}, 5011 {"version", no_argument, 0, 'v' }, 5012 {0, 0, 0, 0 } 5013 }; 5014 5015 progname = argv[0]; 5016 | 5013 {"interval", required_argument, 0, 'i'}, 5014 {"help", no_argument, 0, 'h'}, 5015 {"hide", required_argument, 0, 'H'}, // meh, -h taken by --help 5016 {"Joules", no_argument, 0, 'J'}, 5017 {"list", no_argument, 0, 'l'}, 5018 {"out", required_argument, 0, 'o'}, 5019 {"quiet", no_argument, 0, 'q'}, 5020 {"show", required_argument, 0, 's'}, 5021 {"Summary", no_argument, 0, 'S'}, 5022 {"TCC", required_argument, 0, 'T'}, 5023 {"version", no_argument, 0, 'v' }, 5024 {0, 0, 0, 0 } 5025 }; 5026 5027 progname = argv[0]; 5028 |
5017 while ((opt = getopt_long_only(argc, argv, "+C:c:Ddhi:JM:m:o:qST:v", | 5029 while ((opt = getopt_long_only(argc, argv, "+C:c:Dde:hi:Jo:qST:v", |
5018 long_options, &option_index)) != -1) { 5019 switch (opt) { 5020 case 'a': 5021 parse_add_command(optarg); 5022 break; 5023 case 'c': 5024 parse_cpu_command(optarg); 5025 break; 5026 case 'D': 5027 dump_only++; 5028 break; | 5030 long_options, &option_index)) != -1) { 5031 switch (opt) { 5032 case 'a': 5033 parse_add_command(optarg); 5034 break; 5035 case 'c': 5036 parse_cpu_command(optarg); 5037 break; 5038 case 'D': 5039 dump_only++; 5040 break; |
5041 case 'e': 5042 /* --enable specified counter */ 5043 bic_enabled |= bic_lookup(optarg, SHOW_LIST); 5044 break; |
|
5029 case 'd': 5030 debug++; | 5045 case 'd': 5046 debug++; |
5047 ENABLE_BIC(BIC_DISABLED_BY_DEFAULT); |
|
5031 break; 5032 case 'H': | 5048 break; 5049 case 'H': |
5033 parse_show_hide(optarg, HIDE_LIST); | 5050 /* 5051 * --hide: do not show those specified 5052 * multiple invocations simply clear more bits in enabled mask 5053 */ 5054 bic_enabled &= ~bic_lookup(optarg, HIDE_LIST); |
5034 break; 5035 case 'h': 5036 default: 5037 help(); 5038 exit(1); 5039 case 'i': 5040 { 5041 double interval = strtod(optarg, NULL); --- 7 unchanged lines hidden (view full) --- 5049 interval_ts.tv_sec = interval; 5050 interval_ts.tv_nsec = (interval - interval_ts.tv_sec) * 1000000000; 5051 } 5052 break; 5053 case 'J': 5054 rapl_joules++; 5055 break; 5056 case 'l': | 5055 break; 5056 case 'h': 5057 default: 5058 help(); 5059 exit(1); 5060 case 'i': 5061 { 5062 double interval = strtod(optarg, NULL); --- 7 unchanged lines hidden (view full) --- 5070 interval_ts.tv_sec = interval; 5071 interval_ts.tv_nsec = (interval - interval_ts.tv_sec) * 1000000000; 5072 } 5073 break; 5074 case 'J': 5075 rapl_joules++; 5076 break; 5077 case 'l': |
5078 ENABLE_BIC(BIC_DISABLED_BY_DEFAULT); |
|
5057 list_header_only++; 5058 quiet++; 5059 break; 5060 case 'o': 5061 outf = fopen_or_die(optarg, "w"); 5062 break; 5063 case 'q': 5064 quiet = 1; 5065 break; 5066 case 's': | 5079 list_header_only++; 5080 quiet++; 5081 break; 5082 case 'o': 5083 outf = fopen_or_die(optarg, "w"); 5084 break; 5085 case 'q': 5086 quiet = 1; 5087 break; 5088 case 's': |
5067 parse_show_hide(optarg, SHOW_LIST); | 5089 /* 5090 * --show: show only those specified 5091 * The 1st invocation will clear and replace the enabled mask 5092 * subsequent invocations can add to it. 5093 */ 5094 if (shown == 0) 5095 bic_enabled = bic_lookup(optarg, SHOW_LIST); 5096 else 5097 bic_enabled |= bic_lookup(optarg, SHOW_LIST); 5098 shown = 1; |
5068 break; 5069 case 'S': 5070 summary_only++; 5071 break; 5072 case 'T': 5073 tcc_activation_temp_override = atoi(optarg); 5074 break; 5075 case 'v': --- 41 unchanged lines hidden --- | 5099 break; 5100 case 'S': 5101 summary_only++; 5102 break; 5103 case 'T': 5104 tcc_activation_temp_override = atoi(optarg); 5105 break; 5106 case 'v': --- 41 unchanged lines hidden --- |