aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/hud/hud_context.c
diff options
context:
space:
mode:
authorSteven Toth <[email protected]>2016-09-30 05:58:00 -0600
committerBrian Paul <[email protected]>2016-09-30 15:18:46 -0600
commite99b9395befe5b8612df3163b4deec2a0c0cb702 (patch)
treefd87cd03eb3d1c3b44a737b70223213739daa17d /src/gallium/auxiliary/hud/hud_context.c
parent7b87190d2b778952713a02a075fb05f8b5803ca9 (diff)
gallium/hud: Add support for CPU frequency monitoring
Detect all of the CPUs in the system. Expose metrics for min, max and current frequency in Hz. Signed-off-by: Steven Toth <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_context.c')
-rw-r--r--src/gallium/auxiliary/hud/hud_context.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 31e81f05fe1..3772f3cc2a5 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -1044,6 +1044,18 @@ hud_parse_env_var(struct hud_context *hud, const char *env)
hud_diskstat_graph_install(pane, arg_name, DISKSTAT_WR);
pane->type = PIPE_DRIVER_QUERY_TYPE_BYTES;
}
+ else if (sscanf(name, "cpufreq-min-cpu%u", &i) == 1) {
+ hud_cpufreq_graph_install(pane, i, CPUFREQ_MINIMUM);
+ pane->type = PIPE_DRIVER_QUERY_TYPE_HZ;
+ }
+ else if (sscanf(name, "cpufreq-cur-cpu%u", &i) == 1) {
+ hud_cpufreq_graph_install(pane, i, CPUFREQ_CURRENT);
+ pane->type = PIPE_DRIVER_QUERY_TYPE_HZ;
+ }
+ else if (sscanf(name, "cpufreq-max-cpu%u", &i) == 1) {
+ hud_cpufreq_graph_install(pane, i, CPUFREQ_MAXIMUM);
+ pane->type = PIPE_DRIVER_QUERY_TYPE_HZ;
+ }
#endif
#if HAVE_LIBSENSORS
else if (sscanf(name, "sensors_temp_cu-%s", arg_name) == 1) {
@@ -1284,6 +1296,7 @@ print_help(struct pipe_screen *screen)
#if HAVE_GALLIUM_EXTRA_HUD
hud_get_num_disks(1);
hud_get_num_nics(1);
+ hud_get_num_cpufreq(1);
#endif
#if HAVE_LIBSENSORS
hud_get_num_sensors(1);