summaryrefslogtreecommitdiff
path: root/gpxe/src/include/gpxe/profile.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-02-09 18:08:47 -0800
committerH. Peter Anvin <hpa@zytor.com>2016-02-09 18:08:47 -0800
commitf2f897a1762fab84d2905f32b1c15dd7b42abb56 (patch)
treea38f51d3f1fcbf44afddb4736d549c12eaf491be /gpxe/src/include/gpxe/profile.h
parent72d2959272b4616f17a97667e6dfa9d06bf109a3 (diff)
downloadsyslinux-f2f897a1762fab84d2905f32b1c15dd7b42abb56.tar.gz
gpxe: delete long since obsolete snapshot of gPXE
gPXE has been deprecated in favor of iPXE for many, many years now. It is much better than users get it directly from the iPXE project, since we should no longer need any special modifications for Syslinux use. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'gpxe/src/include/gpxe/profile.h')
-rw-r--r--gpxe/src/include/gpxe/profile.h80
1 files changed, 0 insertions, 80 deletions
diff --git a/gpxe/src/include/gpxe/profile.h b/gpxe/src/include/gpxe/profile.h
deleted file mode 100644
index a5bdd3a4..00000000
--- a/gpxe/src/include/gpxe/profile.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef _GPXE_PROFILE_H
-#define _GPXE_PROFILE_H
-
-/** @file
- *
- * Profiling
- *
- */
-
-FILE_LICENCE ( GPL2_OR_LATER );
-
-#include <stdint.h>
-
-/**
- * A data structure for storing profiling information
- */
-union profiler {
- /** Timestamp (in CPU-specific "ticks") */
- uint64_t timestamp;
- /** Registers returned by rdtsc.
- *
- * This part should really be architecture-specific code.
- */
- struct {
- uint32_t eax;
- uint32_t edx;
- } rdtsc;
-};
-
-/**
- * Static per-object profiler, for use with simple_profile()
- */
-static union profiler simple_profiler;
-
-/**
- * Perform profiling
- *
- * @v profiler Profiler data structure
- * @ret delta Elapsed ticks since last call to profile().
- *
- * Call profile() both before and after the code you wish to measure.
- * The "after" call will return the measurement. For example:
- *
- * @code
- *
- * profile ( &profiler );
- * ... do something here ...
- * printf ( "It took %ld ticks to execute\n", profile ( &profiler ) );
- *
- * @endcode
- */
-static inline __attribute__ (( always_inline )) unsigned long
-profile ( union profiler *profiler ) {
- uint64_t last_timestamp = profiler->timestamp;
-
- __asm__ __volatile__ ( "rdtsc" :
- "=a" ( profiler->rdtsc.eax ),
- "=d" ( profiler->rdtsc.edx ) );
- return ( profiler->timestamp - last_timestamp );
-}
-
-/**
- * Perform profiling
- *
- * @ret delta Elapsed ticks since last call to profile().
- *
- * When you only need one profiler, you can avoid the hassle of
- * creating your own @c profiler data structure by using
- * simple_profile() instead.
- *
- * simple_profile() is equivalent to profile(&simple_profiler), where
- * @c simple_profiler is a @c profiler data structure that is static
- * to each object which includes @c profile.h.
- */
-static inline __attribute__ (( always_inline )) unsigned long
-simple_profile ( void ) {
- return profile ( &simple_profiler );
-}
-
-#endif /* _GPXE_PROFILE_H */