diff --git a/src/include/ipxe/profile.h b/src/include/ipxe/profile.h index 5d3b6624..b6d2b19e 100644 --- a/src/include/ipxe/profile.h +++ b/src/include/ipxe/profile.h @@ -186,4 +186,18 @@ profile_exclude ( struct profiler *profiler ) { profile_excluded += profile_elapsed ( profiler ); } +/** + * Record profiling sample in custom units + * + * @v profiler Profiler + * @v sample Profiling sample + */ +static inline __attribute__ (( always_inline )) void +profile_custom ( struct profiler *profiler, unsigned long sample ) { + + /* If profiling is active then update stats */ + if ( PROFILING ) + profile_update ( profiler, sample ); +} + #endif /* _IPXE_PROFILE_H */