0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

ircd::ctx: Expose the profile state struct in the prof:: interface.

This commit is contained in:
Jason Volk 2018-12-22 13:47:13 -08:00
parent a590ad1a03
commit 39d4f2fb83
2 changed files with 9 additions and 8 deletions

View file

@ -29,6 +29,7 @@
///
namespace ircd::ctx::prof
{
struct profile;
enum class event;
// lowlevel
@ -76,3 +77,10 @@ namespace ircd::ctx::prof::settings
extern conf::item<ulong> slice_interrupt; // Interrupt exception when exceeded (not a signal)
extern conf::item<ulong> slice_assertion; // abort() when exceeded (not a signal, must yield)
}
/// structure aggregating any profiling related state for a ctx
struct ircd::ctx::prof::profile
{
ulong cycles {0}; // monotonic counter (rdtsc)
uint64_t yields {0}; // monotonic counter
};

View file

@ -28,13 +28,6 @@ struct ircd::ctx::stack
{}
};
/// Internal structure aggregating any profiling related state for the ctx
struct ircd::ctx::profile
{
ulong cycles {0}; // monotonic counter (rdtsc)
uint64_t yields {0}; // monotonic counter
};
/// Internal context implementation
///
struct ircd::ctx::ctx
@ -51,7 +44,7 @@ struct ircd::ctx::ctx
boost::asio::yield_context *yc {nullptr}; // boost interface
continuation *cont {nullptr}; // valid when asleep; invalid when awake
ircd::ctx::stack stack; // stack related structure
ircd::ctx::profile profile; // prof related structure
prof::profile profile; // prof related structure
list::node node; // node for ctx::list
dock adjoindre; // contexts waiting for this to join()