diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-record.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 5f3127e7a615..2459e5a22ed8 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -524,6 +524,7 @@ static int __cmd_record(int argc, const char **argv) | |||
524 | pid_t pid = 0; | 524 | pid_t pid = 0; |
525 | int flags; | 525 | int flags; |
526 | int ret; | 526 | int ret; |
527 | unsigned long waking = 0; | ||
527 | 528 | ||
528 | page_size = sysconf(_SC_PAGE_SIZE); | 529 | page_size = sysconf(_SC_PAGE_SIZE); |
529 | nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); | 530 | nr_cpus = sysconf(_SC_NPROCESSORS_ONLN); |
@@ -634,10 +635,20 @@ static int __cmd_record(int argc, const char **argv) | |||
634 | if (hits == samples) { | 635 | if (hits == samples) { |
635 | if (done) | 636 | if (done) |
636 | break; | 637 | break; |
637 | ret = poll(event_array, nr_poll, 100); | 638 | ret = poll(event_array, nr_poll, -1); |
639 | waking++; | ||
640 | } | ||
641 | |||
642 | if (done) { | ||
643 | for (i = 0; i < nr_cpu; i++) { | ||
644 | for (counter = 0; counter < nr_counters; counter++) | ||
645 | ioctl(fd[i][counter], PERF_COUNTER_IOC_DISABLE); | ||
646 | } | ||
638 | } | 647 | } |
639 | } | 648 | } |
640 | 649 | ||
650 | fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n", waking); | ||
651 | |||
641 | /* | 652 | /* |
642 | * Approximate RIP event size: 24 bytes. | 653 | * Approximate RIP event size: 24 bytes. |
643 | */ | 654 | */ |