mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
Really disable hardware counters.
This commit is contained in:
committed by
Soren Sandmann
parent
2d5cf4c93f
commit
b957f30379
@ -406,7 +406,7 @@ counter_new (Collector *collector,
|
|||||||
attr.task = 1;
|
attr.task = 1;
|
||||||
attr.exclude_idle = 1;
|
attr.exclude_idle = 1;
|
||||||
|
|
||||||
if ((fd = sysprof_perf_counter_open (&attr, -1, cpu, -1, 0)) < 0)
|
if (!collector->use_hw_counters || (fd = sysprof_perf_counter_open (&attr, -1, cpu, -1, 0)) < 0)
|
||||||
{
|
{
|
||||||
attr.type = PERF_TYPE_SOFTWARE;
|
attr.type = PERF_TYPE_SOFTWARE;
|
||||||
attr.config = PERF_COUNT_SW_CPU_CLOCK;
|
attr.config = PERF_COUNT_SW_CPU_CLOCK;
|
||||||
@ -431,6 +431,7 @@ counter_new (Collector *collector,
|
|||||||
counter->cpu = cpu;
|
counter->cpu = cpu;
|
||||||
|
|
||||||
fd_add_watch (fd, counter);
|
fd_add_watch (fd, counter);
|
||||||
|
|
||||||
fd_set_read_callback (fd, on_read);
|
fd_set_read_callback (fd, on_read);
|
||||||
|
|
||||||
return counter;
|
return counter;
|
||||||
|
|||||||
Reference in New Issue
Block a user