#include <stdint.h>
Go to the source code of this file.
Data Structures | |
| union | profiler |
| A data structure for storing profiling information. More... | |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| static | __attribute__ ((always_inline)) unsigned long profile(union profiler *profiler) |
| Perform profiling. | |
Variables | |
| static union profiler | simple_profiler |
| Static per-object profiler, for use with simple_profile(). | |
Definition in file profile.h.
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| static __attribute__ | ( | (always_inline) | ) | [inline, static] |
Perform profiling.
| profiler | Profiler data structure |
| delta | Elapsed ticks since last call to profile(). |
profile ( &profiler ); ... do something here ... printf ( "It took %ld ticks to execute\n", profile ( &profiler ) );
| delta | Elapsed ticks since last call to profile(). |
profiler data structure by using simple_profile() instead.
simple_profile() is equivalent to profile(&simple_profiler), where simple_profiler is a profiler data structure that is static to each object which includes profile.h.
Definition at line 52 of file profile.h.
References __asm__().
00053 { 00054 uint64_t last_timestamp = profiler->timestamp; 00055 00056 __asm__ __volatile__ ( "rdtsc" : 00057 "=a" ( profiler->rdtsc.eax ), 00058 "=d" ( profiler->rdtsc.edx ) ); 00059 return ( profiler->timestamp - last_timestamp ); 00060 }
union profiler simple_profiler [static] |
1.5.7.1