Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346899
b: refs/heads/master
c: e52966c
h: refs/heads/master
i:
  346897: 324e2d0
  346895: 9a2b551
v: v3
  • Loading branch information
Len Brown committed Nov 27, 2012
1 parent 4a8dcdc commit 6b83542
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3fc808aaa052dec7b155f3242c6c0eabf0c49127
refs/heads/master: e52966c084f9d9ea12be2ac7df801d610d4a19a5
11 changes: 10 additions & 1 deletion trunk/tools/power/x86/turbostat/turbostat.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,10 @@ int get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p)
{
int cpu = t->cpu_id;

if (cpu_migrate(cpu))
if (cpu_migrate(cpu)) {
fprintf(stderr, "Could not migrate to CPU %d\n", cpu);
return -1;
}

t->tsc = rdtsc(); /* we are running on local CPU of interest */

Expand Down Expand Up @@ -1088,15 +1090,22 @@ int mark_cpu_present(int cpu)
void turbostat_loop()
{
int retval;
int restarted = 0;

restart:
restarted++;

retval = for_all_cpus(get_counters, EVEN_COUNTERS);
if (retval < -1) {
exit(retval);
} else if (retval == -1) {
if (restarted > 1) {
exit(retval);
}
re_initialize();
goto restart;
}
restarted = 0;
gettimeofday(&tv_even, (struct timezone *)NULL);

while (1) {
Expand Down

0 comments on commit 6b83542

Please sign in to comment.