void disable_turbo_mode(int argc, char *argv[]) { int cpuid = -1; if ( argc > 0 && sscanf(argv[0], "%d", &cpuid) != 1 ) cpuid = -1; if ( cpuid >= max_cpu_nr ) cpuid = -1; if ( cpuid < 0 ) { /* disable turbo modes on all cpus, * only make effects on dbs governor */ int i; for ( i = 0; i < max_cpu_nr; i++ ) xc_disable_turbo(xc_handle, i); } else xc_disable_turbo(xc_handle, cpuid); }
void disable_turbo_mode(int argc, char *argv[]) { int cpuid = -1; if ( argc > 0 ) parse_cpuid(argv[0], &cpuid); if ( cpuid < 0 ) { /* disable turbo modes on all cpus, * only make effects on dbs governor */ int i; for ( i = 0; i < max_cpu_nr; i++ ) if ( xc_disable_turbo(xc_handle, i) ) fprintf(stderr, "[CPU%d] failed to disable turbo mode (%d - %s)\n", i, errno, strerror(errno)); } else if ( xc_disable_turbo(xc_handle, cpuid) ) fprintf(stderr, "failed to disable turbo mode (%d - %s)\n", errno, strerror(errno)); }