geopm 3.1.1.dev456+g3ba31824
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
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
14extern "C" {
15#endif
16
22#define GEOPM_NAME_MAX 255ULL
23
30
46 geopm_pio_signal_name(int name_idx, size_t result_max, char *result);
47
54
70 geopm_pio_control_name(int name_index, size_t result_max, char *result);
71
81 geopm_pio_signal_domain_type(const char *signal_name);
82
92 geopm_pio_control_domain_type(const char *control_name);
93
115int GEOPM_PUBLIC
116 geopm_pio_read_signal(const char *signal_name, int domain_type,
117 int domain_idx, double *result);
118
141int GEOPM_PUBLIC
142 geopm_pio_write_control(const char *control_name, int domain_type,
143 int domain_idx, double setting);
144
184int GEOPM_PUBLIC
185 geopm_pio_push_signal(const char *signal_name, int domain_type, int domain_idx);
186
225int GEOPM_PUBLIC
226 geopm_pio_push_control(const char *control_name, int domain_type, int domain_idx);
227
243int GEOPM_PUBLIC
244 geopm_pio_sample(int signal_idx, double *result);
245
260int GEOPM_PUBLIC
261 geopm_pio_adjust(int control_idx, double setting);
262
268int GEOPM_PUBLIC
270
276int GEOPM_PUBLIC
278
289int GEOPM_PUBLIC
291
304int GEOPM_PUBLIC
305 geopm_pio_save_control_dir(const char *save_dir);
306
315int GEOPM_PUBLIC
317
328int GEOPM_PUBLIC
329 geopm_pio_restore_control_dir(const char *save_dir);
330
344int GEOPM_PUBLIC
345 geopm_pio_signal_description(const char *signal_name, size_t description_max,
346 char *description);
347
360int GEOPM_PUBLIC
361 geopm_pio_control_description(const char *control_name, size_t description_max,
362 char *description);
363
383int GEOPM_PUBLIC
384 geopm_pio_signal_info(const char *signal_name, int *aggregation_type,
385 int *format_type, int *behavior_type);
386
392
427int 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
446int GEOPM_PUBLIC
447 geopm_pio_stop_batch_server(int server_pid);
448
467int GEOPM_PUBLIC
468 geopm_pio_format_signal(double signal, int format_type, size_t result_max,
469 char *result);
470
481void GEOPM_PUBLIC
482 geopm_pio_reset(void);
483
487int GEOPM_PUBLIC
488 geopm_pio_check_valid_value(double value);
489
506int 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:876
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:1095
int GEOPM_PUBLIC geopm_pio_control_description(const char *control_name, size_t description_max, char *description)
Definition PlatformIO.cpp:1128
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:1017
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:1247
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:1056
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:937
int GEOPM_PUBLIC geopm_pio_num_signal_name(void)
Definition PlatformIO.cpp:837
int GEOPM_PUBLIC geopm_pio_control_name(int name_index, size_t result_max, char *result)
Definition PlatformIO.cpp:906
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:1004
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:1069
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:1211
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:1169
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:978
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:950
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:1224
int GEOPM_PUBLIC geopm_pio_signal_description(const char *signal_name, size_t description_max, char *description)
Definition PlatformIO.cpp:1108
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:964
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:1148
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:1030
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:1082
int GEOPM_PUBLIC geopm_pio_check_valid_value(double value)
Definition PlatformIO.cpp:1252
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:991
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:242
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:1043
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:923
int GEOPM_PUBLIC geopm_pio_num_control_name(void)
Definition PlatformIO.cpp:893
#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