Home
last modified time | relevance | path

Searched refs:cpu (Results 1 – 25 of 329) sorted by relevance

12345678910>>...14

/tools/testing/selftests/cpu-hotplug/
Dcpu-on-off-test.sh26 if ! ls $SYSFS/devices/system/cpu/cpu* > /dev/null 2>&1; then
27 echo $msg cpu hotplug is not supported >&2
32 online_cpus=`cat $SYSFS/devices/system/cpu/online`
40 present_cpus=`cat $SYSFS/devices/system/cpu/present`
46 offline_cpus=`cat $SYSFS/devices/system/cpu/offline`
62 for cpu in $SYSFS/devices/system/cpu/cpu*; do
63 if [ -f $cpu/online ] && grep -q $state $cpu/online; then
64 echo ${cpu##/*/cpu}
81 grep -q 1 $SYSFS/devices/system/cpu/cpu$1/online
86 grep -q 0 $SYSFS/devices/system/cpu/cpu$1/online
[all …]
/tools/power/cpupower/lib/
Dcpufreq.h31 unsigned int cpu; member
57 unsigned long cpufreq_get_freq_kernel(unsigned int cpu);
59 unsigned long cpufreq_get_freq_hardware(unsigned int cpu);
61 #define cpufreq_get(cpu) cpufreq_get_freq_kernel(cpu); argument
68 unsigned long cpufreq_get_transition_latency(unsigned int cpu);
77 int cpufreq_get_hardware_limits(unsigned int cpu,
88 char *cpufreq_get_driver(unsigned int cpu);
100 struct cpufreq_policy *cpufreq_get_policy(unsigned int cpu);
114 *cpufreq_get_available_governors(unsigned int cpu);
128 *cpufreq_get_available_frequencies(unsigned int cpu);
[all …]
Dcpupower.c46 int cpupower_is_cpu_online(unsigned int cpu) in cpupower_is_cpu_online() argument
56 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u", cpu); in cpupower_is_cpu_online()
65 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/online", cpu); in cpupower_is_cpu_online()
89 static int sysfs_topology_read_file(unsigned int cpu, const char *fname, int *result) in sysfs_topology_read_file() argument
96 cpu, fname); in sysfs_topology_read_file()
117 else if (top1->cpu < top2->cpu) in __compare()
119 else if (top1->cpu > top2->cpu) in __compare()
133 int cpu, last_pkg, cpus = sysconf(_SC_NPROCESSORS_CONF); in get_cpu_topology() local
139 for (cpu = 0; cpu < cpus; cpu++) { in get_cpu_topology()
140 cpu_top->core_info[cpu].cpu = cpu; in get_cpu_topology()
[all …]
Dcpuidle.c29 unsigned int cpuidle_state_file_exists(unsigned int cpu, in cpuidle_state_file_exists() argument
38 cpu, idlestate, fname); in cpuidle_state_file_exists()
51 unsigned int cpuidle_state_read_file(unsigned int cpu, in cpuidle_state_read_file() argument
61 cpu, idlestate, fname); in cpuidle_state_read_file()
86 unsigned int cpuidle_state_write_file(unsigned int cpu, in cpuidle_state_write_file() argument
96 cpu, idlestate, fname); in cpuidle_state_write_file()
133 unsigned long long cpuidle_state_get_one_value(unsigned int cpu, in cpuidle_state_get_one_value() argument
145 len = cpuidle_state_read_file(cpu, idlestate, in cpuidle_state_get_one_value()
173 static char *cpuidle_state_get_one_string(unsigned int cpu, in cpuidle_state_get_one_string() argument
184 len = cpuidle_state_read_file(cpu, idlestate, in cpuidle_state_get_one_string()
[all …]
Dcpuidle.h5 int cpuidle_is_state_disabled(unsigned int cpu,
7 int cpuidle_state_disable(unsigned int cpu, unsigned int idlestate,
9 unsigned long cpuidle_state_latency(unsigned int cpu,
11 unsigned long cpuidle_state_usage(unsigned int cpu,
13 unsigned long long cpuidle_state_time(unsigned int cpu,
15 char *cpuidle_state_name(unsigned int cpu,
17 char *cpuidle_state_desc(unsigned int cpu,
19 unsigned int cpuidle_state_count(unsigned int cpu);
/tools/power/x86/intel-speed-select/
Disst-core.c9 int isst_write_pm_config(int cpu, int cp_state) in isst_write_pm_config() argument
19 ret = isst_send_mbox_command(cpu, WRITE_PM_CONFIG, PM_FEATURE, 0, req, in isst_write_pm_config()
24 debug_printf("cpu:%d WRITE_PM_CONFIG resp:%x\n", cpu, resp); in isst_write_pm_config()
29 int isst_read_pm_config(int cpu, int *cp_state, int *cp_cap) in isst_read_pm_config() argument
34 ret = isst_send_mbox_command(cpu, READ_PM_CONFIG, PM_FEATURE, 0, 0, in isst_read_pm_config()
39 debug_printf("cpu:%d READ_PM_CONFIG resp:%x\n", cpu, resp); in isst_read_pm_config()
47 int isst_get_ctdp_levels(int cpu, struct isst_pkg_ctdp *pkg_dev) in isst_get_ctdp_levels() argument
52 ret = isst_send_mbox_command(cpu, CONFIG_TDP, in isst_get_ctdp_levels()
63 debug_printf("cpu:%d CONFIG_TDP_GET_LEVELS_INFO resp:%x\n", cpu, resp); in isst_get_ctdp_levels()
74 int isst_get_ctdp_control(int cpu, int config_index, in isst_get_ctdp_control() argument
[all …]
Disst.h179 extern int get_physical_package_id(int cpu);
180 extern int get_physical_die_id(int cpu);
186 extern void set_cpu_mask_from_punit_coremask(int cpu,
192 extern int isst_send_mbox_command(unsigned int cpu, unsigned char command,
197 extern int isst_send_msr_command(unsigned int cpu, unsigned int command,
200 extern int isst_get_ctdp_levels(int cpu, struct isst_pkg_ctdp *pkg_dev);
201 extern int isst_get_ctdp_control(int cpu, int config_index,
203 extern int isst_get_coremask_info(int cpu, int config_index,
205 extern int isst_get_process_ctdp(int cpu, int tdp_level,
207 extern void isst_get_process_ctdp_complete(int cpu,
[all …]
/tools/perf/scripts/python/
Dstat-cpi.py10 def get_key(time, event, cpu, thread): argument
11 return "%d-%s-%d-%d" % (time, event, cpu, thread)
13 def store_key(time, cpu, thread): argument
17 if (cpu not in cpus):
18 cpus.append(cpu)
23 def store(time, event, cpu, thread, val, ena, run): argument
27 store_key(time, cpu, thread)
28 key = get_key(time, event, cpu, thread)
31 def get(time, event, cpu, thread): argument
32 key = get_key(time, event, cpu, thread)
[all …]
Dnetdev-times.py91 cpu = irq_list[0]['cpu']
105 (nsecs_secs(base_t), nsecs_nsecs(base_t)/1000, cpu))
232 def irq__softirq_entry(name, context, cpu, sec, nsec, pid, comm, callchain, vec): argument
235 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)
238 def irq__softirq_exit(name, context, cpu, sec, nsec, pid, comm, callchain, vec): argument
241 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)
244 def irq__softirq_raise(name, context, cpu, sec, nsec, pid, comm, callchain, vec): argument
247 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm, vec)
250 def irq__irq_handler_entry(name, context, cpu, sec, nsec, pid, comm, argument
252 event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
[all …]
/tools/power/cpupower/utils/idle_monitor/
Dmperf_monitor.c33 unsigned int cpu);
35 unsigned int cpu);
93 static int get_aperf_mperf(int cpu, unsigned long long *aval, in get_aperf_mperf() argument
106 if (bind_cpu(cpu)) in get_aperf_mperf()
124 ret = read_msr(cpu, MSR_APERF, aval); in get_aperf_mperf()
125 ret |= read_msr(cpu, MSR_MPERF, mval); in get_aperf_mperf()
130 static int mperf_init_stats(unsigned int cpu) in mperf_init_stats() argument
135 ret = get_aperf_mperf(cpu, &aval, &mval); in mperf_init_stats()
136 aperf_previous_count[cpu] = aval; in mperf_init_stats()
137 mperf_previous_count[cpu] = mval; in mperf_init_stats()
[all …]
Dhsw_ext_idle.c29 unsigned int cpu);
63 unsigned int cpu) in hsw_ext_get_count() argument
83 if (read_msr(cpu, msr, val)) in hsw_ext_get_count()
89 unsigned int cpu) in hsw_ext_get_count_percent() argument
93 if (!is_valid[cpu]) in hsw_ext_get_count_percent()
97 (current_count[id][cpu] - previous_count[id][cpu])) / in hsw_ext_get_count_percent()
101 hsw_ext_cstates[id].name, previous_count[id][cpu], in hsw_ext_get_count_percent()
102 current_count[id][cpu], cpu); in hsw_ext_get_count_percent()
107 current_count[id][cpu] - previous_count[id][cpu], in hsw_ext_get_count_percent()
108 *percent, cpu); in hsw_ext_get_count_percent()
[all …]
Dsnb_idle.c27 unsigned int cpu);
61 unsigned int cpu) in snb_get_count() argument
81 if (read_msr(cpu, msr, val)) in snb_get_count()
87 unsigned int cpu) in snb_get_count_percent() argument
91 if (!is_valid[cpu]) in snb_get_count_percent()
95 (current_count[id][cpu] - previous_count[id][cpu])) / in snb_get_count_percent()
99 snb_cstates[id].name, previous_count[id][cpu], in snb_get_count_percent()
100 current_count[id][cpu], cpu); in snb_get_count_percent()
105 current_count[id][cpu] - previous_count[id][cpu], in snb_get_count_percent()
106 *percent, cpu); in snb_get_count_percent()
[all …]
Dnhm_idle.c30 unsigned int cpu);
72 unsigned int cpu) in nhm_get_count() argument
95 if (read_msr(cpu, msr, val)) in nhm_get_count()
102 unsigned int cpu) in nhm_get_count_percent() argument
106 if (!is_valid[cpu]) in nhm_get_count_percent()
110 (current_count[id][cpu] - previous_count[id][cpu])) / in nhm_get_count_percent()
114 nhm_cstates[id].name, previous_count[id][cpu], in nhm_get_count_percent()
115 current_count[id][cpu], cpu); in nhm_get_count_percent()
120 current_count[id][cpu] - previous_count[id][cpu], in nhm_get_count_percent()
121 *percent, cpu); in nhm_get_count_percent()
[all …]
Dcpuidle_sysfs.c26 unsigned int cpu) in cpuidle_get_count_percent() argument
28 unsigned long long statediff = current_count[cpu][id] in cpuidle_get_count_percent()
29 - previous_count[cpu][id]; in cpuidle_get_count_percent()
31 cpuidle_cstates[id].name, timediff, *percent, cpu); in cpuidle_get_count_percent()
39 cpuidle_cstates[id].name, timediff, statediff, *percent, cpu); in cpuidle_get_count_percent()
46 int cpu, state; in cpuidle_start() local
48 for (cpu = 0; cpu < cpu_count; cpu++) { in cpuidle_start()
51 previous_count[cpu][state] = in cpuidle_start()
52 cpuidle_state_time(cpu, state); in cpuidle_start()
54 cpu, state, previous_count[cpu][state]); in cpuidle_start()
[all …]
/tools/power/cpupower/utils/
Dcpufreq-info.c58 unsigned int cpu, nr_cpus; in proc_cpufreq_output() local
67 for (cpu = 0; cpu < nr_cpus; cpu++) { in proc_cpufreq_output()
68 policy = cpufreq_get_policy(cpu); in proc_cpufreq_output()
72 if (cpufreq_get_hardware_limits(cpu, &min, &max)) { in proc_cpufreq_output()
79 cpu , policy->min, max ? min_pctg : 0, policy->max, in proc_cpufreq_output()
163 static int get_boost_mode_x86(unsigned int cpu) in get_boost_mode_x86() argument
169 ret = cpufreq_has_boost_support(cpu, &support, &active, &b_states); in get_boost_mode_x86()
172 " on CPU %d -- are you root?\n"), cpu); in get_boost_mode_x86()
189 ret = decode_pstates(cpu, cpupower_cpu_info.family, b_states, in get_boost_mode_x86()
216 intel_turbo_ratio = msr_intel_get_turbo_ratio(cpu); in get_boost_mode_x86()
[all …]
Dcpuidle-set.c31 unsigned int cpu = 0, idlestate = 0, idlestates = 0; in cmd_idle_set() local
102 for (cpu = bitmask_first(cpus_chosen); in cmd_idle_set()
103 cpu <= bitmask_last(cpus_chosen); cpu++) { in cmd_idle_set()
105 if (!bitmask_isbitset(cpus_chosen, cpu)) in cmd_idle_set()
108 if (cpupower_is_cpu_online(cpu) != 1) in cmd_idle_set()
111 idlestates = cpuidle_state_count(cpu); in cmd_idle_set()
117 ret = cpuidle_state_disable(cpu, idlestate, 1); in cmd_idle_set()
119 printf(_("Idlestate %u disabled on CPU %u\n"), idlestate, cpu); in cmd_idle_set()
122 idlestate, cpu); in cmd_idle_set()
127 idlestate, cpu); in cmd_idle_set()
[all …]
Dcpuidle-info.c23 static void cpuidle_cpu_output(unsigned int cpu, int verbose) in cpuidle_cpu_output() argument
28 idlestates = cpuidle_state_count(cpu); in cpuidle_cpu_output()
30 printf(_("CPU %u: No idle states\n"), cpu); in cpuidle_cpu_output()
37 tmp = cpuidle_state_name(cpu, idlestate); in cpuidle_cpu_output()
49 int disabled = cpuidle_is_state_disabled(cpu, idlestate); in cpuidle_cpu_output()
53 tmp = cpuidle_state_name(cpu, idlestate); in cpuidle_cpu_output()
59 tmp = cpuidle_state_desc(cpu, idlestate); in cpuidle_cpu_output()
66 cpuidle_state_latency(cpu, idlestate)); in cpuidle_cpu_output()
68 cpuidle_state_usage(cpu, idlestate)); in cpuidle_cpu_output()
70 cpuidle_state_time(cpu, idlestate)); in cpuidle_cpu_output()
[all …]
/tools/perf/tests/
Dopenat-syscall-all-cpus.c25 int err = -1, fd, cpu; in test__openat_syscall_event_on_all_cpus() local
61 for (cpu = 0; cpu < cpus->nr; ++cpu) { in test__openat_syscall_event_on_all_cpus()
62 unsigned int ncalls = nr_openat_calls + cpu; in test__openat_syscall_event_on_all_cpus()
69 if (cpus->map[cpu] >= CPU_SETSIZE) { in test__openat_syscall_event_on_all_cpus()
70 pr_debug("Ignoring CPU %d\n", cpus->map[cpu]); in test__openat_syscall_event_on_all_cpus()
74 CPU_SET(cpus->map[cpu], &cpu_set); in test__openat_syscall_event_on_all_cpus()
77 cpus->map[cpu], in test__openat_syscall_event_on_all_cpus()
85 CPU_CLR(cpus->map[cpu], &cpu_set); in test__openat_syscall_event_on_all_cpus()
100 for (cpu = 0; cpu < cpus->nr; ++cpu) { in test__openat_syscall_event_on_all_cpus()
103 if (cpus->map[cpu] >= CPU_SETSIZE) in test__openat_syscall_event_on_all_cpus()
[all …]
/tools/power/cpupower/utils/helpers/
Dsysfs.h11 extern unsigned int sysfs_idlestate_file_exists(unsigned int cpu,
15 extern int sysfs_is_cpu_online(unsigned int cpu);
17 extern int sysfs_is_idlestate_disabled(unsigned int cpu,
19 extern int sysfs_idlestate_disable(unsigned int cpu, unsigned int idlestate,
21 extern unsigned long sysfs_get_idlestate_latency(unsigned int cpu,
23 extern unsigned long sysfs_get_idlestate_usage(unsigned int cpu,
25 extern unsigned long long sysfs_get_idlestate_time(unsigned int cpu,
27 extern char *sysfs_get_idlestate_name(unsigned int cpu,
29 extern char *sysfs_get_idlestate_desc(unsigned int cpu,
31 extern unsigned int sysfs_get_idlestate_count(unsigned int cpu);
Dsysfs.c47 int sysfs_is_cpu_online(unsigned int cpu) in sysfs_is_cpu_online() argument
57 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u", cpu); in sysfs_is_cpu_online()
66 snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/online", cpu); in sysfs_is_cpu_online()
103 unsigned int sysfs_idlestate_file_exists(unsigned int cpu, in sysfs_idlestate_file_exists() argument
112 cpu, idlestate, fname); in sysfs_idlestate_file_exists()
124 unsigned int sysfs_idlestate_read_file(unsigned int cpu, unsigned int idlestate, in sysfs_idlestate_read_file() argument
132 cpu, idlestate, fname); in sysfs_idlestate_read_file()
157 unsigned int sysfs_idlestate_write_file(unsigned int cpu, in sysfs_idlestate_write_file() argument
167 cpu, idlestate, fname); in sysfs_idlestate_write_file()
203 static unsigned long long sysfs_idlestate_get_one_value(unsigned int cpu, in sysfs_idlestate_get_one_value() argument
[all …]
/tools/power/x86/x86_energy_perf_policy/
Dx86_energy_perf_policy.c361 int cpu; in validate_cpu_selected_set() local
366 for (cpu = 0; cpu <= max_cpu_num; ++cpu) { in validate_cpu_selected_set()
367 if (CPU_ISSET_S(cpu, cpu_setsize, cpu_selected_set)) in validate_cpu_selected_set()
368 if (!CPU_ISSET_S(cpu, cpu_setsize, cpu_present_set)) in validate_cpu_selected_set()
369 errx(1, "Requested cpu% is not present", cpu); in validate_cpu_selected_set()
376 int cpu = 0; in parse_cmdline_cpu() local
402 while (cpu <= end_cpu) { in parse_cmdline_cpu()
403 if (cpu > max_cpu_num) in parse_cmdline_cpu()
404 errx(1, "Requested cpu%d exceeds max cpu%d", cpu, max_cpu_num); in parse_cmdline_cpu()
405 CPU_SET_S(cpu, cpu_setsize, cpu_selected_set); in parse_cmdline_cpu()
[all …]
/tools/perf/util/
Dcpumap.c35 if (cpus->cpu[i] == (u16) -1) in cpu_map__from_entries()
38 map->map[i] = (int) cpus->cpu[i]; in cpu_map__from_entries()
54 int cpu, i = 0; in cpu_map__from_mask() local
56 for_each_set_bit(cpu, mask->mask, nbits) in cpu_map__from_mask()
57 map->map[i++] = cpu; in cpu_map__from_mask()
98 static int cpu__get_topology_int(int cpu, const char *name, int *value) in cpu__get_topology_int() argument
103 "devices/system/cpu/cpu%d/topology/%s", cpu, name); in cpu__get_topology_int()
108 int cpu_map__get_socket_id(int cpu) in cpu_map__get_socket_id() argument
110 int value, ret = cpu__get_topology_int(cpu, "physical_package_id", &value); in cpu_map__get_socket_id()
116 int cpu; in cpu_map__get_socket() local
[all …]
Dstat-shadow.c30 int cpu; member
44 if (a->cpu != b->cpu) in saved_value_cmp()
45 return a->cpu - b->cpu; in saved_value_cmp()
99 int cpu, in saved_value_lookup() argument
108 .cpu = cpu, in saved_value_lookup()
196 int ctx, int cpu, u64 count) in update_runtime_stat() argument
198 struct saved_value *v = saved_value_lookup(NULL, cpu, true, in update_runtime_stat()
211 int cpu, struct runtime_stat *st) in perf_stat__update_shadow_stats() argument
220 update_runtime_stat(st, STAT_NSECS, 0, cpu, count_ns); in perf_stat__update_shadow_stats()
222 update_runtime_stat(st, STAT_CYCLES, ctx, cpu, count); in perf_stat__update_shadow_stats()
[all …]
/tools/power/cpupower/debug/i386/
Dcentrino-decode.c28 static int rdmsr(unsigned int cpu, unsigned int msr, in rdmsr() argument
38 if (cpu > MCPU) in rdmsr()
41 sprintf(file, "/dev/cpu/%d/msr", cpu); in rdmsr()
75 static int decode_live(unsigned int cpu) in decode_live() argument
80 err = rdmsr(cpu, MSR_IA32_PERF_STATUS, &lo, &hi); in decode_live()
83 printf("can't get MSR_IA32_PERF_STATUS for cpu %d\n", cpu); in decode_live()
96 unsigned int cpu, mode = 0; in main() local
99 cpu = 0; in main()
101 cpu = strtoul(argv[1], NULL, 0); in main()
102 if (cpu >= MCPU) in main()
[all …]
/tools/lib/perf/
Devsel.c47 int cpu, thread; in perf_evsel__alloc_fd() local
48 for (cpu = 0; cpu < ncpus; cpu++) { in perf_evsel__alloc_fd()
50 FD(evsel, cpu, thread) = -1; in perf_evsel__alloc_fd()
60 pid_t pid, int cpu, int group_fd, in sys_perf_event_open() argument
63 return syscall(__NR_perf_event_open, attr, pid, cpu, group_fd, flags); in sys_perf_event_open()
69 int cpu, thread, err = 0; in perf_evsel__open() local
99 for (cpu = 0; cpu < cpus->nr; cpu++) { in perf_evsel__open()
105 cpus->map[cpu], -1, 0); in perf_evsel__open()
110 FD(evsel, cpu, thread) = fd; in perf_evsel__open()
117 static void perf_evsel__close_fd_cpu(struct perf_evsel *evsel, int cpu) in perf_evsel__close_fd_cpu() argument
[all …]

12345678910>>...14