geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
geopm_pio.h
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 GEOPM_PIO_H_INCLUDE
7 #define GEOPM_PIO_H_INCLUDE
8 
9 #include <stddef.h>
10 #include <limits.h>
11 #include "geopm_public.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
22 #define GEOPM_NAME_MAX 255ULL
23 
28 int GEOPM_PUBLIC
30 
45 int GEOPM_PUBLIC
46  geopm_pio_signal_name(int name_idx, size_t result_max, char *result);
47 
52 int GEOPM_PUBLIC
54 
69 int GEOPM_PUBLIC
70  geopm_pio_control_name(int name_index, size_t result_max, char *result);
71 
80 int GEOPM_PUBLIC
81  geopm_pio_signal_domain_type(const char *signal_name);
82 
91 int GEOPM_PUBLIC
92  geopm_pio_control_domain_type(const char *control_name);
93 
115 int GEOPM_PUBLIC
116  geopm_pio_read_signal(const char *signal_name, int domain_type,
117  int domain_idx, double *result);
118 
141 int GEOPM_PUBLIC
142  geopm_pio_write_control(const char *control_name, int domain_type,
143  int domain_idx, double setting);
144 
184 int GEOPM_PUBLIC
185  geopm_pio_push_signal(const char *signal_name, int domain_type, int domain_idx);
186 
225 int GEOPM_PUBLIC
226  geopm_pio_push_control(const char *control_name, int domain_type, int domain_idx);
227 
243 int GEOPM_PUBLIC
244  geopm_pio_sample(int signal_idx, double *result);
245 
260 int GEOPM_PUBLIC
261  geopm_pio_adjust(int control_idx, double setting);
262 
268 int GEOPM_PUBLIC
269  geopm_pio_read_batch(void);
270 
276 int GEOPM_PUBLIC
277  geopm_pio_write_batch(void);
278 
289 int GEOPM_PUBLIC
291 
304 int GEOPM_PUBLIC
305  geopm_pio_save_control_dir(const char *save_dir);
306 
315 int GEOPM_PUBLIC
317 
328 int GEOPM_PUBLIC
329  geopm_pio_restore_control_dir(const char *save_dir);
330 
344 int GEOPM_PUBLIC
345  geopm_pio_signal_description(const char *signal_name, size_t description_max,
346  char *description);
347 
360 int GEOPM_PUBLIC
361  geopm_pio_control_description(const char *control_name, size_t description_max,
362  char *description);
363 
383 int GEOPM_PUBLIC
384  geopm_pio_signal_info(const char *signal_name, int *aggregation_type,
385  int *format_type, int *behavior_type);
386 
390  char name[GEOPM_NAME_MAX];
391 };
392 
427 int GEOPM_PUBLIC
428  geopm_pio_start_batch_server(int client_pid, int num_signal,
429  const struct geopm_request_s *signal_config,
430  int num_control,
431  const struct geopm_request_s *control_config,
432  int *server_pid, int key_size, char *server_key);
433 
446 int GEOPM_PUBLIC
447  geopm_pio_stop_batch_server(int server_pid);
448 
467 int GEOPM_PUBLIC
468  geopm_pio_format_signal(double signal, int format_type, size_t result_max,
469  char *result);
470 
481 void GEOPM_PUBLIC
482  geopm_pio_reset(void);
483 
487 int GEOPM_PUBLIC
488  geopm_pio_check_valid_value(double value);
489 
506 int GEOPM_PUBLIC
507  geopm_pio_profile_pids(const char *profile_name, int max_num_pid, int *num_pid, int *pid);
508 
509 #ifdef __cplusplus
510 }
511 #endif
512 #endif
#define GEOPM_NAME_MAX
String size limit for names.
Definition: geopm_pio.h:22
int GEOPM_PUBLIC geopm_pio_signal_name(int name_idx, size_t result_max, char *result)
Definition: PlatformIO.cpp:1077
int GEOPM_PUBLIC geopm_pio_restore_control_dir(const char *save_dir)
Restore the state recorded by the last call to geopm_pio_save_control() in the directory so that all ...
Definition: PlatformIO.cpp:1296
int GEOPM_PUBLIC geopm_pio_control_description(const char *control_name, size_t description_max, char *description)
Definition: PlatformIO.cpp:1329
int GEOPM_PUBLIC geopm_pio_adjust(int control_idx, double setting)
Updates cached value for single control that has been pushed via geopm_pio_push_control() to the valu...
Definition: PlatformIO.cpp:1218
void GEOPM_PUBLIC geopm_pio_reset(void)
Reset the GEOPM platform interface causing resources to be freed. This will cause the internal Plator...
Definition: PlatformIO.cpp:1448
int GEOPM_PUBLIC geopm_pio_save_control(void)
Save the state of all controls so that any subsequent changes made through geopm_pio_write_control() ...
Definition: PlatformIO.cpp:1257
int GEOPM_PUBLIC geopm_pio_control_domain_type(const char *control_name)
Query the domain for the control with name control_name.
Definition: PlatformIO.cpp:1138
int GEOPM_PUBLIC geopm_pio_num_signal_name(void)
Definition: PlatformIO.cpp:1038
int GEOPM_PUBLIC geopm_pio_control_name(int name_index, size_t result_max, char *result)
Definition: PlatformIO.cpp:1107
int GEOPM_PUBLIC geopm_pio_sample(int signal_idx, double *result)
Samples cached value of a single signal that has been pushed via geopm_pio_push_signal() and writes t...
Definition: PlatformIO.cpp:1205
int GEOPM_PUBLIC geopm_pio_restore_control(void)
Restore the state recorded by the last call to geopm_pio_save_control() so that all subsequent change...
Definition: PlatformIO.cpp:1270
int GEOPM_PUBLIC geopm_pio_stop_batch_server(int server_pid)
Supports the D-Bus interface for stopping a batch server. Call through to BatchServer::stop_batch()
Definition: PlatformIO.cpp:1412
int GEOPM_PUBLIC geopm_pio_start_batch_server(int client_pid, int num_signal, const struct geopm_request_s *signal_config, int num_control, const struct geopm_request_s *control_config, int *server_pid, int key_size, char *server_key)
Creates a batch server with the following signals and controls. It would be an error to create a batc...
Definition: PlatformIO.cpp:1370
int GEOPM_PUBLIC geopm_pio_push_signal(const char *signal_name, int domain_type, int domain_idx)
Push a signal onto the stack of batch access signals. The signal is defined by selecting a signal_nam...
Definition: PlatformIO.cpp:1179
int GEOPM_PUBLIC geopm_pio_read_signal(const char *signal_name, int domain_type, int domain_idx, double *result)
Read from the platform and interpret into SI units a signal associated with signal_name and store the...
Definition: PlatformIO.cpp:1151
int GEOPM_PUBLIC geopm_pio_format_signal(double signal, int format_type, size_t result_max, char *result)
Format the signal according to the format type specified, and write the output into the result string...
Definition: PlatformIO.cpp:1425
int GEOPM_PUBLIC geopm_pio_signal_description(const char *signal_name, size_t description_max, char *description)
Definition: PlatformIO.cpp:1309
int GEOPM_PUBLIC geopm_pio_write_control(const char *control_name, int domain_type, int domain_idx, double setting)
Interpret the setting in SI units associated with control_name and write it to the platform....
Definition: PlatformIO.cpp:1165
int GEOPM_PUBLIC geopm_pio_signal_info(const char *signal_name, int *aggregation_type, int *format_type, int *behavior_type)
C interface to get enums associated with a signal name.
Definition: PlatformIO.cpp:1349
int GEOPM_PUBLIC geopm_pio_read_batch(void)
Read all push signals from the platform so that the next call to geopm_pio_sample() will reflect the ...
Definition: PlatformIO.cpp:1231
int GEOPM_PUBLIC geopm_pio_save_control_dir(const char *save_dir)
Save the state of all controls in the directory so that any subsequent changes made through geopm_pio...
Definition: PlatformIO.cpp:1283
int GEOPM_PUBLIC geopm_pio_check_valid_value(double value)
Definition: PlatformIO.cpp:1453
int GEOPM_PUBLIC geopm_pio_push_control(const char *control_name, int domain_type, int domain_idx)
Push a control onto the stack of batch access controls. The control is defined by selecting a control...
Definition: PlatformIO.cpp:1192
int GEOPM_PUBLIC geopm_pio_profile_pids(const char *profile_name, int max_num_pid, int *num_pid, int *pid)
Discover the thread PIDS associated with an application.
Definition: ServiceProxy.cpp:222
int GEOPM_PUBLIC geopm_pio_write_batch(void)
Write all pushed controls so that values provided to geopm_pio_adjust() are written to the platform.
Definition: PlatformIO.cpp:1244
int GEOPM_PUBLIC geopm_pio_signal_domain_type(const char *signal_name)
Query the domain for the signal with name signal_name.
Definition: PlatformIO.cpp:1124
int GEOPM_PUBLIC geopm_pio_num_control_name(void)
Definition: PlatformIO.cpp:1094
#define GEOPM_PUBLIC
Definition: geopm_public.h:10
Definition: geopm_pio.h:387
int domain_idx
Definition: geopm_pio.h:389
int domain_type
Definition: geopm_pio.h:388