thread_stats.h 771 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12

#ifndef PLS_INTERNAL_PROFILING_THREAD_STATS_H_
#define PLS_INTERNAL_PROFILING_THREAD_STATS_H_

#include <chrono>
#include <type_traits>

#include "context_switcher/context_switcher.h"

#include "pls/internal/base/system_details.h"
#include "pls/internal/base/stack_allocator.h"

FritzFlorian committed
13 14
#include "pls/internal/profiling/dag_node.h"

15 16 17 18 19 20 21 22 23 24 25 26 27
namespace pls::internal::profiling {

struct PLS_CACHE_ALIGN thread_stats {
  using clock = std::chrono::steady_clock;

  unsigned long total_steals_{0};
  unsigned long successful_steals_{0};
  unsigned long failed_steals_{0};
  unsigned long steal_cas_ops_{0};

  unsigned long total_time_stealing_{0};

  clock::time_point stealing_start_time_;
FritzFlorian committed
28
  clock::time_point task_run_start_time_;
29 30 31 32 33
};

}

#endif //PLS_INTERNAL_PROFILING_THREAD_STATS_H_