Lines Matching defs:int
61 unsigned int msr_num;
64 unsigned int width;
68 unsigned int flags;
209 int *fd_percpu;
210 int *fd_instr_count_percpu;
215 unsigned int model_orig;
217 unsigned int num_iterations;
218 unsigned int header_iterations;
219 unsigned int debug;
220 unsigned int quiet;
221 unsigned int shown;
222 unsigned int sums_need_wide_columns;
223 unsigned int rapl_joules;
224 unsigned int summary_only;
225 unsigned int list_header_only;
226 unsigned int dump_only;
227 unsigned int do_snb_cstates;
228 unsigned int do_knl_cstates;
229 unsigned int do_slm_cstates;
230 unsigned int use_c1_residency_msr;
231 unsigned int has_aperf;
232 unsigned int has_epb;
233 unsigned int has_turbo;
234 unsigned int is_hybrid;
235 unsigned int do_irtl_snb;
236 unsigned int do_irtl_hsw;
237 unsigned int units = 1000000; /* MHz etc */
238 unsigned int genuine_intel;
239 unsigned int authentic_amd;
240 unsigned int hygon_genuine;
241 unsigned int max_level, max_extended_level;
242 unsigned int has_invariant_tsc;
243 unsigned int do_nhm_platform_info;
244 unsigned int no_MSR_MISC_PWR_MGMT;
245 unsigned int aperf_mperf_multiplier = 1;
248 unsigned int has_base_hz;
250 unsigned int show_pkg_only;
251 unsigned int show_core_only;
253 unsigned int do_rapl;
254 unsigned int do_dts;
255 unsigned int do_ptm;
256 unsigned int do_ipc;
260 unsigned int gfx_cur_mhz;
261 unsigned int gfx_act_mhz;
262 unsigned int tj_max;
263 unsigned int tj_max_override;
264 int tcc_offset_bits;
268 unsigned int do_core_perf_limit_reasons;
269 unsigned int has_automatic_cstate_conversion;
270 unsigned int dis_cstate_prewake;
271 unsigned int do_gfx_perf_limit_reasons;
272 unsigned int do_ring_perf_limit_reasons;
273 unsigned int crystal_hz;
275 int base_cpu;
276 double discover_bclk(unsigned int family, unsigned int model);
277 unsigned int has_hwp; /* IA32_PM_ENABLE, IA32_HWP_CAPABILITIES */
279 unsigned int has_hwp_notify; /* IA32_HWP_INTERRUPT */
280 unsigned int has_hwp_activity_window; /* IA32_HWP_REQUEST[bits 41:32] */
281 unsigned int has_hwp_epp; /* IA32_HWP_REQUEST[bits 31:24] */
282 unsigned int has_hwp_pkg; /* IA32_HWP_REQUEST_PKG */
283 unsigned int has_misc_feature_control;
284 unsigned int first_counter_read = 1;
285 int ignore_stdin;
332 int backwards_count;
352 unsigned int smi_count;
353 unsigned int cpu_id;
354 unsigned int apic_id;
355 unsigned int x2apic_id;
356 unsigned int flags;
368 unsigned int core_temp_c;
369 unsigned int core_energy; /* MSR_CORE_ENERGY_STAT */
370 unsigned int core_id;
390 unsigned int gfx_mhz;
391 unsigned int gfx_act_mhz;
392 unsigned int package_id;
399 unsigned int pkg_temp_c;
400 unsigned int uncore_mhz;
438 int get_msr_sum(int cpu, off_t offset, unsigned long long *msr);
453 off_t idx_to_offset(int idx)
485 int offset_to_idx(off_t offset)
487 int idx;
515 int idx_valid(int idx)
536 unsigned int added_thread_counters;
537 unsigned int added_core_counters;
538 unsigned int added_package_counters;
551 int physical_package_id;
552 int die_id;
553 int logical_cpu_id;
554 int physical_node_id;
555 int logical_node_id; /* 0-based count within the package */
556 int physical_core_id;
557 int thread_id;
562 int num_packages;
563 int num_die;
564 int num_cpus;
565 int num_cores;
566 int max_cpu_num;
567 int max_node_num;
568 int nodes_per_pkg;
569 int cores_per_node;
570 int threads_per_core;
575 int *irq_column_2_cpu; /* /proc/interrupts column numbers */
576 int *irqs_per_cpu; /* indexed by cpu_num */
584 int cpu_is_not_present(int cpu)
594 int for_all_cpus(int (func) (struct thread_data *, struct core_data *, struct pkg_data *),
597 int retval, pkg_no, core_no, thread_no, node_no;
625 int cpu_migrate(int cpu)
635 int get_msr_fd(int cpu)
638 int fd;
655 static long perf_event_open(struct perf_event_attr *hw_event, pid_t pid, int cpu, int group_fd, unsigned long flags)
660 static int perf_instr_count_open(int cpu_num)
663 int fd;
680 int get_instr_count_fd(int cpu)
690 int get_msr(int cpu, off_t offset, unsigned long long *msr)
705 int deferred_add_index;
706 int deferred_skip_index;
762 unsigned int i;
832 int printed = 0;
1016 int dump_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
1018 int i;
1099 int format_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
1103 int i;
1106 int printed = 0;
1224 sprintf(outp, "%s0x%08x", (printed++ ? delim : ""), (unsigned int)t->counter[i]);
1272 sprintf(outp, "%s0x%08x", (printed++ ? delim : ""), (unsigned int)c->counter[i]);
1389 sprintf(outp, "%s0x%08x", (printed++ ? delim : ""), (unsigned int)p->counter[i]);
1433 static int count;
1451 int delta_package(struct pkg_data *new, struct pkg_data *old)
1453 int i;
1508 int i;
1528 int soft_c1_residency_display(int bic)
1539 int delta_thread(struct thread_data *new, struct thread_data *old, struct core_data *core_delta)
1541 int i;
1623 int delta_cpu(struct thread_data *t, struct core_data *c,
1626 int retval = 0;
1646 int i;
1717 int sum_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
1719 int i;
1827 int i;
1904 unsigned int low, high;
1931 int retval;
1945 int get_mp(int cpu, struct msr_counter *mp, unsigned long long *counterp)
1965 unsigned long long get_uncore_mhz(int package, int die)
1975 int get_epb(int cpu)
1979 int ret, epb = -1;
2004 unsigned int eax, ebx, ecx, edx;
2017 unsigned int topology_extensions;
2050 int get_core_throt_cnt(int cpu, unsigned long long *cnt)
2055 int ret;
2075 int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
2077 int cpu = t->cpu_id;
2079 int aperf_mperf_retry_count = 0;
2081 int i;
2367 int pkg_cstate_limit = PCLUKN;
2372 int nhm_pkg_cstate_limits[16] =
2377 int snb_pkg_cstate_limits[16] =
2382 int hsw_pkg_cstate_limits[16] =
2387 int slv_pkg_cstate_limits[16] =
2392 int amt_pkg_cstate_limits[16] =
2397 int phi_pkg_cstate_limits[16] =
2402 int glm_pkg_cstate_limits[16] =
2407 int skx_pkg_cstate_limits[16] =
2412 int icx_pkg_cstate_limits[16] =
2422 void prewake_cstate_probe(unsigned int family, unsigned int model);
2427 unsigned int ratio;
2453 unsigned int ratio;
2472 unsigned int ratio;
2512 int has_turbo_ratio_group_limits(int family, int model)
2534 static void dump_turbo_ratio_limits(int trl_msr_offset, int family, int model)
2537 int shift;
2551 unsigned int ratio, group_size;
2566 unsigned int ratio;
2605 const unsigned int buckets_no = 7;
2608 int delta_cores, delta_ratio;
2609 int i, b_nr;
2610 unsigned int cores[buckets_no];
2611 unsigned int ratio[buckets_no];
2673 (msr & (1 << 15)) ? "" : "UN", (unsigned int)msr & 0xF, pkg_cstate_limit_strings[pkg_cstate_limit]);
2691 fprintf(outf, " (base_ratio=%d)\n", (unsigned int)msr & 0xFF);
2696 fprintf(outf, "PKG_MIN_PWR_LVL1=%d ", (unsigned int)(msr >> 48) & 0x7FFF);
2697 fprintf(outf, "PKG_MAX_PWR_LVL1=%d ", (unsigned int)(msr >> 32) & 0x7FFF);
2698 fprintf(outf, "LVL1_RATIO=%d ", (unsigned int)(msr >> 16) & 0xFF);
2699 fprintf(outf, "PKG_TDP_LVL1=%d", (unsigned int)(msr) & 0x7FFF);
2706 fprintf(outf, "PKG_MIN_PWR_LVL2=%d ", (unsigned int)(msr >> 48) & 0x7FFF);
2707 fprintf(outf, "PKG_MAX_PWR_LVL2=%d ", (unsigned int)(msr >> 32) & 0x7FFF);
2708 fprintf(outf, "LVL2_RATIO=%d ", (unsigned int)(msr >> 16) & 0xFF);
2709 fprintf(outf, "PKG_TDP_LVL2=%d", (unsigned int)(msr) & 0x7FFF);
2716 fprintf(outf, "TDP_LEVEL=%d ", (unsigned int)(msr) & 0x3);
2717 fprintf(outf, " lock=%d", (unsigned int)(msr >> 31) & 1);
2722 fprintf(outf, "MAX_NON_TURBO_RATIO=%d", (unsigned int)(msr) & 0xFF);
2723 fprintf(outf, " lock=%d", (unsigned int)(msr >> 31) & 1);
2727 unsigned int irtl_time_units[] = { 1, 32, 1024, 32768, 1048576, 33554432, 0, 0 };
2770 int i;
2782 int i;
2825 * Parse a file containing a single int.
2829 int parse_int_file(const char *fmt, ...)
2834 int value;
2852 int cpu_is_first_core_in_package(int cpu)
2857 int get_physical_package_id(int cpu)
2862 int get_die_id(int cpu)
2867 int get_core_id(int cpu)
2874 int pkg, node, lnode, cpu, cpux;
2875 int cpu_count;
2912 int get_physical_node_id(struct cpu_topology *thiscpu)
2916 int i;
2917 int cpu = thiscpu->logical_cpu_id;
2930 int get_thread_siblings(struct cpu_topology *thiscpu)
2935 int so, shift, sib_core;
2936 int cpu = thiscpu->logical_cpu_id;
2937 int offset = topo.max_cpu_num + 1;
2939 int thread_id = 0;
2983 int for_all_cpus_2(int (func) (struct thread_data *, struct core_data *,
2989 int retval, pkg_no, node_no, core_no, thread_no;
3026 int for_all_proc_cpus(int (func) (int))
3029 int cpu_num;
3030 int retval;
3063 int base_cpu;
3084 int count_cpus(int cpu)
3092 int mark_cpu_present(int cpu)
3098 int init_thread_id(int cpu)
3111 int snapshot_proc_interrupts(void)
3114 int column, retval;
3123 int cpu_number;
3140 int column;
3150 int cpu_number, irq_count;
3175 int snapshot_gfx_rc6_ms(void)
3178 int retval;
3199 int snapshot_gfx_mhz(void)
3202 int retval;
3226 int snapshot_gfx_act_mhz(void)
3229 int retval;
3251 int snapshot_cpu_lpi_us(void)
3254 int retval;
3276 int snapshot_sys_lpi_us(void)
3279 int retval;
3300 int snapshot_proc_sysfs_files(void)
3324 int exit_requested;
3326 static void signal_handler(int signal)
3360 int retval;
3392 int get_msr_sum(int cpu, off_t offset, unsigned long long *msr)
3394 int ret, idx;
3417 static int update_msr_sum(struct thread_data *t, struct core_data *c, struct pkg_data *p)
3419 int i, ret;
3420 int cpu = t->cpu_id;
3506 int set_my_sched_priority(int priority)
3508 int retval;
3509 int original_priority;
3530 int retval;
3531 int restarted = 0;
3532 unsigned int done_iters = 0;
3630 int check_for_cap_sys_rawio(void)
3655 int do_exit = 0;
3696 int probe_nhm_msrs(unsigned int family, unsigned int model)
3699 unsigned int base_ratio;
3700 int *pkg_cstate_limits;
3784 int has_slv_msrs(unsigned int family, unsigned int model)
3801 int is_dnv(unsigned int family, unsigned int model)
3817 int is_bdx(unsigned int family, unsigned int model)
3833 int is_skx(unsigned int family, unsigned int model)
3849 int is_icx(unsigned int family, unsigned int model)
3865 int is_spr(unsigned int family, unsigned int model)
3881 int is_ehl(unsigned int family, unsigned int model)
3896 int is_jvl(unsigned int family, unsigned int model)
3911 int has_turbo_ratio_limit(unsigned int family, unsigned int model)
3929 int has_atom_turbo_ratio_limit(unsigned int family, unsigned int model)
3937 int has_ivt_turbo_ratio_limit(unsigned int family, unsigned int model)
3954 int has_hsw_turbo_ratio_limit(unsigned int family, unsigned int model)
3970 int has_knl_turbo_ratio_limit(unsigned int family, unsigned int model)
3986 int has_glm_turbo_ratio_limit(unsigned int family, unsigned int model)
4005 int has_config_tdp(unsigned int family, unsigned int model)
4040 void check_tcc_offset(int model)
4081 static void dump_turbo_ratio_info(unsigned int family, unsigned int model)
4109 static void dump_cstate_pstate_config_info(unsigned int family, unsigned int model)
4119 static int read_sysfs_int(char *path)
4122 int retval = -1;
4131 err(1, "%s: failed to read int from file", path);
4157 int i, j;
4174 int k, l;
4203 int state;
4251 int turbo;
4299 int print_epb(struct thread_data *t, struct core_data *c, struct pkg_data *p)
4302 int cpu, epb;
4348 int print_hwp(struct thread_data *t, struct core_data *c, struct pkg_data *p)
4351 int cpu;
4385 (unsigned int)HWP_HIGHEST_PERF(msr),
4386 (unsigned int)HWP_GUARANTEED_PERF(msr),
4387 (unsigned int)HWP_MOSTEFFICIENT_PERF(msr), (unsigned int)HWP_LOWEST_PERF(msr));
4395 (unsigned int)(((msr) >> 0) & 0xff),
4396 (unsigned int)(((msr) >> 8) & 0xff),
4397 (unsigned int)(((msr) >> 16) & 0xff),
4398 (unsigned int)(((msr) >> 24) & 0xff),
4399 (unsigned int)(((msr) >> 32) & 0xff3), (unsigned int)(((msr) >> 42) & 0x1));
4408 (unsigned int)(((msr) >> 0) & 0xff),
4409 (unsigned int)(((msr) >> 8) & 0xff),
4410 (unsigned int)(((msr) >> 16) & 0xff),
4411 (unsigned int)(((msr) >> 24) & 0xff), (unsigned int)(((msr) >> 32) & 0xff3));
4434 int print_perf_limit(struct thread_data *t, struct core_data *c, struct pkg_data *p)
4437 int cpu;
4528 double get_tdp_intel(unsigned int model)
4545 double get_tdp_amd(unsigned int family)
4557 static double rapl_dram_energy_units_probe(int model, double rapl_energy_units)
4573 void rapl_probe_intel(unsigned int family, unsigned int model)
4576 unsigned int time_unit;
4744 void rapl_probe_amd(unsigned int family, unsigned int model)
4747 unsigned int eax, ebx, ecx, edx;
4748 unsigned int has_rapl = 0;
4790 void rapl_probe(unsigned int family, unsigned int model)
4798 void perf_limit_reasons_probe(unsigned int family, unsigned int model)
4820 void automatic_cstate_conversion_probe(unsigned int family, unsigned int model)
4832 void prewake_cstate_probe(unsigned int family, unsigned int model)
4838 int print_thermal(struct thread_data *t, struct core_data *c, struct pkg_data *p)
4841 unsigned int dts, dts2;
4842 int cpu;
4878 unsigned int resolution;
4900 void print_power_limit_msr(int cpu, unsigned long long msr, char *label)
4912 int print_rapl(struct thread_data *t, struct core_data *c, struct pkg_data *p)
4916 int cpu;
5039 int has_snb_msrs(unsigned int family, unsigned int model)
5086 int has_c8910_msrs(unsigned int family, unsigned int model)
5115 int has_skl_msrs(unsigned int family, unsigned int model)
5131 int is_slm(unsigned int family, unsigned int model)
5147 int is_knl(unsigned int family, unsigned int model)
5162 int is_cnl(unsigned int family, unsigned int model)
5178 unsigned int get_aperf_mperf_multiplier(unsigned int family, unsigned int model)
5191 unsigned int i;
5210 double discover_bclk(unsigned int family, unsigned int model)
5220 int get_cpu_type(struct thread_data *t, struct core_data *c, struct pkg_data *p)
5222 unsigned int eax, ebx, ecx, edx;
5257 int set_temperature_target(struct thread_data *t, struct core_data *c, struct pkg_data *p)
5260 unsigned int tcc_default, tcc_offset;
5261 int cpu;
5412 unsigned int intel_model_duplicates(unsigned int model)
5473 int fd;
5474 int value;
5475 int retval;
5483 retval = read(fd, (void *)&value, sizeof(int));
5484 if (retval != sizeof(int)) {
5506 fd_instr_count_percpu = calloc(topo.max_cpu_num + 1, sizeof(int));
5515 unsigned int eax, ebx, ecx, edx;
5516 unsigned int fms, family, model, stepping, ecx_flags, edx_flags;
5559 (unsigned int)((ucode_patch >> 32) & 0xFFFFFFFF));
5632 int has_sgx;
5649 unsigned int eax_crystal;
5650 unsigned int ebx_tsc;
5689 unsigned int base_mhz, max_mhz, bus_mhz, edx;
5851 int dir_filter(const struct dirent *dirp)
5861 int i;
5862 int max_core_id = 0;
5863 int max_package_id = 0;
5864 int max_die_id = 0;
5865 int max_siblings = 0;
5916 int siblings;
5998 int i;
5999 int num_cores = topo.cores_per_node * topo.nodes_per_pkg * topo.num_packages;
6000 int num_threads = topo.threads_per_core * num_cores;
6033 void init_counter(struct thread_data *thread_base, struct core_data *core_base, struct pkg_data *pkg_base, int cpu_id)
6035 int pkg_id = cpus[cpu_id].physical_package_id;
6036 int node_id = cpus[cpu_id].logical_node_id;
6037 int core_id = cpus[cpu_id].physical_core_id;
6038 int thread_id = cpus[cpu_id].thread_id;
6064 int initialize_counters(int cpu_id)
6081 fd_percpu = calloc(topo.max_cpu_num + 1, sizeof(int));
6088 irq_column_2_cpu = calloc(topo.num_cpus, sizeof(int));
6092 irqs_per_cpu = calloc(topo.max_cpu_num + 1, sizeof(int));
6154 int fork_it(char **argv)
6157 int status;
6209 int get_and_dump_counters(void)
6211 int status;
6238 int ret;
6255 int add_counter(unsigned int msr_num, char *path, char *name,
6256 unsigned int width, enum counter_scope scope,
6257 enum counter_type type, enum counter_format format, int flags)
6314 int msr_num = 0;
6317 int width = 64;
6318 int fail = 0;
6417 int is_deferred_add(char *name)
6419 int i;
6427 int is_deferred_skip(char *name)
6429 int i;
6442 int state;
6512 unsigned int start, end;
6592 void cmdline(int argc, char **argv)
6594 int opt;
6595 int option_index = 0;
6721 int main(int argc, char **argv)