2019-06-30 10:14:08 -07:00
// SPDX-License-Identifier: GPL-2.0
/*
* Intel dynamic_speed_select - - Enumerate and control features
* Copyright ( c ) 2019 Intel Corporation .
*/
# include "isst.h"
2019-09-05 08:03:09 -04:00
static void printcpulist ( int str_len , char * str , int mask_size ,
cpu_set_t * cpu_mask )
{
int i , first , curr_index , index ;
if ( ! CPU_COUNT_S ( mask_size , cpu_mask ) ) {
snprintf ( str , str_len , " none " ) ;
return ;
}
curr_index = 0 ;
first = 1 ;
for ( i = 0 ; i < get_topo_max_cpus ( ) ; + + i ) {
if ( ! CPU_ISSET_S ( i , mask_size , cpu_mask ) )
continue ;
if ( ! first ) {
index = snprintf ( & str [ curr_index ] ,
str_len - curr_index , " , " ) ;
curr_index + = index ;
2021-03-04 17:31:49 -08:00
if ( curr_index > = str_len )
break ;
2019-09-05 08:03:09 -04:00
}
index = snprintf ( & str [ curr_index ] , str_len - curr_index , " %d " ,
i ) ;
curr_index + = index ;
2021-03-04 17:31:49 -08:00
if ( curr_index > = str_len )
break ;
2019-09-05 08:03:09 -04:00
first = 0 ;
}
}
2019-06-30 10:14:08 -07:00
static void printcpumask ( int str_len , char * str , int mask_size ,
cpu_set_t * cpu_mask )
{
int i , max_cpus = get_topo_max_cpus ( ) ;
unsigned int * mask ;
int size , index , curr_index ;
size = max_cpus / ( sizeof ( unsigned int ) * 8 ) ;
if ( max_cpus % ( sizeof ( unsigned int ) * 8 ) )
size + + ;
mask = calloc ( size , sizeof ( unsigned int ) ) ;
if ( ! mask )
return ;
for ( i = 0 ; i < max_cpus ; + + i ) {
int mask_index , bit_index ;
if ( ! CPU_ISSET_S ( i , mask_size , cpu_mask ) )
continue ;
mask_index = i / ( sizeof ( unsigned int ) * 8 ) ;
bit_index = i % ( sizeof ( unsigned int ) * 8 ) ;
mask [ mask_index ] | = BIT ( bit_index ) ;
}
curr_index = 0 ;
for ( i = size - 1 ; i > = 0 ; - - i ) {
index = snprintf ( & str [ curr_index ] , str_len - curr_index , " %08x " ,
mask [ i ] ) ;
curr_index + = index ;
2021-03-04 17:31:49 -08:00
if ( curr_index > = str_len )
break ;
2019-06-30 10:14:08 -07:00
if ( i ) {
strncat ( & str [ curr_index ] , " , " , str_len - curr_index ) ;
curr_index + + ;
}
2021-03-04 17:31:49 -08:00
if ( curr_index > = str_len )
break ;
2019-06-30 10:14:08 -07:00
}
free ( mask ) ;
}
static void format_and_print_txt ( FILE * outf , int level , char * header ,
char * value )
{
char * spaces = " " ;
static char delimiters [ 256 ] ;
int i , j = 0 ;
if ( ! level )
return ;
if ( level = = 1 ) {
strcpy ( delimiters , " " ) ;
} else {
for ( i = 0 ; i < level - 1 ; + + i )
j + = snprintf ( & delimiters [ j ] , sizeof ( delimiters ) - j ,
" %s " , spaces ) ;
}
if ( header & & value ) {
fprintf ( outf , " %s " , delimiters ) ;
fprintf ( outf , " %s:%s \n " , header , value ) ;
} else if ( header ) {
fprintf ( outf , " %s " , delimiters ) ;
fprintf ( outf , " %s \n " , header ) ;
}
}
static int last_level ;
static void format_and_print ( FILE * outf , int level , char * header , char * value )
{
char * spaces = " " ;
static char delimiters [ 256 ] ;
int i ;
if ( ! out_format_is_json ( ) ) {
format_and_print_txt ( outf , level , header , value ) ;
return ;
}
if ( level = = 0 ) {
if ( header )
fprintf ( outf , " { " ) ;
else
fprintf ( outf , " \n } \n " ) ;
} else {
int j = 0 ;
for ( i = 0 ; i < level ; + + i )
j + = snprintf ( & delimiters [ j ] , sizeof ( delimiters ) - j ,
" %s " , spaces ) ;
if ( last_level = = level )
fprintf ( outf , " , \n " ) ;
if ( value ) {
if ( last_level ! = level )
fprintf ( outf , " \n " ) ;
fprintf ( outf , " %s \" %s \" : " , delimiters , header ) ;
fprintf ( outf , " \" %s \" " , value ) ;
} else {
for ( i = last_level - 1 ; i > = level ; - - i ) {
int k = 0 ;
for ( j = i ; j > 0 ; - - j )
k + = snprintf ( & delimiters [ k ] ,
sizeof ( delimiters ) - k ,
" %s " , spaces ) ;
if ( i = = level & & header )
fprintf ( outf , " \n %s}, " , delimiters ) ;
else
fprintf ( outf , " \n %s} " , delimiters ) ;
}
if ( abs ( last_level - level ) < 3 )
fprintf ( outf , " \n " ) ;
if ( header )
fprintf ( outf , " %s \" %s \" : { " , delimiters ,
header ) ;
}
}
last_level = level ;
}
2022-08-20 23:58:18 +08:00
static int print_package_info ( struct isst_id * id , FILE * outf )
2019-06-30 10:14:08 -07:00
{
char header [ 256 ] ;
2022-08-10 17:14:11 +08:00
int level = 1 ;
2019-06-30 10:14:08 -07:00
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
if ( out_format_is_json ( ) ) {
2022-08-10 17:14:11 +08:00
if ( api_version ( ) > 1 )
snprintf ( header , sizeof ( header ) , " package-%d:die-%d:powerdomain-%d:cpu-%d " ,
id - > pkg , id - > die , id - > punit , id - > cpu ) ;
else
snprintf ( header , sizeof ( header ) , " package-%d:die-%d:cpu-%d " ,
id - > pkg , id - > die , id - > cpu ) ;
format_and_print ( outf , level , header , NULL ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
return 1 ;
}
2022-08-20 23:58:21 +08:00
snprintf ( header , sizeof ( header ) , " package-%d " , id - > pkg ) ;
2022-08-10 17:14:11 +08:00
format_and_print ( outf , level + + , header , NULL ) ;
2022-08-20 23:58:21 +08:00
snprintf ( header , sizeof ( header ) , " die-%d " , id - > die ) ;
2022-08-10 17:14:11 +08:00
format_and_print ( outf , level + + , header , NULL ) ;
if ( api_version ( ) > 1 ) {
snprintf ( header , sizeof ( header ) , " powerdomain-%d " , id - > punit ) ;
format_and_print ( outf , level + + , header , NULL ) ;
}
2022-08-20 23:58:18 +08:00
snprintf ( header , sizeof ( header ) , " cpu-%d " , id - > cpu ) ;
2022-08-10 17:14:11 +08:00
format_and_print ( outf , level , header , NULL ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
2022-08-10 17:14:11 +08:00
return level ;
2019-06-30 10:14:08 -07:00
}
2022-08-20 23:58:18 +08:00
static void _isst_pbf_display_information ( struct isst_id * id , FILE * outf , int level ,
2019-06-30 10:14:08 -07:00
struct isst_pbf_info * pbf_info ,
int disp_level )
{
char header [ 256 ] ;
2021-03-04 17:31:49 -08:00
char value [ 512 ] ;
2019-06-30 10:14:08 -07:00
2020-01-30 21:45:18 -08:00
snprintf ( header , sizeof ( header ) , " speed-select-base-freq-properties " ) ;
2019-06-30 10:14:08 -07:00
format_and_print ( outf , disp_level , header , NULL ) ;
2019-09-05 08:03:07 -04:00
snprintf ( header , sizeof ( header ) , " high-priority-base-frequency(MHz) " ) ;
2019-06-30 10:14:08 -07:00
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
pbf_info - > p1_high * isst_get_disp_freq_multiplier ( ) ) ;
2019-06-30 10:14:08 -07:00
format_and_print ( outf , disp_level + 1 , header , value ) ;
snprintf ( header , sizeof ( header ) , " high-priority-cpu-mask " ) ;
printcpumask ( sizeof ( value ) , value , pbf_info - > core_cpumask_size ,
pbf_info - > core_cpumask ) ;
format_and_print ( outf , disp_level + 1 , header , value ) ;
2019-09-05 08:03:09 -04:00
snprintf ( header , sizeof ( header ) , " high-priority-cpu-list " ) ;
printcpulist ( sizeof ( value ) , value ,
pbf_info - > core_cpumask_size ,
pbf_info - > core_cpumask ) ;
format_and_print ( outf , disp_level + 1 , header , value ) ;
2019-09-05 08:03:07 -04:00
snprintf ( header , sizeof ( header ) , " low-priority-base-frequency(MHz) " ) ;
2019-06-30 10:14:08 -07:00
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
pbf_info - > p1_low * isst_get_disp_freq_multiplier ( ) ) ;
2019-06-30 10:14:08 -07:00
format_and_print ( outf , disp_level + 1 , header , value ) ;
tools/power/x86/intel-speed-select: Implement 'perf-profile info' on CascadeLake-N
Add functionality for "perf-profile info" on CascadeLake-N.
Sample output:
intel-speed-select perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:85[0x55]
package-0
die-0
cpu-0
perf-profile-level-0
cpu-count:20
enable-cpu-mask:00000000,000fffff
enable-cpu-list:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
thermal-design-power-ratio:23
base-frequency(MHz):2300
speed-select-turbo-freq:unsupported
speed-select-base-freq:enabled
speed-select-base-freq
high-priority-base-frequency(MHz):2700000
high-priority-cpu-mask:00000000,0000e8c0
high-priority-cpu-list:6,7,11,13,14,15
low-priority-base-frequency(MHz):2100000
package-1
die-0
cpu-20
perf-profile-level-0
cpu-count:20
enable-cpu-mask:000000ff,fff00000
enable-cpu-list:20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
thermal-design-power-ratio:23
base-frequency(MHz):2300
speed-select-turbo-freq:unsupported
speed-select-base-freq:enabled
speed-select-base-freq
high-priority-base-frequency(MHz):2700000
high-priority-cpu-mask:0000000e,8c000000
high-priority-cpu-list:26,27,31,33,34,35
low-priority-base-frequency(MHz):2100000
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-10 13:29:44 -07:00
if ( is_clx_n_platform ( ) )
return ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " tjunction-temperature(C) " ) ;
snprintf ( value , sizeof ( value ) , " %d " , pbf_info - > t_prochot ) ;
format_and_print ( outf , disp_level + 1 , header , value ) ;
snprintf ( header , sizeof ( header ) , " thermal-design-power(W) " ) ;
snprintf ( value , sizeof ( value ) , " %d " , pbf_info - > tdp ) ;
format_and_print ( outf , disp_level + 1 , header , value ) ;
}
2022-08-20 23:58:18 +08:00
static void _isst_fact_display_information ( struct isst_id * id , FILE * outf , int level ,
2019-06-30 10:14:08 -07:00
int fact_bucket , int fact_avx ,
struct isst_fact_info * fact_info ,
int base_level )
{
struct isst_fact_bucket_info * bucket_info = fact_info - > bucket_info ;
2022-08-20 18:33:01 +08:00
int trl_max_levels = isst_get_trl_max_levels ( ) ;
2019-06-30 10:14:08 -07:00
char header [ 256 ] ;
char value [ 256 ] ;
2020-03-05 14:45:29 -08:00
int print = 0 , j ;
for ( j = 0 ; j < ISST_FACT_MAX_BUCKETS ; + + j ) {
if ( fact_bucket ! = 0xff & & fact_bucket ! = j )
continue ;
2022-08-18 21:18:03 +08:00
/* core count must be valid for CPU power domain */
if ( ! bucket_info [ j ] . hp_cores & & id - > cpu > = 0 )
2020-03-05 14:45:29 -08:00
break ;
print = 1 ;
}
if ( ! print ) {
fprintf ( stderr , " Invalid bucket \n " ) ;
return ;
}
2019-06-30 10:14:08 -07:00
2020-01-30 21:45:18 -08:00
snprintf ( header , sizeof ( header ) , " speed-select-turbo-freq-properties " ) ;
2019-06-30 10:14:08 -07:00
format_and_print ( outf , base_level , header , NULL ) ;
for ( j = 0 ; j < ISST_FACT_MAX_BUCKETS ; + + j ) {
2022-08-20 18:33:01 +08:00
int i ;
2019-06-30 10:14:08 -07:00
if ( fact_bucket ! = 0xff & & fact_bucket ! = j )
continue ;
2022-08-20 18:33:01 +08:00
if ( ! bucket_info [ j ] . hp_cores )
2019-06-30 10:14:08 -07:00
break ;
snprintf ( header , sizeof ( header ) , " bucket-%d " , j ) ;
format_and_print ( outf , base_level + 1 , header , NULL ) ;
snprintf ( header , sizeof ( header ) , " high-priority-cores-count " ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:33:01 +08:00
bucket_info [ j ] . hp_cores ) ;
2019-06-30 10:14:08 -07:00
format_and_print ( outf , base_level + 2 , header , value ) ;
2022-08-20 18:33:01 +08:00
for ( i = 0 ; i < trl_max_levels ; i + + ) {
2023-02-23 06:36:46 -08:00
if ( ! bucket_info [ j ] . hp_ratios [ i ] | | ( fact_avx ! = 0xFF & & ! ( fact_avx & ( 1 < < i ) ) ) )
2022-08-20 18:33:01 +08:00
continue ;
2023-02-23 06:36:46 -08:00
if ( i = = 0 & & api_version ( ) = = 1 & & ! is_emr_platform ( ) )
2022-08-20 18:33:01 +08:00
snprintf ( header , sizeof ( header ) ,
" high-priority-max-frequency(MHz) " ) ;
else
snprintf ( header , sizeof ( header ) ,
" high-priority-max-%s-frequency(MHz) " , isst_get_trl_level_name ( i ) ) ;
2019-06-30 10:14:08 -07:00
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
bucket_info [ j ] . hp_ratios [ i ] * isst_get_disp_freq_multiplier ( ) ) ;
2019-06-30 10:14:08 -07:00
format_and_print ( outf , base_level + 2 , header , value ) ;
}
}
snprintf ( header , sizeof ( header ) ,
" speed-select-turbo-freq-clip-frequencies " ) ;
format_and_print ( outf , base_level + 1 , header , NULL ) ;
2022-08-20 18:33:01 +08:00
for ( j = 0 ; j < trl_max_levels ; j + + ) {
2023-02-23 06:36:46 -08:00
if ( ! fact_info - > lp_ratios [ j ] )
continue ;
2022-08-20 18:33:01 +08:00
/* No AVX level name for SSE to be consistent with previous formatting */
2023-02-23 06:36:46 -08:00
if ( j = = 0 & & api_version ( ) = = 1 & & ! is_emr_platform ( ) )
2022-08-20 18:33:01 +08:00
snprintf ( header , sizeof ( header ) , " low-priority-max-frequency(MHz) " ) ;
else
snprintf ( header , sizeof ( header ) , " low-priority-max-%s-frequency(MHz) " ,
isst_get_trl_level_name ( j ) ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
fact_info - > lp_ratios [ j ] * isst_get_disp_freq_multiplier ( ) ) ;
2022-08-20 18:33:01 +08:00
format_and_print ( outf , base_level + 2 , header , value ) ;
}
2019-06-30 10:14:08 -07:00
}
2022-08-20 23:58:18 +08:00
void isst_ctdp_display_core_info ( struct isst_id * id , FILE * outf , char * prefix ,
2020-03-05 14:45:27 -08:00
unsigned int val , char * str0 , char * str1 )
2019-09-17 17:52:37 -07:00
{
char value [ 256 ] ;
2022-08-10 17:14:11 +08:00
int level = print_package_info ( id , outf ) ;
2020-05-11 15:06:28 -04:00
2022-08-10 17:14:11 +08:00
level + + ;
2019-09-17 17:52:37 -07:00
2020-03-05 14:45:27 -08:00
if ( str0 & & ! val )
snprintf ( value , sizeof ( value ) , " %s " , str0 ) ;
else if ( str1 & & val )
snprintf ( value , sizeof ( value ) , " %s " , str1 ) ;
else
snprintf ( value , sizeof ( value ) , " %u " , val ) ;
2020-05-11 15:06:28 -04:00
format_and_print ( outf , level , prefix , value ) ;
2019-09-17 17:52:37 -07:00
format_and_print ( outf , 1 , NULL , NULL ) ;
}
2022-08-20 23:58:18 +08:00
void isst_ctdp_display_information ( struct isst_id * id , FILE * outf , int tdp_level ,
2019-06-30 10:14:08 -07:00
struct isst_pkg_ctdp * pkg_dev )
{
char header [ 256 ] ;
2021-03-04 17:31:49 -08:00
char value [ 512 ] ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
static int level ;
2022-08-20 18:11:21 +08:00
int trl_max_levels = isst_get_trl_max_levels ( ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
int i ;
2019-06-30 10:14:08 -07:00
2019-11-15 12:35:22 -08:00
if ( pkg_dev - > processed )
2022-08-20 23:58:18 +08:00
level = print_package_info ( id , outf ) ;
2019-06-30 10:14:08 -07:00
for ( i = 0 ; i < = pkg_dev - > levels ; + + i ) {
struct isst_pkg_ctdp_level_info * ctdp_level ;
2022-08-20 18:11:21 +08:00
int j , k ;
2019-06-30 10:14:08 -07:00
ctdp_level = & pkg_dev - > ctdp_level [ i ] ;
if ( ! ctdp_level - > processed )
continue ;
snprintf ( header , sizeof ( header ) , " perf-profile-level-%d " ,
ctdp_level - > level ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 1 , header , NULL ) ;
2019-06-30 10:14:08 -07:00
2022-08-18 21:26:23 +08:00
if ( id - > cpu > = 0 ) {
snprintf ( header , sizeof ( header ) , " cpu-count " ) ;
j = get_cpu_count ( id ) ;
2020-03-05 14:45:36 -08:00
snprintf ( value , sizeof ( value ) , " %d " , j ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2020-03-05 14:45:36 -08:00
2022-08-18 21:26:23 +08:00
j = CPU_COUNT_S ( ctdp_level - > core_cpumask_size ,
ctdp_level - > core_cpumask ) ;
if ( j ) {
snprintf ( header , sizeof ( header ) , " enable-cpu-count " ) ;
snprintf ( value , sizeof ( value ) , " %d " , j ) ;
format_and_print ( outf , level + 2 , header , value ) ;
}
2019-06-30 10:14:08 -07:00
2022-08-18 21:26:23 +08:00
if ( ctdp_level - > core_cpumask_size ) {
snprintf ( header , sizeof ( header ) , " enable-cpu-mask " ) ;
printcpumask ( sizeof ( value ) , value ,
ctdp_level - > core_cpumask_size ,
ctdp_level - > core_cpumask ) ;
format_and_print ( outf , level + 2 , header , value ) ;
snprintf ( header , sizeof ( header ) , " enable-cpu-list " ) ;
printcpulist ( sizeof ( value ) , value ,
ctdp_level - > core_cpumask_size ,
ctdp_level - > core_cpumask ) ;
format_and_print ( outf , level + 2 , header , value ) ;
}
2019-11-04 03:02:44 -08:00
}
2019-09-05 08:03:09 -04:00
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " thermal-design-power-ratio " ) ;
snprintf ( value , sizeof ( value ) , " %d " , ctdp_level - > tdp_ratio ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
2019-09-05 08:03:07 -04:00
snprintf ( header , sizeof ( header ) , " base-frequency(MHz) " ) ;
2019-11-04 03:02:37 -08:00
if ( ! ctdp_level - > sse_p1 )
ctdp_level - > sse_p1 = ctdp_level - > tdp_ratio ;
2019-06-30 10:14:08 -07:00
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
ctdp_level - > sse_p1 * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
2019-11-04 03:02:37 -08:00
if ( ctdp_level - > avx2_p1 ) {
snprintf ( header , sizeof ( header ) , " base-frequency-avx2(MHz) " ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
ctdp_level - > avx2_p1 * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-11-04 03:02:37 -08:00
}
if ( ctdp_level - > avx512_p1 ) {
snprintf ( header , sizeof ( header ) , " base-frequency-avx512(MHz) " ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
ctdp_level - > avx512_p1 * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-11-04 03:02:37 -08:00
}
2022-12-09 11:23:02 -08:00
if ( ctdp_level - > uncore_pm ) {
2019-11-04 03:02:37 -08:00
snprintf ( header , sizeof ( header ) , " uncore-frequency-min(MHz) " ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
ctdp_level - > uncore_pm * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-11-04 03:02:37 -08:00
}
if ( ctdp_level - > uncore_p0 ) {
snprintf ( header , sizeof ( header ) , " uncore-frequency-max(MHz) " ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
ctdp_level - > uncore_p0 * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-11-04 03:02:37 -08:00
}
2023-02-23 05:59:24 -08:00
if ( ctdp_level - > amx_p1 ) {
2022-08-09 03:29:23 +08:00
snprintf ( header , sizeof ( header ) , " base-frequency-amx(MHz) " ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
ctdp_level - > amx_p1 * isst_get_disp_freq_multiplier ( ) ) ;
format_and_print ( outf , level + 2 , header , value ) ;
}
2022-12-09 11:23:02 -08:00
if ( ctdp_level - > uncore_p1 ) {
snprintf ( header , sizeof ( header ) , " uncore-frequency-base(MHz) " ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
2022-08-20 18:44:59 +08:00
ctdp_level - > uncore_p1 * isst_get_disp_freq_multiplier ( ) ) ;
2022-12-09 11:23:02 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
}
2019-11-04 03:02:37 -08:00
if ( ctdp_level - > mem_freq ) {
2023-08-09 08:53:04 -07:00
snprintf ( header , sizeof ( header ) , " max-mem-frequency(MHz) " ) ;
2019-11-04 03:02:37 -08:00
snprintf ( value , sizeof ( value ) , " %d " ,
2021-05-12 03:17:32 -07:00
ctdp_level - > mem_freq ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-11-04 03:02:37 -08:00
}
2022-08-09 03:29:23 +08:00
if ( api_version ( ) > 1 ) {
snprintf ( header , sizeof ( header ) , " cooling_type " ) ;
snprintf ( value , sizeof ( value ) , " %d " ,
ctdp_level - > cooling_type ) ;
format_and_print ( outf , level + 2 , header , value ) ;
}
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) ,
2019-09-05 08:03:06 -04:00
" speed-select-turbo-freq " ) ;
if ( ctdp_level - > fact_support ) {
if ( ctdp_level - > fact_enabled )
snprintf ( value , sizeof ( value ) , " enabled " ) ;
else
snprintf ( value , sizeof ( value ) , " disabled " ) ;
} else
snprintf ( value , sizeof ( value ) , " unsupported " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) ,
2019-09-05 08:03:06 -04:00
" speed-select-base-freq " ) ;
if ( ctdp_level - > pbf_support ) {
if ( ctdp_level - > pbf_enabled )
snprintf ( value , sizeof ( value ) , " enabled " ) ;
2020-01-14 11:22:14 -08:00
else
snprintf ( value , sizeof ( value ) , " disabled " ) ;
} else
snprintf ( value , sizeof ( value ) , " unsupported " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2020-01-14 11:22:14 -08:00
snprintf ( header , sizeof ( header ) ,
" speed-select-core-power " ) ;
if ( ctdp_level - > sst_cp_support ) {
if ( ctdp_level - > sst_cp_enabled )
snprintf ( value , sizeof ( value ) , " enabled " ) ;
2019-09-05 08:03:06 -04:00
else
snprintf ( value , sizeof ( value ) , " disabled " ) ;
} else
snprintf ( value , sizeof ( value ) , " unsupported " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
tools/power/x86/intel-speed-select: Implement 'perf-profile info' on CascadeLake-N
Add functionality for "perf-profile info" on CascadeLake-N.
Sample output:
intel-speed-select perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:85[0x55]
package-0
die-0
cpu-0
perf-profile-level-0
cpu-count:20
enable-cpu-mask:00000000,000fffff
enable-cpu-list:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
thermal-design-power-ratio:23
base-frequency(MHz):2300
speed-select-turbo-freq:unsupported
speed-select-base-freq:enabled
speed-select-base-freq
high-priority-base-frequency(MHz):2700000
high-priority-cpu-mask:00000000,0000e8c0
high-priority-cpu-list:6,7,11,13,14,15
low-priority-base-frequency(MHz):2100000
package-1
die-0
cpu-20
perf-profile-level-0
cpu-count:20
enable-cpu-mask:000000ff,fff00000
enable-cpu-list:20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
thermal-design-power-ratio:23
base-frequency(MHz):2300
speed-select-turbo-freq:unsupported
speed-select-base-freq:enabled
speed-select-base-freq
high-priority-base-frequency(MHz):2700000
high-priority-cpu-mask:0000000e,8c000000
high-priority-cpu-list:26,27,31,33,34,35
low-priority-base-frequency(MHz):2100000
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-10 13:29:44 -07:00
if ( is_clx_n_platform ( ) ) {
if ( ctdp_level - > pbf_support )
2022-08-20 23:58:18 +08:00
_isst_pbf_display_information ( id , outf ,
tools/power/x86/intel-speed-select: Implement 'perf-profile info' on CascadeLake-N
Add functionality for "perf-profile info" on CascadeLake-N.
Sample output:
intel-speed-select perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:85[0x55]
package-0
die-0
cpu-0
perf-profile-level-0
cpu-count:20
enable-cpu-mask:00000000,000fffff
enable-cpu-list:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
thermal-design-power-ratio:23
base-frequency(MHz):2300
speed-select-turbo-freq:unsupported
speed-select-base-freq:enabled
speed-select-base-freq
high-priority-base-frequency(MHz):2700000
high-priority-cpu-mask:00000000,0000e8c0
high-priority-cpu-list:6,7,11,13,14,15
low-priority-base-frequency(MHz):2100000
package-1
die-0
cpu-20
perf-profile-level-0
cpu-count:20
enable-cpu-mask:000000ff,fff00000
enable-cpu-list:20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
thermal-design-power-ratio:23
base-frequency(MHz):2300
speed-select-turbo-freq:unsupported
speed-select-base-freq:enabled
speed-select-base-freq
high-priority-base-frequency(MHz):2700000
high-priority-cpu-mask:0000000e,8c000000
high-priority-cpu-list:26,27,31,33,34,35
low-priority-base-frequency(MHz):2100000
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-10 13:29:44 -07:00
tdp_level ,
& ctdp_level - > pbf_info ,
2020-04-20 10:10:54 -04:00
level + 2 ) ;
tools/power/x86/intel-speed-select: Implement 'perf-profile info' on CascadeLake-N
Add functionality for "perf-profile info" on CascadeLake-N.
Sample output:
intel-speed-select perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:85[0x55]
package-0
die-0
cpu-0
perf-profile-level-0
cpu-count:20
enable-cpu-mask:00000000,000fffff
enable-cpu-list:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
thermal-design-power-ratio:23
base-frequency(MHz):2300
speed-select-turbo-freq:unsupported
speed-select-base-freq:enabled
speed-select-base-freq
high-priority-base-frequency(MHz):2700000
high-priority-cpu-mask:00000000,0000e8c0
high-priority-cpu-list:6,7,11,13,14,15
low-priority-base-frequency(MHz):2100000
package-1
die-0
cpu-20
perf-profile-level-0
cpu-count:20
enable-cpu-mask:000000ff,fff00000
enable-cpu-list:20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39
thermal-design-power-ratio:23
base-frequency(MHz):2300
speed-select-turbo-freq:unsupported
speed-select-base-freq:enabled
speed-select-base-freq
high-priority-base-frequency(MHz):2700000
high-priority-cpu-mask:0000000e,8c000000
high-priority-cpu-list:26,27,31,33,34,35
low-priority-base-frequency(MHz):2100000
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2019-10-10 13:29:44 -07:00
continue ;
}
2019-11-04 03:02:44 -08:00
if ( ctdp_level - > pkg_tdp ) {
snprintf ( header , sizeof ( header ) , " thermal-design-power(W) " ) ;
snprintf ( value , sizeof ( value ) , " %d " , ctdp_level - > pkg_tdp ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-11-04 03:02:44 -08:00
}
2019-06-30 10:14:08 -07:00
2019-11-04 03:02:44 -08:00
if ( ctdp_level - > t_proc_hot ) {
snprintf ( header , sizeof ( header ) , " tjunction-max(C) " ) ;
snprintf ( value , sizeof ( value ) , " %d " , ctdp_level - > t_proc_hot ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-11-04 03:02:44 -08:00
}
2019-06-30 10:14:08 -07:00
2022-08-20 18:11:21 +08:00
for ( k = 0 ; k < trl_max_levels ; k + + ) {
2022-08-18 21:21:46 +08:00
if ( ! ctdp_level - > trl_ratios [ k ] [ 0 ] )
continue ;
2022-08-20 18:11:21 +08:00
snprintf ( header , sizeof ( header ) , " turbo-ratio-limits-%s " , isst_get_trl_level_name ( k ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , NULL ) ;
2019-06-30 10:14:08 -07:00
2019-11-04 03:02:44 -08:00
for ( j = 0 ; j < 8 ; + + j ) {
snprintf ( header , sizeof ( header ) , " bucket-%d " , j ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 3 , header , NULL ) ;
2019-06-30 10:14:08 -07:00
2019-11-04 03:02:44 -08:00
snprintf ( header , sizeof ( header ) , " core-count " ) ;
2022-08-20 18:11:21 +08:00
snprintf ( value , sizeof ( value ) , " %llu " , ( ctdp_level - > trl_cores > > ( j * 8 ) ) & 0xff ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 4 , header , value ) ;
2019-06-30 10:14:08 -07:00
2019-11-04 03:02:44 -08:00
snprintf ( header , sizeof ( header ) , " max-turbo-frequency(MHz) " ) ;
2022-08-20 18:44:59 +08:00
snprintf ( value , sizeof ( value ) , " %d " , ctdp_level - > trl_ratios [ k ] [ j ] * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 4 , header , value ) ;
2019-11-04 03:02:44 -08:00
}
2019-06-30 10:14:08 -07:00
}
2019-11-04 03:02:44 -08:00
2019-06-30 10:14:08 -07:00
if ( ctdp_level - > pbf_support )
2022-08-20 23:58:18 +08:00
_isst_pbf_display_information ( id , outf , i ,
2019-06-30 10:14:08 -07:00
& ctdp_level - > pbf_info ,
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
level + 2 ) ;
2019-06-30 10:14:08 -07:00
if ( ctdp_level - > fact_support )
2022-08-20 23:58:18 +08:00
_isst_fact_display_information ( id , outf , i , 0xff , 0xff ,
2019-06-30 10:14:08 -07:00
& ctdp_level - > fact_info ,
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
level + 2 ) ;
2019-06-30 10:14:08 -07:00
}
format_and_print ( outf , 1 , NULL , NULL ) ;
}
2020-03-05 14:45:22 -08:00
static int start ;
2019-06-30 10:14:08 -07:00
void isst_ctdp_display_information_start ( FILE * outf )
{
last_level = 0 ;
format_and_print ( outf , 0 , " start " , NULL ) ;
2020-03-05 14:45:22 -08:00
start = 1 ;
2019-06-30 10:14:08 -07:00
}
void isst_ctdp_display_information_end ( FILE * outf )
{
format_and_print ( outf , 0 , NULL , NULL ) ;
2020-03-05 14:45:22 -08:00
start = 0 ;
2019-06-30 10:14:08 -07:00
}
2022-08-20 23:58:18 +08:00
void isst_pbf_display_information ( struct isst_id * id , FILE * outf , int level ,
2019-06-30 10:14:08 -07:00
struct isst_pbf_info * pbf_info )
{
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
int _level ;
2022-08-20 23:58:18 +08:00
_level = print_package_info ( id , outf ) ;
_isst_pbf_display_information ( id , outf , level , pbf_info , _level + 1 ) ;
2019-06-30 10:14:08 -07:00
format_and_print ( outf , 1 , NULL , NULL ) ;
}
2022-08-20 23:58:18 +08:00
void isst_fact_display_information ( struct isst_id * id , FILE * outf , int level ,
2019-06-30 10:14:08 -07:00
int fact_bucket , int fact_avx ,
struct isst_fact_info * fact_info )
{
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
int _level ;
2022-08-20 23:58:18 +08:00
_level = print_package_info ( id , outf ) ;
_isst_fact_display_information ( id , outf , level , fact_bucket , fact_avx ,
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
fact_info , _level + 1 ) ;
2019-06-30 10:14:08 -07:00
format_and_print ( outf , 1 , NULL , NULL ) ;
}
2022-08-20 23:58:18 +08:00
void isst_clos_display_information ( struct isst_id * id , FILE * outf , int clos ,
2019-06-30 10:14:08 -07:00
struct isst_clos_config * clos_config )
{
char header [ 256 ] ;
char value [ 256 ] ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
int level ;
2019-06-30 10:14:08 -07:00
2022-08-20 23:58:18 +08:00
level = print_package_info ( id , outf ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " core-power " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 1 , header , NULL ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " clos " ) ;
snprintf ( value , sizeof ( value ) , " %d " , clos ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " epp " ) ;
snprintf ( value , sizeof ( value ) , " %d " , clos_config - > epp ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " clos-proportional-priority " ) ;
snprintf ( value , sizeof ( value ) , " %d " , clos_config - > clos_prop_prio ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " clos-min " ) ;
2022-08-20 18:44:59 +08:00
snprintf ( value , sizeof ( value ) , " %d MHz " , clos_config - > clos_min * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " clos-max " ) ;
2023-01-07 21:45:42 +08:00
if ( ( clos_config - > clos_max * isst_get_disp_freq_multiplier ( ) ) = = 25500 )
2020-03-05 14:45:31 -08:00
snprintf ( value , sizeof ( value ) , " Max Turbo frequency " ) ;
else
2022-08-20 18:44:59 +08:00
snprintf ( value , sizeof ( value ) , " %d MHz " , clos_config - > clos_max * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " clos-desired " ) ;
2022-08-20 18:44:59 +08:00
snprintf ( value , sizeof ( value ) , " %d MHz " , clos_config - > clos_desired * isst_get_disp_freq_multiplier ( ) ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level , NULL , NULL ) ;
2019-06-30 10:14:08 -07:00
}
2022-08-20 23:58:18 +08:00
void isst_clos_display_clos_information ( struct isst_id * id , FILE * outf ,
2020-03-05 14:45:14 -08:00
int clos_enable , int type ,
int state , int cap )
2019-09-14 12:45:47 -07:00
{
char header [ 256 ] ;
char value [ 256 ] ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
int level ;
2019-09-14 12:45:47 -07:00
2022-08-20 23:58:18 +08:00
level = print_package_info ( id , outf ) ;
2019-09-14 12:45:47 -07:00
snprintf ( header , sizeof ( header ) , " core-power " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 1 , header , NULL ) ;
2019-09-14 12:45:47 -07:00
2020-03-05 14:45:14 -08:00
snprintf ( header , sizeof ( header ) , " support-status " ) ;
if ( cap )
snprintf ( value , sizeof ( value ) , " supported " ) ;
else
snprintf ( value , sizeof ( value ) , " unsupported " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2020-03-05 14:45:14 -08:00
2019-09-14 12:45:47 -07:00
snprintf ( header , sizeof ( header ) , " enable-status " ) ;
2020-03-05 14:45:14 -08:00
if ( state )
snprintf ( value , sizeof ( value ) , " enabled " ) ;
else
snprintf ( value , sizeof ( value ) , " disabled " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2020-03-05 14:45:14 -08:00
snprintf ( header , sizeof ( header ) , " clos-enable-status " ) ;
2020-03-05 14:45:15 -08:00
if ( clos_enable )
snprintf ( value , sizeof ( value ) , " enabled " ) ;
else
snprintf ( value , sizeof ( value ) , " disabled " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-09-14 12:45:47 -07:00
snprintf ( header , sizeof ( header ) , " priority-type " ) ;
2020-03-05 14:45:15 -08:00
if ( type )
snprintf ( value , sizeof ( value ) , " ordered " ) ;
else
snprintf ( value , sizeof ( value ) , " proportional " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-09-14 12:45:47 -07:00
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level , NULL , NULL ) ;
2019-09-14 12:45:47 -07:00
}
2022-08-20 23:58:18 +08:00
void isst_clos_display_assoc_information ( struct isst_id * id , FILE * outf , int clos )
2019-09-14 12:45:45 -07:00
{
char header [ 256 ] ;
char value [ 256 ] ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
int level ;
2019-09-14 12:45:45 -07:00
2022-08-20 23:58:18 +08:00
level = print_package_info ( id , outf ) ;
2019-09-14 12:45:45 -07:00
snprintf ( header , sizeof ( header ) , " get-assoc " ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 1 , header , NULL ) ;
2019-09-14 12:45:45 -07:00
snprintf ( header , sizeof ( header ) , " clos " ) ;
snprintf ( value , sizeof ( value ) , " %d " , clos ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-09-14 12:45:45 -07:00
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level , NULL , NULL ) ;
2019-09-14 12:45:45 -07:00
}
2022-08-20 23:58:18 +08:00
void isst_display_result ( struct isst_id * id , FILE * outf , char * feature , char * cmd ,
2019-06-30 10:14:08 -07:00
int result )
{
char header [ 256 ] ;
char value [ 256 ] ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
int level = 3 ;
2022-08-18 01:34:55 +08:00
level = print_package_info ( id , outf ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " %s " , feature ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 1 , header , NULL ) ;
2019-06-30 10:14:08 -07:00
snprintf ( header , sizeof ( header ) , " %s " , cmd ) ;
2019-09-05 08:03:10 -04:00
if ( ! result )
snprintf ( value , sizeof ( value ) , " success " ) ;
else
snprintf ( value , sizeof ( value ) , " failed(error %d) " , result ) ;
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level + 2 , header , value ) ;
2019-06-30 10:14:08 -07:00
tools/power/x86/intel-speed-select: Avoid duplicate Package strings for json
For platforms where multiple packages/die, this makes "Package-" key
duplicate. To make unique, add die and cpu id to key name.
So "Package-0" key name will change to "Package-0-die-x:cpu-x".
For example:
$sudo ./intel-speed-select -f json perf-profile info
Intel(R) Speed Select Technology
Executing on CPU model:106[0x6a]
{
"package-0:die-0:cpu-0": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
...
...
"package-1:die-0:cpu-16": {
"perf-profile-level-0": {
"cpu-count": "32",
"enable-cpu-count": "32",
"enable-cpu-mask": "ffff0000,ffff0000",
...
...
For non json format, there is no change. Here when print_package_info()
is called, it will return the level to print for other information.
This level is used formatting. Also in some function duplicate code
was there to print package,die and CPU information. Replace all that
code with a call to print_package_info().
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-03-05 14:45:37 -08:00
format_and_print ( outf , level , NULL , NULL ) ;
2019-06-30 10:14:08 -07:00
}
2020-03-05 14:45:22 -08:00
void isst_display_error_info_message ( int error , char * msg , int arg_valid , int arg )
{
FILE * outf = get_output_file ( ) ;
static int error_index ;
char header [ 256 ] ;
char value [ 256 ] ;
if ( ! out_format_is_json ( ) ) {
if ( arg_valid )
snprintf ( value , sizeof ( value ) , " %s %d " , msg , arg ) ;
else
snprintf ( value , sizeof ( value ) , " %s " , msg ) ;
if ( error )
fprintf ( outf , " Error: %s \n " , value ) ;
else
fprintf ( outf , " Information: %s \n " , value ) ;
return ;
}
if ( ! start )
format_and_print ( outf , 0 , " start " , NULL ) ;
if ( error )
snprintf ( header , sizeof ( header ) , " Error%d " , error_index + + ) ;
else
snprintf ( header , sizeof ( header ) , " Information:%d " , error_index + + ) ;
format_and_print ( outf , 1 , header , NULL ) ;
snprintf ( header , sizeof ( header ) , " message " ) ;
if ( arg_valid )
snprintf ( value , sizeof ( value ) , " %s %d " , msg , arg ) ;
else
snprintf ( value , sizeof ( value ) , " %s " , msg ) ;
format_and_print ( outf , 2 , header , value ) ;
format_and_print ( outf , 1 , NULL , NULL ) ;
if ( ! start )
format_and_print ( outf , 0 , NULL , NULL ) ;
}
2020-12-22 01:33:55 -08:00
2022-08-20 23:58:18 +08:00
void isst_trl_display_information ( struct isst_id * id , FILE * outf , unsigned long long trl )
2020-12-22 01:33:55 -08:00
{
char header [ 256 ] ;
char value [ 256 ] ;
int level ;
2022-08-20 23:58:18 +08:00
level = print_package_info ( id , outf ) ;
2020-12-22 01:33:55 -08:00
snprintf ( header , sizeof ( header ) , " get-trl " ) ;
format_and_print ( outf , level + 1 , header , NULL ) ;
snprintf ( header , sizeof ( header ) , " trl " ) ;
snprintf ( value , sizeof ( value ) , " 0x%llx " , trl ) ;
format_and_print ( outf , level + 2 , header , value ) ;
format_and_print ( outf , level , NULL , NULL ) ;
}