forked from enlightenment/evisum
cpu: basic freq.
This commit is contained in:
parent
74efbb1178
commit
0781f707d5
|
@ -97,6 +97,9 @@ system_cpu_usage_get(int *ncpu);
|
||||||
cpu_core_t **
|
cpu_core_t **
|
||||||
system_cpu_usage_delayed_get(int *ncpu, int usecs);
|
system_cpu_usage_delayed_get(int *ncpu, int usecs);
|
||||||
|
|
||||||
|
int
|
||||||
|
system_cpu_frequency_get(void);
|
||||||
|
|
||||||
void
|
void
|
||||||
system_memory_usage_get(meminfo_t *memory);
|
system_memory_usage_get(meminfo_t *memory);
|
||||||
|
|
||||||
|
|
|
@ -279,3 +279,24 @@ system_cpu_usage_get(int *ncpu)
|
||||||
return system_cpu_usage_delayed_get(ncpu, 1000000);
|
return system_cpu_usage_delayed_get(ncpu, 1000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
system_cpu_frequency_get(void)
|
||||||
|
{
|
||||||
|
int freq = -1;
|
||||||
|
|
||||||
|
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||||
|
size_t len = sizeof(freq);
|
||||||
|
if (sysctlbyname("dev.cpu.0.freq", &freq, &len, NULL, 0) != -1)
|
||||||
|
freq *= 1000;
|
||||||
|
#elif defined(__OpenBSD__)
|
||||||
|
int mib[2] = { CTL_HW, HW_CPUSPEED };
|
||||||
|
size_t len = sizeof(freq);
|
||||||
|
if (sysctl(mib, sizeof(mib), &freq, &len, NULL, 0) != -1)
|
||||||
|
freq *= 1000;
|
||||||
|
#elif defined(__linux__)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#endif
|
||||||
|
return freq;
|
||||||
|
}
|
||||||
|
|
|
@ -1671,6 +1671,7 @@ _system_info_all_poll_feedback_cb(void *data, Ecore_Thread *thread, void *msg)
|
||||||
if (ui->zfs_mounted)
|
if (ui->zfs_mounted)
|
||||||
info->memory.used += info->memory.zfs_arc_used;
|
info->memory.used += info->memory.zfs_arc_used;
|
||||||
|
|
||||||
|
printf("it is %d\n", system_cpu_frequency_get());
|
||||||
pb = ui->progress_mem;
|
pb = ui->progress_mem;
|
||||||
ratio = info->memory.total / 100.0;
|
ratio = info->memory.total / 100.0;
|
||||||
value = info->memory.used / ratio;
|
value = info->memory.used / ratio;
|
||||||
|
|
|
@ -270,6 +270,7 @@ about_anim(void *data)
|
||||||
ad = data;
|
ad = data;
|
||||||
|
|
||||||
evas_object_geometry_get(ad->bg, NULL, NULL, &w, &h);
|
evas_object_geometry_get(ad->bg, NULL, NULL, &w, &h);
|
||||||
|
if (w <= 0 || h <= 0) return EINA_TRUE;
|
||||||
evas_object_geometry_get(ad->label, &x, NULL, &ow, &oh);
|
evas_object_geometry_get(ad->label, &x, NULL, &ow, &oh);
|
||||||
evas_object_move(ad->label, x, ad->pos);
|
evas_object_move(ad->label, x, ad->pos);
|
||||||
evas_object_show(ad->label);
|
evas_object_show(ad->label);
|
||||||
|
@ -504,6 +505,7 @@ _anim_clouds(void *data)
|
||||||
ui = anim->ui;
|
ui = anim->ui;
|
||||||
|
|
||||||
evas_object_geometry_get(ui->win, NULL, NULL, &ww, &wh);
|
evas_object_geometry_get(ui->win, NULL, NULL, &ww, &wh);
|
||||||
|
if (ww <= 0 || wh <= 0) return EINA_TRUE;
|
||||||
evas_object_image_size_get(anim->im, &iw, &ih);
|
evas_object_image_size_get(anim->im, &iw, &ih);
|
||||||
|
|
||||||
if (ww > iw) iw = ww;
|
if (ww > iw) iw = ww;
|
||||||
|
@ -537,8 +539,8 @@ _anim_clouds(void *data)
|
||||||
evas_object_show(anim->bolt);
|
evas_object_show(anim->bolt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bolt && bolt % 2) evas_object_hide(anim->bolt);
|
if (bolt && (bolt % 2)) evas_object_hide(anim->bolt);
|
||||||
if (bolt > 30)
|
if (bolt > 20)
|
||||||
{
|
{
|
||||||
evas_object_hide(anim->bolt);
|
evas_object_hide(anim->bolt);
|
||||||
bolt = 0;
|
bolt = 0;
|
||||||
|
|
Loading…
Reference in New Issue