mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd::gpt: Add values for custom timestamp range to ctrl prof block.
This commit is contained in:
parent
571271c6a6
commit
db549a64ca
2 changed files with 19 additions and 4 deletions
|
@ -75,6 +75,9 @@ struct ircd_gpt_ctrl_prof
|
|||
|
||||
/// Device timestamp at end of cycle.
|
||||
ulong finished;
|
||||
|
||||
/// Device timestamps manually placed by developer.
|
||||
ulong custom[2];
|
||||
};
|
||||
|
||||
/// Task Control Page
|
||||
|
|
20
ircd/gpt.cc
20
ircd/gpt.cc
|
@ -945,6 +945,8 @@ ircd::gpt::samp::dispatche()
|
|||
|
||||
if(cycle == 0)
|
||||
{
|
||||
ctrl.prof.entered = 0;
|
||||
ctrl.prof.finished = 0;
|
||||
ctrl.prof.acquired = 0;
|
||||
ctrl.prof.released = prof::cycles();
|
||||
}
|
||||
|
@ -1257,20 +1259,30 @@ ircd::gpt::debug(const mutable_buffer &out,
|
|||
|
||||
const auto kern_cycles
|
||||
{
|
||||
prof.finished - prof.entered
|
||||
prof.finished && prof.entered?
|
||||
prof.finished - prof.entered: 0
|
||||
};
|
||||
|
||||
const auto host_cycles
|
||||
{
|
||||
prof.acquired - prof.released
|
||||
prof.acquired && prof.released?
|
||||
prof.acquired - prof.released: 0
|
||||
};
|
||||
|
||||
const auto cust_cycles
|
||||
{
|
||||
prof.custom[1] && prof.custom[0]?
|
||||
prof.custom[1] - prof.custom[0]: 0
|
||||
};
|
||||
|
||||
return fmt::sprintf
|
||||
{
|
||||
out, "%s",
|
||||
kern_cycles > 0?
|
||||
cust_cycles?
|
||||
pretty(buf[0], si(cust_cycles), 1):
|
||||
kern_cycles?
|
||||
pretty(buf[0], si(kern_cycles), 1):
|
||||
host_cycles > 0?
|
||||
host_cycles?
|
||||
pretty(buf[0], si(host_cycles), 1):
|
||||
string_view{},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue