1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 12:10:03 +00:00

Removing $freq_dyn and $freq_dyn_g

I have decided to remove $freq_dyn and $freq_dyn_g due to license issues
(see sf.net tracker bug #2166612)
This commit is contained in:
Brenden Matthews 2008-12-07 15:15:57 -07:00
parent 6aa61e6dff
commit 6fab949926
3 changed files with 4 additions and 82 deletions

View File

@ -1,3 +1,7 @@
2008-12-07
* Removing $freq_dyn and $freq_dyn_g due to license issues (see sf.net
tracker bug #2166612)
2008-12-06
* Switching from svn to git repository. The repo can be viewed from
http://git.omp.am/?p=conky.git;a=summary and you can clone the repo with:

View File

@ -1161,8 +1161,6 @@ enum text_object_type {
OBJ_execpi,
OBJ_freq,
OBJ_freq_g,
OBJ_freq_dyn,
OBJ_freq_dyn_g,
OBJ_fs_bar,
OBJ_fs_bar_free,
OBJ_fs_free,
@ -2690,8 +2688,6 @@ static struct text_object *construct_text_object(const char *s,
#endif /* HAVE_IWLIB */
#endif /* __linux__ */
END OBJ(freq_dyn, 0)
END OBJ(freq_dyn_g, 0)
#ifndef __OpenBSD__
END OBJ(acpifan, 0)
@ -4905,19 +4901,6 @@ static void generate_text_internal(char *p, int p_max_size,
#endif /* __linux__ */
OBJ(freq_dyn) {
get_freq_dynamic(p, p_max_size, "%.0f", 1);
spaced_print(p, p_max_size, "%s", 6, "freq_dyn", p);
}
OBJ(freq_dyn_g) {
#ifndef __OpenBSD__
get_freq_dynamic(p, p_max_size, "%'.2f", 1000);
#else
get_freq_dynamic(p, p_max_size, "%.2f", 1000);
#endif
spaced_print(p, p_max_size, "%s", 6, "freq_dyn", p);
}
#ifndef __OpenBSD__
OBJ(adt746xcpu) {
get_adt746x_cpu(p, p_max_size);

View File

@ -1046,71 +1046,6 @@ void get_adt746x_cpu(char *p_client_buffer, size_t client_buffer_size)
snprintf(p_client_buffer, client_buffer_size, "%s", adt746x_cpu_state);
}
/* Thanks to "Walt Nelson" <wnelsonjr@comcast.net> */
/***********************************************************************/
/* This file is part of x86info.
* (C) 2001 Dave Jones.
*
* Licensed under the terms of the GNU GPL License version 2.
*
* Estimate CPU MHz routine by Andrea Arcangeli <andrea@suse.de>
* Small changes by David Sterba <sterd9am@ss1000.ms.mff.cuni.cz> */
#if defined(__i386) || defined(__x86_64)
unsigned long long int rdtsc(void)
{
unsigned long long int x;
unsigned int a, d;
__asm__ volatile(".byte 0x0f, 0x31":"=a" (a),"=d" (d));
x = d;
return x << 32 | a;
}
#endif
/* return system frequency in MHz (use divisor=1) or GHz (use divisor=1000) */
void get_freq_dynamic(char *p_client_buffer, size_t client_buffer_size,
const char *p_format, int divisor)
{
#if defined(__i386) || defined(__x86_64)
struct timezone tz;
struct timeval tvstart, tvstop;
unsigned long long cycles[2]; /* gotta be 64 bit */
unsigned int microseconds; /* total time taken */
if (!p_client_buffer || client_buffer_size <= 0 || !p_format
|| divisor <= 0) {
return;
}
memset(&tz, 0, sizeof(tz));
/* get this function in cached memory */
gettimeofday(&tvstart, &tz);
cycles[0] = rdtsc();
gettimeofday(&tvstart, &tz);
/* we don't trust that this is any specific length of time */
usleep(100);
cycles[1] = rdtsc();
gettimeofday(&tvstop, &tz);
microseconds = ((tvstop.tv_sec - tvstart.tv_sec) * 1000000) +
(tvstop.tv_usec - tvstart.tv_usec);
snprintf(p_client_buffer, client_buffer_size, p_format,
(float) ((cycles[1] - cycles[0]) / microseconds) / divisor);
return;
#else
/* FIXME: hardwired: get freq for first cpu!
* this whole function needs to be rethought and redone for
* multi-cpu/multi-core/multi-threaded environments and
* arbitrary combinations thereof */
get_freq(p_client_buffer, client_buffer_size, p_format, divisor, 1);
return;
#endif
}
#define CPUFREQ_PREFIX "/sys/devices/system/cpu"
#define CPUFREQ_POSTFIX "cpufreq/scaling_cur_freq"