tools/power/x86/intel-speed-select/isst-config.c

Source file repositories/reference/linux-study-clean/tools/power/x86/intel-speed-select/isst-config.c

File Facts

System
Linux kernel
Corpus path
tools/power/x86/intel-speed-select/isst-config.c
Extension
.c
Size
81377 bytes
Lines
3387
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: implementation source
Status
source implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

struct process_cmd_struct {
	char *feature;
	char *command;
	void (*process_fn)(int arg);
	int arg;
};

static const char *version_str = "v1.26";

static const int supported_api_ver = 3;
static struct isst_if_platform_info isst_platform_info;
static char *progname;
static int debug_flag;
static FILE *outf;

static int cpu_model;
static int cpu_stepping;
static int cpu_family;

#define MAX_CPUS_IN_ONE_REQ 512
static short max_target_cpus;
static unsigned short target_cpus[MAX_CPUS_IN_ONE_REQ];

static int topo_max_cpus;
static size_t present_cpumask_size;
static cpu_set_t *present_cpumask;
static size_t target_cpumask_size;
static cpu_set_t *target_cpumask;
static int tdp_level = 0xFF;
static int fact_bucket = 0xFF;
static int fact_avx = 0xFF;
static unsigned long long fact_trl;
static int out_format_json;
static int cmd_help;
static int force_online_offline;
static int auto_mode;
static int fact_enable_fail;
static int cgroupv2;
static int max_pkg_id;
static int max_die_id;
static int max_die_id_package_0;

/* clos related */
static int current_clos = -1;
static int clos_epp = -1;
static int clos_prop_prio = -1;
static int clos_min = -1;
static int clos_max = -1;
static int clos_desired = -1;
static int clos_priority_type;
static int cpu_0_cgroupv2;
static int cpu_0_workaround(int isolate);

struct _cpu_map {
	unsigned short core_id;
	unsigned short pkg_id;
	unsigned short die_id;
	unsigned short punit_id;
	unsigned short punit_cpu;
	unsigned short punit_cpu_core;
	unsigned short initialized;
};
struct _cpu_map *cpu_map;

struct cpu_topology {
	short cpu;
	short core_id;
	short pkg_id;
	short die_id;
};

static int read_only;

static void print_version(void)
{
	fprintf(outf, "Version %s\n", version_str);
}

static void check_privilege(void)
{
	if (!read_only)
		return;

	isst_display_error_info_message(1, "Insufficient privileges", 0, 0);
	isst_ctdp_display_information_end(outf);
	exit(1);
}

FILE *get_output_file(void)
{

Annotation

Implementation Notes