measure inside kernel measure inside a kernel

does anybody know if there is a way to measure the time inside a kernel. Say, you have a kernel function, where there are several device functions called. is it possible to generate a signal (or event, something) from inside the kernel, so that the runtime can measure each step inside the kernel?


You can look at the clock sample in the SDK, though it is not supposed to be a very accurate measurement as far as I know. It will give you some clues I guess.