From 6b835421685d54e41f7083b06320554652cb3e2d Mon Sep 17 00:00:00 2001 From: Len Brown Date: Thu, 8 Nov 2012 22:38:05 -0500 Subject: [PATCH] --- yaml --- r: 346899 b: refs/heads/master c: e52966c084f9d9ea12be2ac7df801d610d4a19a5 h: refs/heads/master i: 346897: 324e2d0562051d8088c24eee656134dbe908b368 346895: 9a2b551f52dd320ea768f08791690430367fabe4 v: v3 --- [refs] | 2 +- trunk/tools/power/x86/turbostat/turbostat.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index f9fecfffc1d6..3a6e44e6b6a2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3fc808aaa052dec7b155f3242c6c0eabf0c49127 +refs/heads/master: e52966c084f9d9ea12be2ac7df801d610d4a19a5 diff --git a/trunk/tools/power/x86/turbostat/turbostat.c b/trunk/tools/power/x86/turbostat/turbostat.c index 3c063a00f3bf..77e76b11382f 100644 --- a/trunk/tools/power/x86/turbostat/turbostat.c +++ b/trunk/tools/power/x86/turbostat/turbostat.c @@ -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 */ @@ -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) {