geopm  3.1.1.dev214+gba4f9f6d
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 
21 int GEOPM_PUBLIC
23 
38 int GEOPM_PUBLIC
39  geopm_pio_signal_name(int name_idx, size_t result_max, char *result);
40 
45 int GEOPM_PUBLIC
47 
62 int GEOPM_PUBLIC
63  geopm_pio_control_name(int name_index, size_t result_max, char *result);
64 
73 int GEOPM_PUBLIC
74  geopm_pio_signal_domain_type(const char *signal_name);
75 
84 int GEOPM_PUBLIC
85  geopm_pio_control_domain_type(const char *control_name);
86 
108 int GEOPM_PUBLIC
109  geopm_pio_read_signal(const char *signal_name, int domain_type,
110  int domain_idx, double *result);
111 
134 int GEOPM_PUBLIC
135  geopm_pio_write_control(const char *control_name, int domain_type,
136  int domain_idx, double setting);
137 
177 int GEOPM_PUBLIC
178  geopm_pio_push_signal(const char *signal_name, int domain_type, int domain_idx);
179 
218 int GEOPM_PUBLIC
219  geopm_pio_push_control(const char *control_name, int domain_type, int domain_idx);
220 
236 int GEOPM_PUBLIC
237  geopm_pio_sample(int signal_idx, double *result);
238 
253 int GEOPM_PUBLIC
254  geopm_pio_adjust(int control_idx, double setting);
255 
261 int GEOPM_PUBLIC
262  geopm_pio_read_batch(void);
263 
269 int GEOPM_PUBLIC
270  geopm_pio_write_batch(void);
271 
282 int GEOPM_PUBLIC
284 
297 int GEOPM_PUBLIC
298  geopm_pio_save_control_dir(const char *save_dir);
299 
308 int GEOPM_PUBLIC
310 
321 int GEOPM_PUBLIC
322  geopm_pio_restore_control_dir(const char *save_dir);
323 
337 int GEOPM_PUBLIC
338  geopm_pio_signal_description(const char *signal_name, size_t description_max,
339  char *description);
340 
353 int GEOPM_PUBLIC
354  geopm_pio_control_description(const char *control_name, size_t description_max,
355  char *description);
356 
376 int GEOPM_PUBLIC
377  geopm_pio_signal_info(const char *signal_name, int *aggregation_type,
378  int *format_type, int *behavior_type);
379 
380 struct geopm_request_s;
381 
416 int GEOPM_PUBLIC
417  geopm_pio_start_batch_server(int client_pid, int num_signal,
418  const struct geopm_request_s *signal_config,
419  int num_control,
420  const struct geopm_request_s *control_config,
421  int *server_pid, int key_size, char *server_key);
422 
435 int GEOPM_PUBLIC
436  geopm_pio_stop_batch_server(int server_pid);
437 
456 int GEOPM_PUBLIC
457  geopm_pio_format_signal(double signal, int format_type, size_t result_max,
458  char *result);
459 
470 void GEOPM_PUBLIC
471  geopm_pio_reset(void);
472 
476 int GEOPM_PUBLIC
477  geopm_pio_check_valid_value(double value);
478 
495 int GEOPM_PUBLIC
496  geopm_pio_profile_pids(const char *profile_name, int max_num_pid, int *num_pid, int *pid);
497 
498 #ifdef __cplusplus
499 }
500 #endif
501 #endif
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: PlatformIO.hpp:19