]> granicus.if.org Git - sysstat/blob - rd_sensors.h
sar: Update statistics structures
[sysstat] / rd_sensors.h
1 /*
2  * rd_sensors.h: Include file used to read sensors statistics
3  * (C) 1999-2017 by Sebastien Godard (sysstat <at> orange.fr)
4  */
5
6 #ifndef _RD_SENSORS_H
7 #define _RD_SENSORS_H
8
9 #include "common.h"
10 #include "rd_stats.h"
11
12 /*
13  ***************************************************************************
14  * Definitions of structures for sensors statistics
15  ***************************************************************************
16  */
17
18 /*
19  * Structure for fan statistics.
20  */
21 struct stats_pwr_fan {
22         double  rpm                             __attribute__ ((aligned (8)));
23         double  rpm_min                         __attribute__ ((aligned (8)));
24         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
25 };
26
27 #define STATS_PWR_FAN_SIZE     (sizeof(struct stats_pwr_fan))
28 #define STATS_PWR_FAN_ULL       2
29 #define STATS_PWR_FAN_UL        0
30 #define STATS_PWR_FAN_U         0
31
32 /*
33  * Structure for device temperature statistics.
34  */
35 struct stats_pwr_temp {
36         double  temp                            __attribute__ ((aligned (8)));
37         double  temp_min                        __attribute__ ((aligned (8)));
38         double  temp_max                        __attribute__ ((aligned (8)));
39         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
40 };
41
42 #define STATS_PWR_TEMP_SIZE    (sizeof(struct stats_pwr_temp))
43 #define STATS_PWR_TEMP_ULL      3
44 #define STATS_PWR_TEMP_UL       0
45 #define STATS_PWR_TEMP_U        0
46
47 /*
48  * Structure for voltage inputs statistics.
49  */
50 struct stats_pwr_in {
51         double  in                              __attribute__ ((aligned (8)));
52         double  in_min                          __attribute__ ((aligned (8)));
53         double  in_max                          __attribute__ ((aligned (8)));
54         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
55 };
56
57 #define STATS_PWR_IN_SIZE       (sizeof(struct stats_pwr_in))
58 #define STATS_PWR_IN_ULL        3
59 #define STATS_PWR_IN_UL         0
60 #define STATS_PWR_IN_U          0
61
62 /*
63  ***************************************************************************
64  * Prototypes for functions used to read sensors statistics
65  ***************************************************************************
66  */
67
68 __nr_t read_fan
69         (struct stats_pwr_fan *, __nr_t);
70 __nr_t read_temp
71         (struct stats_pwr_temp *, __nr_t);
72 __nr_t read_in
73         (struct stats_pwr_in *, __nr_t);
74
75 /*
76  ***************************************************************************
77  * Prototypes for functions used to count number of items
78  ***************************************************************************
79  */
80
81 __nr_t get_fan_nr
82         (void);
83 __nr_t get_temp_nr
84         (void);
85 __nr_t get_in_nr
86         (void);
87
88 #endif /* _RD_SENSORS_H */