aboutsummaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-09-24 14:49:32 +0100
committerMichael Brown <mcb30@ipxe.org>2024-09-24 15:40:45 +0100
commit5f7c6bd95bd6089473db3ba4f033584f5de0ee8a (patch)
tree9b58e51eb17191f26cf24a7af33523ed16b9faa7 /src/include
parent3def13265d9475c861eed1a101584b761e97ae33 (diff)
downloadipxe-5f7c6bd95bd6089473db3ba4f033584f5de0ee8a.tar.gz
[profile] Standardise return type of profile_timestamp()
All consumers of profile_timestamp() currently treat the value as an unsigned long. Only the elapsed number of ticks is ever relevant: the absolute value of the timestamp is not used. Profiling is used to measure short durations that are generally fewer than a million CPU cycles, for which an unsigned long is easily large enough. Standardise the return type of profile_timestamp() as unsigned long across all CPU architectures. This allows 32-bit architectures such as i386 and riscv32 to omit all logic associated with retrieving the upper 32 bits of the 64-bit hardware counter, which simplifies the code and allows riscv32 and riscv64 to share the same implementation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/profile.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/ipxe/profile.h b/src/include/ipxe/profile.h
index 2c69e1208..fd45b3cdc 100644
--- a/src/include/ipxe/profile.h
+++ b/src/include/ipxe/profile.h
@@ -60,6 +60,8 @@ struct profiler {
#define __profiler
#endif
+unsigned long profile_timestamp ( void );
+
extern unsigned long profile_excluded;
extern void profile_update ( struct profiler *profiler, unsigned long sample );