turbostat: use kill() to force sample by turbostat

This is more reliable than using a PTY and allows us to use a regular
pipe to output data into a GIOChannel. This also changes the design to
use async IO watches for sample delivery.
This commit is contained in:
Christian Hergert
2019-07-31 13:08:42 -07:00
parent fc013fe99f
commit f9f7e29e54
3 changed files with 149 additions and 246 deletions

View File

@ -36,11 +36,12 @@ typedef struct
gdouble ram_watt;
} SysprofTurbostatSample;
SysprofTurbostat *sysprof_turbostat_new (void);
SysprofTurbostat *sysprof_turbostat_new (GFunc sample_func,
gpointer sample_data);
gboolean sysprof_turbostat_start (SysprofTurbostat *self,
GError **error);
void sysprof_turbostat_stop (SysprofTurbostat *self);
GArray *sysprof_turbostat_sample (SysprofTurbostat *self,
gboolean sysprof_turbostat_sample (SysprofTurbostat *self,
GError **error);
void sysprof_turbostat_free (SysprofTurbostat *self);