[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Userspace cycle counting for loongson?



Arnaud Patard (Rtp) 写道:
fxzhang <fxzhang@ict.ac.cn> writes:

you can use mfc0/dmfc0 to read the 'count' cp0 register.
afaik these instructions can't be used in userspace.
You're right:) Although some time ago I do hacked the kernel to
eliminate the switch of user mode/kernel mode to enable this.

hmm.. would have been better if you had emulated the mfc0
instruction like it's done for rdhwr imho :)

Arnaud



Nop, in this way, there will be some more error due to the time spent to access the count, and it might possibly affect the program behavior more due to the cache polution.


Reply to: