Commit b510b541 authored by Dominik Brodowski's avatar Dominik Brodowski

cpupowerutils: idle_monitor - ConfigStyle bugfixes

Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 6c2b8185
...@@ -104,7 +104,7 @@ static int amd_fam14h_get_pci_info(struct cstate *state, ...@@ -104,7 +104,7 @@ static int amd_fam14h_get_pci_info(struct cstate *state,
unsigned int *enable_bit, unsigned int *enable_bit,
unsigned int cpu) unsigned int cpu)
{ {
switch(state->id) { switch (state->id) {
case NON_PC0: case NON_PC0:
*enable_bit = PCI_NON_PC0_ENABLE_BIT; *enable_bit = PCI_NON_PC0_ENABLE_BIT;
*pci_offset = PCI_NON_PC0_OFFSET; *pci_offset = PCI_NON_PC0_OFFSET;
...@@ -236,10 +236,9 @@ static int amd_fam14h_start(void) ...@@ -236,10 +236,9 @@ static int amd_fam14h_start(void)
int num, cpu; int num, cpu;
clock_gettime(CLOCK_REALTIME, &start_time); clock_gettime(CLOCK_REALTIME, &start_time);
for (num = 0; num < AMD_FAM14H_STATE_NUM; num++) { for (num = 0; num < AMD_FAM14H_STATE_NUM; num++) {
for (cpu = 0; cpu < cpu_count; cpu++) { for (cpu = 0; cpu < cpu_count; cpu++)
amd_fam14h_init(&amd_fam14h_cstates[num], cpu); amd_fam14h_init(&amd_fam14h_cstates[num], cpu);
} }
}
#ifdef DEBUG #ifdef DEBUG
clock_gettime(CLOCK_REALTIME, &dbg_time); clock_gettime(CLOCK_REALTIME, &dbg_time);
dbg_timediff = timespec_diff_us(start_time, dbg_time); dbg_timediff = timespec_diff_us(start_time, dbg_time);
...@@ -257,10 +256,9 @@ static int amd_fam14h_stop(void) ...@@ -257,10 +256,9 @@ static int amd_fam14h_stop(void)
clock_gettime(CLOCK_REALTIME, &end_time); clock_gettime(CLOCK_REALTIME, &end_time);
for (num = 0; num < AMD_FAM14H_STATE_NUM; num++) { for (num = 0; num < AMD_FAM14H_STATE_NUM; num++) {
for (cpu = 0; cpu < cpu_count; cpu++) { for (cpu = 0; cpu < cpu_count; cpu++)
amd_fam14h_disable(&amd_fam14h_cstates[num], cpu); amd_fam14h_disable(&amd_fam14h_cstates[num], cpu);
} }
}
#ifdef DEBUG #ifdef DEBUG
clock_gettime(CLOCK_REALTIME, &dbg_time); clock_gettime(CLOCK_REALTIME, &dbg_time);
dbg_timediff = timespec_diff_us(end_time, dbg_time); dbg_timediff = timespec_diff_us(end_time, dbg_time);
...@@ -281,8 +279,8 @@ static int is_nbp1_capable(void) ...@@ -281,8 +279,8 @@ static int is_nbp1_capable(void)
return val & (1 << 31); return val & (1 << 31);
} }
struct cpuidle_monitor* amd_fam14h_register(void) { struct cpuidle_monitor *amd_fam14h_register(void)
{
int num; int num;
if (cpupower_cpu_info.vendor != X86_VENDOR_AMD) if (cpupower_cpu_info.vendor != X86_VENDOR_AMD)
...@@ -299,9 +297,9 @@ struct cpuidle_monitor* amd_fam14h_register(void) { ...@@ -299,9 +297,9 @@ struct cpuidle_monitor* amd_fam14h_register(void) {
/* We do not alloc for nbp1 machine wide counter */ /* We do not alloc for nbp1 machine wide counter */
for (num = 0; num < AMD_FAM14H_STATE_NUM - 1; num++) { for (num = 0; num < AMD_FAM14H_STATE_NUM - 1; num++) {
previous_count[num] = calloc (cpu_count, previous_count[num] = calloc(cpu_count,
sizeof(unsigned long long)); sizeof(unsigned long long));
current_count[num] = calloc (cpu_count, current_count[num] = calloc(cpu_count,
sizeof(unsigned long long)); sizeof(unsigned long long));
} }
......
...@@ -55,7 +55,6 @@ static int cpuidle_start(void) ...@@ -55,7 +55,6 @@ static int cpuidle_start(void)
dprint("CPU %d - State: %d - Val: %llu\n", dprint("CPU %d - State: %d - Val: %llu\n",
cpu, state, previous_count[cpu][state]); cpu, state, previous_count[cpu][state]);
} }
}; };
return 0; return 0;
} }
...@@ -83,40 +82,51 @@ void fix_up_intel_idle_driver_name(char *tmp, int num) ...@@ -83,40 +82,51 @@ void fix_up_intel_idle_driver_name(char *tmp, int num)
{ {
/* fix up cpuidle name for intel idle driver */ /* fix up cpuidle name for intel idle driver */
if (!strncmp(tmp, "NHM-", 4)) { if (!strncmp(tmp, "NHM-", 4)) {
switch(num) { switch (num) {
case 1: strcpy(tmp, "C1"); case 1:
strcpy(tmp, "C1");
break; break;
case 2: strcpy(tmp, "C3"); case 2:
strcpy(tmp, "C3");
break; break;
case 3: strcpy(tmp, "C6"); case 3:
strcpy(tmp, "C6");
break; break;
} }
} else if (!strncmp(tmp, "SNB-", 4)) { } else if (!strncmp(tmp, "SNB-", 4)) {
switch(num) { switch (num) {
case 1: strcpy(tmp, "C1"); case 1:
strcpy(tmp, "C1");
break; break;
case 2: strcpy(tmp, "C3"); case 2:
strcpy(tmp, "C3");
break; break;
case 3: strcpy(tmp, "C6"); case 3:
strcpy(tmp, "C6");
break; break;
case 4: strcpy(tmp, "C7"); case 4:
strcpy(tmp, "C7");
break; break;
} }
} else if (!strncmp(tmp, "ATM-", 4)) { } else if (!strncmp(tmp, "ATM-", 4)) {
switch(num) { switch (num) {
case 1: strcpy(tmp, "C1"); case 1:
strcpy(tmp, "C1");
break; break;
case 2: strcpy(tmp, "C2"); case 2:
strcpy(tmp, "C2");
break; break;
case 3: strcpy(tmp, "C4"); case 3:
strcpy(tmp, "C4");
break; break;
case 4: strcpy(tmp, "C6"); case 4:
strcpy(tmp, "C6");
break; break;
} }
} }
} }
static struct cpuidle_monitor* cpuidle_register(void) static struct cpuidle_monitor *cpuidle_register(void)
{ {
int num; int num;
char *tmp; char *tmp;
...@@ -127,7 +137,7 @@ static struct cpuidle_monitor* cpuidle_register(void) ...@@ -127,7 +137,7 @@ static struct cpuidle_monitor* cpuidle_register(void)
if (cpuidle_sysfs_monitor.hw_states_num == 0) if (cpuidle_sysfs_monitor.hw_states_num == 0)
return NULL; return NULL;
for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num ++) { for (num = 0; num < cpuidle_sysfs_monitor.hw_states_num; num++) {
tmp = sysfs_get_idlestate_name(0, num); tmp = sysfs_get_idlestate_name(0, num);
if (tmp == NULL) if (tmp == NULL)
continue; continue;
...@@ -144,16 +154,17 @@ static struct cpuidle_monitor* cpuidle_register(void) ...@@ -144,16 +154,17 @@ static struct cpuidle_monitor* cpuidle_register(void)
cpuidle_cstates[num].range = RANGE_THREAD; cpuidle_cstates[num].range = RANGE_THREAD;
cpuidle_cstates[num].id = num; cpuidle_cstates[num].id = num;
cpuidle_cstates[num].get_count_percent = cpuidle_get_count_percent; cpuidle_cstates[num].get_count_percent =
cpuidle_get_count_percent;
}; };
/* Free this at program termination */ /* Free this at program termination */
previous_count = malloc(sizeof (long long*) * cpu_count); previous_count = malloc(sizeof(long long *) * cpu_count);
current_count = malloc(sizeof (long long*) * cpu_count); current_count = malloc(sizeof(long long *) * cpu_count);
for (num = 0; num < cpu_count; num++) { for (num = 0; num < cpu_count; num++) {
previous_count[num] = malloc (sizeof(long long) * previous_count[num] = malloc(sizeof(long long) *
cpuidle_sysfs_monitor.hw_states_num); cpuidle_sysfs_monitor.hw_states_num);
current_count[num] = malloc (sizeof(long long) * current_count[num] = malloc(sizeof(long long) *
cpuidle_sysfs_monitor.hw_states_num); cpuidle_sysfs_monitor.hw_states_num);
} }
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
/* Define pointers to all monitors. */ /* Define pointers to all monitors. */
#define DEF(x) & x ## _monitor , #define DEF(x) & x ## _monitor ,
struct cpuidle_monitor * all_monitors[] = { struct cpuidle_monitor *all_monitors[] = {
#include "idle_monitors.def" #include "idle_monitors.def"
0 0
}; };
...@@ -107,7 +107,7 @@ void print_header(int topology_depth) ...@@ -107,7 +107,7 @@ void print_header(int topology_depth)
- 1; - 1;
if (mon != 0) { if (mon != 0) {
printf("|| "); printf("|| ");
need_len --; need_len--;
} }
sprintf(buf, "%s", monitors[mon]->name); sprintf(buf, "%s", monitors[mon]->name);
fill_string_with_spaces(buf, need_len); fill_string_with_spaces(buf, need_len);
...@@ -169,26 +169,24 @@ void print_results(int topology_depth, int cpu) ...@@ -169,26 +169,24 @@ void print_results(int topology_depth, int cpu)
if (s.get_count_percent) { if (s.get_count_percent) {
ret = s.get_count_percent(s.id, &percent, ret = s.get_count_percent(s.id, &percent,
cpu_top.core_info[cpu].cpu); cpu_top.core_info[cpu].cpu);
if (ret) { if (ret)
printf("******"); printf("******");
} else if (percent >= 100.0) else if (percent >= 100.0)
printf("%6.1f", percent); printf("%6.1f", percent);
else else
printf("%6.2f", percent); printf("%6.2f", percent);
} } else if (s.get_count) {
else if (s.get_count) {
ret = s.get_count(s.id, &result, ret = s.get_count(s.id, &result,
cpu_top.core_info[cpu].cpu); cpu_top.core_info[cpu].cpu);
if (ret) { if (ret)
printf("******"); printf("******");
} else else
printf("%6llu", result); printf("%6llu", result);
} } else {
else {
printf(_("Monitor %s, Counter %s has no count " printf(_("Monitor %s, Counter %s has no count "
"function. Implementation error\n"), "function. Implementation error\n"),
monitors[mon]->name, s.name); monitors[mon]->name, s.name);
exit (EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
} }
...@@ -211,7 +209,7 @@ void print_results(int topology_depth, int cpu) ...@@ -211,7 +209,7 @@ void print_results(int topology_depth, int cpu)
* Monitors get sorted in the same order the user passes them * Monitors get sorted in the same order the user passes them
*/ */
static void parse_monitor_param(char* param) static void parse_monitor_param(char *param)
{ {
unsigned int num; unsigned int num;
int mon, hits = 0; int mon, hits = 0;
...@@ -219,7 +217,7 @@ static void parse_monitor_param(char* param) ...@@ -219,7 +217,7 @@ static void parse_monitor_param(char* param)
struct cpuidle_monitor *tmp_mons[MONITORS_MAX]; struct cpuidle_monitor *tmp_mons[MONITORS_MAX];
for (mon = 0; mon < MONITORS_MAX;mon++, tmp = NULL) { for (mon = 0; mon < MONITORS_MAX; mon++, tmp = NULL) {
token = strtok(tmp, ","); token = strtok(tmp, ",");
if (token == NULL) if (token == NULL)
break; break;
...@@ -244,18 +242,21 @@ static void parse_monitor_param(char* param) ...@@ -244,18 +242,21 @@ static void parse_monitor_param(char* param)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
/* Override detected/registerd monitors array with requested one */ /* Override detected/registerd monitors array with requested one */
memcpy(monitors, tmp_mons, sizeof(struct cpuidle_monitor*) * MONITORS_MAX); memcpy(monitors, tmp_mons,
sizeof(struct cpuidle_monitor *) * MONITORS_MAX);
avail_monitors = hits; avail_monitors = hits;
} }
void list_monitors(void) { void list_monitors(void)
{
unsigned int mon; unsigned int mon;
int state; int state;
cstate_t s; cstate_t s;
for (mon = 0; mon < avail_monitors; mon++) { for (mon = 0; mon < avail_monitors; mon++) {
printf(_("Monitor \"%s\" (%d states) - Might overflow after %u " printf(_("Monitor \"%s\" (%d states) - Might overflow after %u "
"s\n"), monitors[mon]->name, monitors[mon]->hw_states_num, "s\n"),
monitors[mon]->name, monitors[mon]->hw_states_num,
monitors[mon]->overflow_s); monitors[mon]->overflow_s);
for (state = 0; state < monitors[mon]->hw_states_num; state++) { for (state = 0; state < monitors[mon]->hw_states_num; state++) {
...@@ -308,7 +309,8 @@ int fork_it(char **argv) ...@@ -308,7 +309,8 @@ int fork_it(char **argv)
timediff = timespec_diff_us(start, end); timediff = timespec_diff_us(start, end);
if (WIFEXITED(status)) if (WIFEXITED(status))
printf(_("%s took %.5f seconds and exited with status %d\n"), printf(_("%s took %.5f seconds and exited with status %d\n"),
argv[0], timediff / (1000.0 * 1000), WEXITSTATUS(status)); argv[0], timediff / (1000.0 * 1000),
WEXITSTATUS(status));
return 0; return 0;
} }
...@@ -322,9 +324,9 @@ int do_interval_measure(int i) ...@@ -322,9 +324,9 @@ int do_interval_measure(int i)
monitors[num]->start(); monitors[num]->start();
} }
sleep(i); sleep(i);
for (num = 0; num < avail_monitors; num++) { for (num = 0; num < avail_monitors; num++)
monitors[num]->stop(); monitors[num]->stop();
}
return 0; return 0;
} }
...@@ -438,9 +440,9 @@ int cmd_monitor(int argc, char **argv) ...@@ -438,9 +440,9 @@ int cmd_monitor(int argc, char **argv)
print_results(1, cpu); print_results(1, cpu);
} }
for (num = 0; num < avail_monitors; num++) { for (num = 0; num < avail_monitors; num++)
monitors[num]->unregister(); monitors[num]->unregister();
}
cpu_topology_release(cpu_top); cpu_topology_release(cpu_top);
return 0; return 0;
} }
...@@ -145,8 +145,8 @@ static int mperf_get_count_percent(unsigned int id, double *percent, ...@@ -145,8 +145,8 @@ static int mperf_get_count_percent(unsigned int id, double *percent,
if (id == Cx) if (id == Cx)
*percent = 100.0 - *percent; *percent = 100.0 - *percent;
dprint("%s: previous: %llu - current: %llu - (%u)\n", mperf_cstates[id].name, dprint("%s: previous: %llu - current: %llu - (%u)\n",
mperf_diff, aperf_diff, cpu); mperf_cstates[id].name, mperf_diff, aperf_diff, cpu);
dprint("%s: %f\n", mperf_cstates[id].name, *percent); dprint("%s: %f\n", mperf_cstates[id].name, *percent);
return 0; return 0;
} }
...@@ -206,8 +206,8 @@ static int mperf_stop(void) ...@@ -206,8 +206,8 @@ static int mperf_stop(void)
struct cpuidle_monitor mperf_monitor; struct cpuidle_monitor mperf_monitor;
struct cpuidle_monitor* mperf_register(void) { struct cpuidle_monitor *mperf_register(void)
{
unsigned long min; unsigned long min;
if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_APERF)) if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_APERF))
...@@ -221,21 +221,18 @@ struct cpuidle_monitor* mperf_register(void) { ...@@ -221,21 +221,18 @@ struct cpuidle_monitor* mperf_register(void) {
} }
/* Free this at program termination */ /* Free this at program termination */
is_valid = calloc(cpu_count, sizeof (int)); is_valid = calloc(cpu_count, sizeof(int));
mperf_previous_count = calloc (cpu_count, mperf_previous_count = calloc(cpu_count, sizeof(unsigned long long));
sizeof(unsigned long long)); aperf_previous_count = calloc(cpu_count, sizeof(unsigned long long));
aperf_previous_count = calloc (cpu_count, mperf_current_count = calloc(cpu_count, sizeof(unsigned long long));
sizeof(unsigned long long)); aperf_current_count = calloc(cpu_count, sizeof(unsigned long long));
mperf_current_count = calloc (cpu_count,
sizeof(unsigned long long));
aperf_current_count = calloc (cpu_count,
sizeof(unsigned long long));
mperf_monitor.name_len = strlen(mperf_monitor.name); mperf_monitor.name_len = strlen(mperf_monitor.name);
return &mperf_monitor; return &mperf_monitor;
} }
void mperf_unregister(void) { void mperf_unregister(void)
{
free(mperf_previous_count); free(mperf_previous_count);
free(aperf_previous_count); free(aperf_previous_count);
free(mperf_current_count); free(mperf_current_count);
......
...@@ -69,11 +69,12 @@ static unsigned long long *current_count[NHM_CSTATE_COUNT]; ...@@ -69,11 +69,12 @@ static unsigned long long *current_count[NHM_CSTATE_COUNT];
/* valid flag for all CPUs. If a MSR read failed it will be zero */ /* valid flag for all CPUs. If a MSR read failed it will be zero */
static int *is_valid; static int *is_valid;
static int nhm_get_count(enum intel_nhm_id id, unsigned long long *val, unsigned int cpu) static int nhm_get_count(enum intel_nhm_id id, unsigned long long *val,
unsigned int cpu)
{ {
int msr; int msr;
switch(id) { switch (id) {
case C3: case C3:
msr = MSR_CORE_C3_RESIDENCY; msr = MSR_CORE_C3_RESIDENCY;
break; break;
...@@ -106,12 +107,13 @@ static int nhm_get_count_percent(unsigned int id, double *percent, ...@@ -106,12 +107,13 @@ static int nhm_get_count_percent(unsigned int id, double *percent,
if (!is_valid[cpu]) if (!is_valid[cpu])
return -1; return -1;
*percent = (100.0 * (current_count[id][cpu] - previous_count[id][cpu])) / *percent = (100.0 *
(current_count[id][cpu] - previous_count[id][cpu])) /
(tsc_at_measure_end - tsc_at_measure_start); (tsc_at_measure_end - tsc_at_measure_start);
dprint("%s: previous: %llu - current: %llu - (%u)\n", nhm_cstates[id].name, dprint("%s: previous: %llu - current: %llu - (%u)\n",
previous_count[id][cpu], current_count[id][cpu], nhm_cstates[id].name, previous_count[id][cpu],
cpu); current_count[id][cpu], cpu);
dprint("%s: tsc_diff: %llu - count_diff: %llu - percent: %2.f (%u)\n", dprint("%s: tsc_diff: %llu - count_diff: %llu - percent: %2.f (%u)\n",
nhm_cstates[id].name, nhm_cstates[id].name,
...@@ -162,7 +164,8 @@ static int nhm_stop(void) ...@@ -162,7 +164,8 @@ static int nhm_stop(void)
struct cpuidle_monitor intel_nhm_monitor; struct cpuidle_monitor intel_nhm_monitor;
struct cpuidle_monitor* intel_nhm_register(void) { struct cpuidle_monitor *intel_nhm_register(void)
{
int num; int num;
if (cpupower_cpu_info.vendor != X86_VENDOR_INTEL) if (cpupower_cpu_info.vendor != X86_VENDOR_INTEL)
...@@ -175,11 +178,11 @@ struct cpuidle_monitor* intel_nhm_register(void) { ...@@ -175,11 +178,11 @@ struct cpuidle_monitor* intel_nhm_register(void) {
return NULL; return NULL;
/* Free this at program termination */ /* Free this at program termination */
is_valid = calloc(cpu_count, sizeof (int)); is_valid = calloc(cpu_count, sizeof(int));
for (num = 0; num < NHM_CSTATE_COUNT; num++) { for (num = 0; num < NHM_CSTATE_COUNT; num++) {
previous_count[num] = calloc (cpu_count, previous_count[num] = calloc(cpu_count,
sizeof(unsigned long long)); sizeof(unsigned long long));
current_count[num] = calloc (cpu_count, current_count[num] = calloc(cpu_count,
sizeof(unsigned long long)); sizeof(unsigned long long));
} }
...@@ -187,7 +190,8 @@ struct cpuidle_monitor* intel_nhm_register(void) { ...@@ -187,7 +190,8 @@ struct cpuidle_monitor* intel_nhm_register(void) {
return &intel_nhm_monitor; return &intel_nhm_monitor;
} }
void intel_nhm_unregister(void) { void intel_nhm_unregister(void)
{
int num; int num;
for (num = 0; num < NHM_CSTATE_COUNT; num++) { for (num = 0; num < NHM_CSTATE_COUNT; num++) {
......
...@@ -58,11 +58,12 @@ static unsigned long long *current_count[SNB_CSTATE_COUNT]; ...@@ -58,11 +58,12 @@ static unsigned long long *current_count[SNB_CSTATE_COUNT];
/* valid flag for all CPUs. If a MSR read failed it will be zero */ /* valid flag for all CPUs. If a MSR read failed it will be zero */
static int *is_valid; static int *is_valid;
static int snb_get_count(enum intel_snb_id id, unsigned long long *val, unsigned int cpu) static int snb_get_count(enum intel_snb_id id, unsigned long long *val,
unsigned int cpu)
{ {
int msr; int msr;
switch(id) { switch (id) {
case C7: case C7:
msr = MSR_CORE_C7_RESIDENCY; msr = MSR_CORE_C7_RESIDENCY;
break; break;
...@@ -91,18 +92,18 @@ static int snb_get_count_percent(unsigned int id, double *percent, ...@@ -91,18 +92,18 @@ static int snb_get_count_percent(unsigned int id, double *percent,
if (!is_valid[cpu]) if (!is_valid[cpu])
return -1; return -1;
*percent = (100.0 * (current_count[id][cpu] - previous_count[id][cpu])) / *percent = (100.0 *
(current_count[id][cpu] - previous_count[id][cpu])) /
(tsc_at_measure_end - tsc_at_measure_start); (tsc_at_measure_end - tsc_at_measure_start);
dprint("%s: previous: %llu - current: %llu - (%u)\n", snb_cstates[id].name, dprint("%s: previous: %llu - current: %llu - (%u)\n",
previous_count[id][cpu], current_count[id][cpu], snb_cstates[id].name, previous_count[id][cpu],
cpu); current_count[id][cpu], cpu);
dprint("%s: tsc_diff: %llu - count_diff: %llu - percent: %2.f (%u)\n", dprint("%s: tsc_diff: %llu - count_diff: %llu - percent: %2.f (%u)\n",
snb_cstates[id].name, snb_cstates[id].name,
(unsigned long long) tsc_at_measure_end - tsc_at_measure_start, (unsigned long long) tsc_at_measure_end - tsc_at_measure_start,
current_count[id][cpu] current_count[id][cpu] - previous_count[id][cpu],
- previous_count[id][cpu],
*percent, cpu); *percent, cpu);
return 0; return 0;
...@@ -141,8 +142,8 @@ static int snb_stop(void) ...@@ -141,8 +142,8 @@ static int snb_stop(void)
struct cpuidle_monitor intel_snb_monitor; struct cpuidle_monitor intel_snb_monitor;
static struct cpuidle_monitor* snb_register(void) { static struct cpuidle_monitor *snb_register(void)
{
int num; int num;
if (cpupower_cpu_info.vendor != X86_VENDOR_INTEL if (cpupower_cpu_info.vendor != X86_VENDOR_INTEL
...@@ -153,11 +154,11 @@ static struct cpuidle_monitor* snb_register(void) { ...@@ -153,11 +154,11 @@ static struct cpuidle_monitor* snb_register(void) {
&& cpupower_cpu_info.model != 0x2D) && cpupower_cpu_info.model != 0x2D)
return NULL; return NULL;
is_valid = calloc(cpu_count, sizeof (int)); is_valid = calloc(cpu_count, sizeof(int));
for (num = 0; num < SNB_CSTATE_COUNT; num++) { for (num = 0; num < SNB_CSTATE_COUNT; num++) {
previous_count[num] = calloc (cpu_count, previous_count[num] = calloc(cpu_count,
sizeof(unsigned long long)); sizeof(unsigned long long));
current_count[num] = calloc (cpu_count, current_count[num] = calloc(cpu_count,
sizeof(unsigned long long)); sizeof(unsigned long long));
} }
intel_snb_monitor.name_len = strlen(intel_snb_monitor.name); intel_snb_monitor.name_len = strlen(intel_snb_monitor.name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment