Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
Counters

Classes

struct  gts::analysis::WorkerPoolCounters
 
struct  gts::analysis::MicroSchedulerCounters
 
class  gts::analysis::Counter< TCounters >
 A set of thread local counters. More...
 

Typedefs

using gts::analysis::Counter< TCounters >::ThreadInfo::array_type = uint64_t[uint32_t(TCounters::COUNT)]
 
using gts::analysis::Counter< TCounters >::ThreadInfo::map_type = std::unordered_map< OwnedId, array_type, OwnedIdHash >
 
using gts::analysis::WorkerPoolCounter = Counter< WorkerPoolCounters >
 
using gts::analysis::MicroSchedulerCounter = Counter< MicroSchedulerCounters >
 

Enumerations

enum  {
  NUM_ALLOCATIONS , NUM_SLOW_PATH_ALLOCATIONS , NUM_MEMORY_RECLAIMS , NUM_FREES ,
  NUM_DEFERRED_FREES , NUM_WAKE_CALLS , NUM_WAKE_CHECKS , NUM_WAKE_SUCCESSES ,
  NUM_SLEEP_SUCCESSES , NUM_RESUMES , NUM_HALTS_SIGNALED , NUM_HALT_SUCCESSES ,
  NUM_SCHEDULER_REGISTERS , NUM_SCHEDULER_UNREGISTERS , COUNT
}
 
enum  {
  NUM_SPAWNS , NUM_QUEUES , NUM_DEQUE_POP_ATTEMPTS , NUM_DEQUE_POP_SUCCESSES ,
  NUM_BOOSTED_DEQUE_POP_ATTEMPTS , NUM_BOOSTED_DEQUE_POP_SUCCESSES , NUM_DEQUE_STEAL_ATTEMPTS , NUM_DEQUE_STEAL_SUCCESSES ,
  NUM_FAILED_CAS_IN_DEQUE_STEAL , NUM_QUEUE_POP_ATTEMPTS , NUM_QUEUE_POP_SUCCESSES , NUM_AFFINITY_POP_ATTEMPTS ,
  NUM_AFFINITY_POP_SUCCESSES , NUM_EXTERNAL_STEAL_ATTEMPTS , NUM_EXTERNAL_STEAL_SUCCESSES , NUM_WAITS ,
  NUM_CONTINUATIONS , NUM_EXECUTED_TASKS , NUM_SCHEDULER_BYPASSES , NUM_EXIT_ATTEMPTS ,
  NUM_EXITS , NUM_SCHEDULER_REGISTERS , NUM_SCHEDULER_UNREGISTERS , COUNT
}
 

Functions

size_t gts::analysis::Counter< TCounters >::OwnedIdHash::operator() (OwnedId const &id) const
 
static Countergts::analysis::Counter< TCounters >::inst ()
 
void gts::analysis::Counter< TCounters >::countOccurance (OwnedId const &id, size_t counter)
 
void gts::analysis::Counter< TCounters >::print (SubIdType const &ownerId, const char *file)
 

Variables

const char * gts::analysis::WorkerPoolCounters::m_counterStringByCounter [COUNT]
 
const char * gts::analysis::MicroSchedulerCounters::m_counterStringByCounter [COUNT]
 
ThreadId gts::analysis::Counter< TCounters >::ThreadInfo::tid = 0
 
map_type gts::analysis::Counter< TCounters >::ThreadInfo::countsByOwnedId
 
ThreadInfo * gts::analysis::Counter< TCounters >::ThreadInfoPtr::ptr = nullptr
 

Detailed Description

Function Documentation

◆ countOccurance()

template<typename TCounters >
void gts::analysis::Counter< TCounters >::countOccurance ( OwnedId const &  id,
size_t  counter 
)
inline

Increment an occurrence of 'type' for this thread.

◆ inst()

template<typename TCounters >
static Counter& gts::analysis::Counter< TCounters >::inst ( )
inlinestatic
Returns
The singleton instance of a Counter.

◆ print()

template<typename TCounters >
void gts::analysis::Counter< TCounters >::print ( SubIdType const &  ownerId,
const char *  file 
)
inline

Prints the counters from the specified ownerId to the specified file.