libsysprof-ui: add hostinfo source when cpu is selected

This commit is contained in:
Christian Hergert
2019-05-18 18:54:55 -07:00
parent 318744d225
commit 210de8268e
4 changed files with 50 additions and 8 deletions

View File

@ -48,9 +48,25 @@ sysprof_cpu_aid_new (void)
return g_object_new (SYSPROF_TYPE_CPU_AID, NULL);
}
static void
sysprof_cpu_aid_prepare (SysprofAid *self,
SysprofProfiler *profiler)
{
g_autoptr(SysprofSource) source = NULL;
g_assert (SYSPROF_IS_CPU_AID (self));
g_assert (SYSPROF_IS_PROFILER (profiler));
source = sysprof_hostinfo_source_new ();
sysprof_profiler_add_source (profiler, source);
}
static void
sysprof_cpu_aid_class_init (SysprofCpuAidClass *klass)
{
SysprofAidClass *aid_class = SYSPROF_AID_CLASS (klass);
aid_class->prepare = sysprof_cpu_aid_prepare;
}
static void