]> granicus.if.org Git - sysstat/blob - rd_sensors.h
SVG: Fix how bar graphs are displayed for fs statistics
[sysstat] / rd_sensors.h
1 /*
2  * rd_sensors.h: Include file used to read sensors statistics
3  * (C) 1999-2016 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
11 /*
12  ***************************************************************************
13  * Definitions of structures for sensors statistics
14  ***************************************************************************
15  */
16
17 /*
18  * Structure for fan statistics.
19  */
20 struct stats_pwr_fan {
21         double  rpm                             __attribute__ ((aligned (8)));
22         double  rpm_min                         __attribute__ ((aligned (8)));
23         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
24 };
25
26 #define STATS_PWR_FAN_SIZE     (sizeof(struct stats_pwr_fan))
27
28 /*
29  * Structure for device temperature statistics.
30  */
31 struct stats_pwr_temp {
32         double  temp                            __attribute__ ((aligned (8)));
33         double  temp_min                        __attribute__ ((aligned (8)));
34         double  temp_max                        __attribute__ ((aligned (8)));
35         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
36 };
37
38 #define STATS_PWR_TEMP_SIZE    (sizeof(struct stats_pwr_temp))
39
40 /*
41  * Structure for voltage inputs statistics.
42  */
43 struct stats_pwr_in {
44         double  in                              __attribute__ ((aligned (8)));
45         double  in_min                          __attribute__ ((aligned (8)));
46         double  in_max                          __attribute__ ((aligned (8)));
47         char    device[MAX_SENSORS_DEV_LEN]     __attribute__ ((aligned (8)));
48 };
49
50 #define STATS_PWR_IN_SIZE       (sizeof(struct stats_pwr_in))
51
52 /*
53  ***************************************************************************
54  * Prototypes for functions used to read sensors statistics
55  ***************************************************************************
56  */
57
58 void read_fan
59         (struct stats_pwr_fan *, int);
60 void read_temp
61         (struct stats_pwr_temp *, int);
62 void read_in
63         (struct stats_pwr_in *, int);
64
65 /*
66  ***************************************************************************
67  * Prototypes for functions used to count number of items
68  ***************************************************************************
69  */
70
71 int get_fan_nr
72         (void);
73 int get_temp_nr
74         (void);
75 int get_in_nr
76         (void);
77
78 #endif /* _RD_SENSORS_H */