Hi,
When I try to use rdcycle as follows:
asm volatile ("rdcycle %0" : "=r" (cycles));
to profile benchmarks running on Linux, I always get the same number of cycles.
For example, profiling the following code:
uint64_t start, end;
start = read_cycles();
printf("Starting\n");
end = read_cycles();
printf("Cycles taken: %llu from %llu to %llu\n", end - start, start, end);
produces this output:
Cycles taken: 0 from
3046933860 to
3046933860Could this be related to kernel restrictions or configuration parameters that disable access to performance counters in user space?
Thanks!