Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tools/power turbostat: Add tcore clock PMT type

Some PMT counters, for example module c1e residency on Intel Clearwater
Forest, are reported using tcore clock type.

Signed-off-by: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Patryk Wlazlyn and committed by
Len Brown
1a202afe a80e5347

+29 -3
+29 -3
tools/power/x86/turbostat/turbostat.c
··· 1538 1538 #define PMT_MTL_DC6_GUID 0x1a067102 1539 1539 #define PMT_MTL_DC6_SEQ 0 1540 1540 1541 + unsigned long long tcore_clock_freq_hz = 800000000; 1542 + 1541 1543 #define PMT_COUNTER_NAME_SIZE_BYTES 16 1542 1544 #define PMT_COUNTER_TYPE_NAME_SIZE_BYTES 32 1543 1545 ··· 1562 1560 enum pmt_datatype { 1563 1561 PMT_TYPE_RAW, 1564 1562 PMT_TYPE_XTAL_TIME, 1563 + PMT_TYPE_TCORE_CLOCK, 1565 1564 }; 1566 1565 1567 1566 struct pmt_domain_info { ··· 2477 2474 break; 2478 2475 2479 2476 case PMT_TYPE_XTAL_TIME: 2477 + case PMT_TYPE_TCORE_CLOCK: 2480 2478 outp += sprintf(outp, "%s%s", (printed++ ? delim : ""), ppmt->name); 2481 2479 break; 2482 2480 } ··· 2552 2548 break; 2553 2549 2554 2550 case PMT_TYPE_XTAL_TIME: 2551 + case PMT_TYPE_TCORE_CLOCK: 2555 2552 outp += sprintf(outp, "%s%s", (printed++ ? delim : ""), ppmt->name); 2556 2553 break; 2557 2554 } ··· 2684 2679 break; 2685 2680 2686 2681 case PMT_TYPE_XTAL_TIME: 2682 + case PMT_TYPE_TCORE_CLOCK: 2687 2683 outp += sprintf(outp, "%s%s", (printed++ ? delim : ""), ppmt->name); 2688 2684 break; 2689 2685 } ··· 3003 2997 3004 2998 for (i = 0, ppmt = sys.pmt_tp; ppmt; i++, ppmt = ppmt->next) { 3005 2999 const unsigned long value_raw = t->pmt_counter[i]; 3006 - const double value_converted = 100.0 * value_raw / crystal_hz / interval_float; 3000 + double value_converted; 3007 3001 switch (ppmt->type) { 3008 3002 case PMT_TYPE_RAW: 3009 3003 if (pmt_counter_get_width(ppmt) <= 32) ··· 3015 3009 break; 3016 3010 3017 3011 case PMT_TYPE_XTAL_TIME: 3012 + value_converted = 100.0 * value_raw / crystal_hz / interval_float; 3018 3013 outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted); 3019 3014 break; 3015 + 3016 + case PMT_TYPE_TCORE_CLOCK: 3017 + value_converted = 100.0 * value_raw / tcore_clock_freq_hz / interval_float; 3018 + outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted); 3020 3019 } 3021 3020 } 3022 3021 ··· 3088 3077 3089 3078 for (i = 0, ppmt = sys.pmt_cp; ppmt; i++, ppmt = ppmt->next) { 3090 3079 const unsigned long value_raw = c->pmt_counter[i]; 3091 - const double value_converted = 100.0 * value_raw / crystal_hz / interval_float; 3080 + double value_converted; 3092 3081 switch (ppmt->type) { 3093 3082 case PMT_TYPE_RAW: 3094 3083 if (pmt_counter_get_width(ppmt) <= 32) ··· 3100 3089 break; 3101 3090 3102 3091 case PMT_TYPE_XTAL_TIME: 3092 + value_converted = 100.0 * value_raw / crystal_hz / interval_float; 3103 3093 outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted); 3104 3094 break; 3095 + 3096 + case PMT_TYPE_TCORE_CLOCK: 3097 + value_converted = 100.0 * value_raw / tcore_clock_freq_hz / interval_float; 3098 + outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted); 3105 3099 } 3106 3100 } 3107 3101 ··· 3291 3275 3292 3276 for (i = 0, ppmt = sys.pmt_pp; ppmt; i++, ppmt = ppmt->next) { 3293 3277 const unsigned long value_raw = p->pmt_counter[i]; 3294 - const double value_converted = 100.0 * value_raw / crystal_hz / interval_float; 3278 + double value_converted; 3295 3279 switch (ppmt->type) { 3296 3280 case PMT_TYPE_RAW: 3297 3281 if (pmt_counter_get_width(ppmt) <= 32) ··· 3303 3287 break; 3304 3288 3305 3289 case PMT_TYPE_XTAL_TIME: 3290 + value_converted = 100.0 * value_raw / crystal_hz / interval_float; 3306 3291 outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted); 3307 3292 break; 3293 + 3294 + case PMT_TYPE_TCORE_CLOCK: 3295 + value_converted = 100.0 * value_raw / tcore_clock_freq_hz / interval_float; 3296 + outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted); 3308 3297 } 3309 3298 } 3310 3299 ··· 10034 10013 10035 10014 if (strcmp("txtal_time", type_name) == 0) { 10036 10015 type = PMT_TYPE_XTAL_TIME; 10016 + has_type = true; 10017 + } 10018 + 10019 + if (strcmp("tcore_clock", type_name) == 0) { 10020 + type = PMT_TYPE_TCORE_CLOCK; 10037 10021 has_type = true; 10038 10022 } 10039 10023