geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
ProfileTracerImp.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 PROFILETRACERIMP_HPP_INCLUDE
7 #define PROFILETRACERIMP_HPP_INCLUDE
8 
9 #include "config.h"
10 
11 #include "ProfileTracer.hpp"
12 #include "ApplicationSampler.hpp"
13 #include "geopm_time.h"
14 
15 namespace geopm
16 {
17  struct record_s;
18 
20  {
21  public:
22  ProfileTracerImp(const std::string &start_time);
23  ProfileTracerImp(const std::string &start_time,
24  const geopm_time_s &time_zero,
25  size_t buffer_size,
26  bool is_trace_enabled,
27  const std::string &file_name,
28  const std::string &host_name,
30  virtual ~ProfileTracerImp();
31  void update(const std::vector<record_s> &records);
32  private:
33  enum m_column_e {
34  M_COLUMN_TIME,
35  M_COLUMN_PROCESS,
36  M_COLUMN_EVENT,
37  M_COLUMN_SIGNAL,
38  M_NUM_COLUMN
39  };
40  bool m_is_trace_enabled;
41  std::unique_ptr<CSV> m_csv;
42  geopm_time_s m_time_zero;
43  static ApplicationSampler* m_application_sampler;
44  static std::string event_format(double value);
45  };
46 }
47 
48 #endif
Definition: ApplicationSampler.hpp:27
static ApplicationSampler & application_sampler(void)
Singleton accessor for the application sampler.
Definition: ApplicationSampler.cpp:39
Definition: ProfileTracer.hpp:22
Definition: ProfileTracerImp.hpp:20
ProfileTracerImp(const std::string &start_time)
Definition: ProfileTracer.cpp:30
void update(const std::vector< record_s > &records)
Definition: ProfileTracer.cpp:118
Definition: Accumulator.cpp:12