You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

profile.h 438B

12345678910111213141516171819202122232425262728
  1. #ifndef _BITS_PROFILE_H
  2. #define _BITS_PROFILE_H
  3. /** @file
  4. *
  5. * Profiling
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <stdint.h>
  10. /**
  11. * Get profiling timestamp
  12. *
  13. * @ret timestamp Timestamp
  14. */
  15. static inline __attribute__ (( always_inline )) uint64_t
  16. profile_timestamp ( void ) {
  17. uint64_t tsc;
  18. /* Read timestamp counter */
  19. __asm__ __volatile__ ( "rdtsc" : "=A" ( tsc ) );
  20. return tsc;
  21. }
  22. #endif /* _BITS_PROFILE_H */