mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd::ctx: Add access to rdtsc through ctx::prof; minor comments.
This commit is contained in:
parent
6576406123
commit
9222de0b34
3 changed files with 15 additions and 2 deletions
|
@ -115,4 +115,6 @@ namespace ircd
|
|||
|
||||
using ctx::critical_assertion;
|
||||
using ctx::critical_indicator;
|
||||
|
||||
using ctx::prof::rdtsc;
|
||||
}
|
||||
|
|
|
@ -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 &);
|
||||
}
|
||||
|
||||
|
|
10
ircd/ctx.cc
10
ircd/ctx.cc
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue