diff options
| author | Michael Brown | 2014-05-03 19:25:19 +0200 |
|---|---|---|
| committer | Michael Brown | 2014-05-03 19:50:26 +0200 |
| commit | a0da06c306f4c106136909ad149204005fe82ab1 (patch) | |
| tree | 2278e138c0d70ee4f950fd0e4587149184f6dd45 /src/arch/i386 | |
| parent | [librm] Speed up protected-mode calls under KVM (diff) | |
| download | ipxe-a0da06c306f4c106136909ad149204005fe82ab1.tar.gz ipxe-a0da06c306f4c106136909ad149204005fe82ab1.tar.xz ipxe-a0da06c306f4c106136909ad149204005fe82ab1.zip | |
[profile] Provide methods for profiling individual stages of operations
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386')
| -rw-r--r-- | src/arch/i386/transitions/librm_test.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/arch/i386/transitions/librm_test.c b/src/arch/i386/transitions/librm_test.c index 76ed1f7e8..8f5be4229 100644 --- a/src/arch/i386/transitions/librm_test.c +++ b/src/arch/i386/transitions/librm_test.c @@ -51,7 +51,8 @@ static struct profiler r2p_profiler __profiler = { .name = "r2p" }; */ static void librm_test_exec ( void ) { unsigned int i; - unsigned long p2r_elapsed; + unsigned long timestamp; + unsigned int discard_d; /* Profile mode transitions. We want to profile each * direction of the transition separately, so perform an RDTSC @@ -61,10 +62,11 @@ static void librm_test_exec ( void ) { for ( i = 0 ; i < PROFILE_COUNT ; i++ ) { profile_start ( &p2r_profiler ); __asm__ __volatile__ ( REAL_CODE ( "rdtsc\n\t" ) - : "=A" ( r2p_profiler.started ) : ); + : "=a" ( timestamp ), "=d" ( discard_d ) + : ); + profile_start_at ( &r2p_profiler, timestamp ); profile_stop ( &r2p_profiler ); - p2r_elapsed = ( r2p_profiler.started - p2r_profiler.started ); - profile_update ( &p2r_profiler, p2r_elapsed ); + profile_stop_at ( &p2r_profiler, timestamp ); } } |
