0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-15 00:18:34 +02:00

ircd::ctx: Add access to rdtsc through ctx::prof; minor comments.

This commit is contained in:
Jason Volk 2018-11-14 16:55:46 -08:00
parent 6576406123
commit 9222de0b34
3 changed files with 15 additions and 2 deletions

View file

@ -115,4 +115,6 @@ namespace ircd
using ctx::critical_assertion;
using ctx::critical_indicator;
using ctx::prof::rdtsc;
}

View file

@ -32,10 +32,15 @@ namespace ircd::ctx::prof
enum class event;
struct settings extern settings;
// lowlevel
ulong rdtsc();
// state accessors
const ulong &total_slice_cycles();
const ulong &cur_slice_start();
ulong cur_slice_cycles();
// called at the appropriate point to mark the event (internal use).
void mark(const event &);
}

View file

@ -1231,7 +1231,7 @@ ircd::ctx::prof::mark(const event &e)
ulong
ircd::ctx::prof::cur_slice_cycles()
{
return __rdtsc() - cur_slice_start();
return rdtsc() - cur_slice_start();
}
const ulong &
@ -1274,7 +1274,7 @@ ircd::ctx::prof::handle_cur_continue()
void
ircd::ctx::prof::slice_start()
{
_slice_start = __rdtsc();
_slice_start = rdtsc();
}
void
@ -1335,6 +1335,12 @@ ircd::ctx::prof::check_stack()
}
}
ulong
ircd::ctx::prof::rdtsc()
{
return __rdtsc();
}
///////////////////////////////////////////////////////////////////////////////
//
// ctx_ole.h