*
* @ret timestamp Timestamp
*/
-static inline __attribute__ (( always_inline )) uint64_t
+static inline __attribute__ (( always_inline )) unsigned long
profile_timestamp ( void ) {
uint32_t cycles;
*
* @ret timestamp Timestamp
*/
-static inline __attribute__ (( always_inline )) uint64_t
+static inline __attribute__ (( always_inline )) unsigned long
profile_timestamp ( void ) {
uint64_t cycles;
*
* @ret timestamp Timestamp
*/
-static inline __attribute__ (( always_inline )) uint64_t
+static inline __attribute__ (( always_inline )) unsigned long
profile_timestamp ( void ) {
- uint64_t tsc;
+ uint32_t tsc;
/* Read timestamp counter */
- __asm__ __volatile__ ( "rdtsc" : "=A" ( tsc ) );
+ __asm__ __volatile__ ( "rdtsc" : "=a" ( tsc ) : : "edx" );
return tsc;
}
*
* @ret timestamp Timestamp
*/
-static inline __attribute__ (( always_inline )) uint64_t
+static inline __attribute__ (( always_inline )) unsigned long
profile_timestamp ( void ) {
uint64_t cycles;
*
* @ret timestamp Timestamp
*/
-static inline __attribute__ (( always_inline )) uint64_t
+static inline __attribute__ (( always_inline )) unsigned long
profile_timestamp ( void ) {
- uint64_t cycles;
+ unsigned long cycles;
/* Read timestamp counter */
__asm__ __volatile__ ( "rdcycle %0" : "=r" ( cycles ) );
+++ /dev/null
-#ifndef _BITS_PROFILE_H
-#define _BITS_PROFILE_H
-
-/** @file
- *
- * Profiling
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
-
-#include <stdint.h>
-
-/**
- * Get profiling timestamp
- *
- * @ret timestamp Timestamp
- */
-static inline __attribute__ (( always_inline )) uint64_t
-profile_timestamp ( void ) {
- uint32_t cycles_lo;
- uint32_t cycles_hi;
- uint32_t tmp;
-
- /* Read timestamp counter */
- __asm__ __volatile__ ( "\n1:\n\t"
- "rdcycleh %1\n\t"
- "rdcycle %0\n\t"
- "rdcycleh %2\n\t"
- "bne %1, %2, 1b\n\t"
- : "=r" ( cycles_lo ), "=r" ( cycles_hi ),
- "=r" ( tmp ) );
- return ( ( ( ( uint64_t ) cycles_hi ) << 32 ) | cycles_lo );
-}
-
-#endif /* _BITS_PROFILE_H */
*
* @ret timestamp Timestamp
*/
-static inline __attribute__ (( always_inline )) uint64_t
+static inline __attribute__ (( always_inline )) unsigned long
profile_timestamp ( void ) {
uint32_t eax;
uint32_t edx;
#define __profiler
#endif
+unsigned long profile_timestamp ( void );
+
extern unsigned long profile_excluded;
extern void profile_update ( struct profiler *profiler, unsigned long sample );