Closed bgin closed 1 month ago
@wuwentao , @zhangxiaojingCAN , @sunnycase Can anyone answer my question!!
uint64_t get_cpu_times(void)
{
uint64_t value;
__asm__ __volatile__("rdtime %0" : "=r"(value));
return value;
}
uint64_t get_cpu_cycles(void)
{
uint64_t value;
__asm__ __volatile__("rdcycle %0" : "=r"(value));
return value;
}
The cpu timer frequency is 24M Hz. The big core cpu default frequency is 1.6G Hz. The little core cpu default frequency is 800M Hz.
uint64_t get_cpu_times(void) { uint64_t value; __asm__ __volatile__("rdtime %0" : "=r"(value)); return value; } uint64_t get_cpu_cycles(void) { uint64_t value; __asm__ __volatile__("rdcycle %0" : "=r"(value)); return value; }
The cpu timer frequency is 24M Hz. The big core cpu default frequency is 1.6G Hz. The little core cpu default frequency is 800M Hz.
@wycwyhwyq Thank you very much.
I have additional question and let me explain that more profoundly. Why looking at perf-list output I have seen much greater number of hardware-events, that those presented by you. Please have a look: and this screenshot:
I would like to know if there is a possibility to read these hardware events from the user space, exactly just as your example shows the read-out of timer value and the cycle count.
I really appreciate your help!!
Bernard
@wuwentao @wycwyhwyq @zhangxiaojingCAN @sunnycase Dear all,
Can [finally] anyone (of above-mentioned) answer my question? Please offer a helping hand!!
Best regards Bernard
For a detailed introduction and use of PMU, please refer to Chapter 14 of this XuanTie-C908-UserManual.pdf.
as there is no any new response in current issue for a long time, so we will close it. if issue still exist or need more info, we still can reopen current issue. Thanks!
Other
Hello, Does there exist a possibility to directly access the k230 performance timers or counters from the user space? Just as in the case of x86_64 architecture where exists a dedicated instruction i.e. "RDPMC".
Thank your for help Best regards Bernard