geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
ApplicationSampler.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef APPLICATIONSAMPLER_HPP_INCLUDE
7 #define APPLICATIONSAMPLER_HPP_INCLUDE
8 
9 #include <cstdint>
10 
11 #include <memory>
12 #include <vector>
13 #include <map>
14 #include <set>
15 #include <string>
16 
17 #include "geopm_time.h"
18 
19 namespace geopm
20 {
21  class ApplicationRecordLog;
22  class ProfileSampler;
23  struct record_s;
24  struct short_region_s;
25 
27  {
28  public:
29  virtual ~ApplicationSampler() = default;
35  static std::set<uint64_t> region_hash_network(void);
41  virtual void update(const geopm_time_s &curr_time) = 0;
46  virtual std::vector<record_s> get_records(void) const = 0;
47  virtual short_region_s get_short_region(uint64_t event_signal) const = 0;
59  virtual uint64_t cpu_region_hash(int cpu_idx) const = 0;
71  virtual uint64_t cpu_hint(int cpu_idx) const = 0;
88  virtual double cpu_hint_time(int cpu_idx, uint64_t hint) const = 0;
105  virtual double cpu_progress(int cpu_idx) const = 0;
112  virtual void connect(const std::vector<int> &client_pids) = 0;
113  virtual std::vector<int> client_pids(void) const = 0;
114  virtual std::set<int> client_cpu_set(int client_pid) const = 0;
115  virtual bool do_shutdown(void) const = 0;
116  virtual double total_time(void) const = 0;
117  virtual double overhead_time(void) const = 0;
118  protected:
119  ApplicationSampler() = default;
120  private:
121  static std::set<uint64_t> region_hash_network_once(void);
122  };
123 }
124 
125 #endif
Definition: ApplicationSampler.hpp:27
virtual bool do_shutdown(void) const =0
virtual double total_time(void) const =0
virtual void connect(const std::vector< int > &client_pids)=0
Connect with an application using a key.
virtual std::vector< int > client_pids(void) const =0
static std::set< uint64_t > region_hash_network(void)
Returns set of region hashes associated with application network functions.
Definition: ApplicationSampler.cpp:45
virtual double overhead_time(void) const =0
virtual double cpu_progress(int cpu_idx) const =0
Get the progress reported on a CPU.
virtual double cpu_hint_time(int cpu_idx, uint64_t hint) const =0
Get the amount of time a CPU has been measured running with a hint.
virtual std::set< int > client_cpu_set(int client_pid) const =0
virtual void update(const geopm_time_s &curr_time)=0
Update the record buffer by clearing out old records and providing a new cache for subsequent calls t...
virtual ~ApplicationSampler()=default
virtual uint64_t cpu_hint(int cpu_idx) const =0
Get the hint associated with a CPU.
static ApplicationSampler & application_sampler(void)
Singleton accessor for the application sampler.
Definition: ApplicationSampler.cpp:39
virtual std::vector< record_s > get_records(void) const =0
Get all of the application events that have been recorded since the last call to update_records().
virtual short_region_s get_short_region(uint64_t event_signal) const =0
virtual uint64_t cpu_region_hash(int cpu_idx) const =0
Get the region hash associated with a CPU.
Definition: Accumulator.cpp:12
Definition: record.hpp:72