"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "bsd/kernel.cc" between
xosview-1.22.tar.gz and xosview-1.23.tar.gz

About: xosview is an X Windows based system monitor (cpu, memory, swap and network usage; interrupt and serial activities; load average).

kernel.cc  (xosview-1.22):kernel.cc  (xosview-1.23)
skipping to change at line 220 skipping to change at line 220
char errstring[_POSIX2_LINE_MAX]; char errstring[_POSIX2_LINE_MAX];
if (kd) if (kd)
return; // kd is non-NULL, so it has been initialized. BCG return; // kd is non-NULL, so it has been initialized. BCG
/* Open it read-only, for a little added safety. */ /* Open it read-only, for a little added safety. */
/* If the first character of kernelFileName is not '\0', then use /* If the first character of kernelFileName is not '\0', then use
* that kernel file. Otherwise, use the default kernel, by * that kernel file. Otherwise, use the default kernel, by
* specifying NULL. */ * specifying NULL. */
if ((kd = kvm_openfiles((kernelFileName[0] ? kernelFileName : NULL), if ((kd = kvm_openfiles((kernelFileName[0] ? kernelFileName : NULL),
NULL, NULL, O_RDONLY, errstring)) == NULL) NULL, NULL, O_RDONLY, errstring)) == NULL) {
err(EX_OSFILE, "OpenKDIfNeeded(): %s", errstring); warn("OpenKDIfNeeded(): %s", errstring);
return;
}
// Parenthetical note: FreeBSD kvm_openfiles() uses getbootfile() to get // Parenthetical note: FreeBSD kvm_openfiles() uses getbootfile() to get
// the correct kernel file if the 1st arg is NULL. As far as I can see, // the correct kernel file if the 1st arg is NULL. As far as I can see,
// one should always use NULL in FreeBSD, but I suppose control is never a // one should always use NULL in FreeBSD, but I suppose control is never a
// bad thing... (pavel 21-Jan-1998) // bad thing... (pavel 21-Jan-1998)
/* Now grab the symbol offsets for the symbols that we want. */ /* Now grab the symbol offsets for the symbols that we want. */
if (kvm_nlist(kd, nlst) < 0) if (kvm_nlist(kd, nlst) < 0)
err(EX_OSERR, "Could not get kvm symbols"); err(EX_OSERR, "Could not get kvm symbols");
skipping to change at line 277 skipping to change at line 279
cpu_speed /= avail_cpus; cpu_speed /= avail_cpus;
#elif defined(XOSVIEW_OPENBSD) #elif defined(XOSVIEW_OPENBSD)
size = sizeof(cpu_speed); size = sizeof(cpu_speed);
if ( sysctl(mib_spd, 2, &cpu_speed, &size, NULL, 0) < 0 ) if ( sysctl(mib_spd, 2, &cpu_speed, &size, NULL, 0) < 0 )
err(EX_OSERR, "syscl hw.cpuspeed failed"); err(EX_OSERR, "syscl hw.cpuspeed failed");
#else /* XOSVIEW_NETBSD || XOSVIEW_DFBSD */ #else /* XOSVIEW_NETBSD || XOSVIEW_DFBSD */
uint64_t speed = 0; uint64_t speed = 0;
size = sizeof(speed); size = sizeof(speed);
#if defined(XOSVIEW_NETBSD) #if defined(XOSVIEW_NETBSD)
if ( sysctlbyname("machdep.tsc_freq", &speed, &size, NULL, 0) < 0 ) if ( sysctlbyname("machdep.tsc_freq", &speed, &size, NULL, 0) < 0 )
err(EX_OSERR, "sysctl machdep.tsc_freq failed"); warn("sysctl machdep.tsc_freq failed");
#else /* XOSVIEW_DFBSD */ #else /* XOSVIEW_DFBSD */
if ( sysctlbyname("hw.tsc_frequency", &speed, &size, NULL, 0) < 0 ) if ( sysctlbyname("hw.tsc_frequency", &speed, &size, NULL, 0) < 0 )
err(EX_OSERR, "sysctl hw.tsc_frequency failed"); err(EX_OSERR, "sysctl hw.tsc_frequency failed");
#endif #endif
cpu_speed = speed / 1000000; cpu_speed = speed / 1000000;
#endif #endif
return cpu_speed; return cpu_speed;
} }
// -------------------- PageMeter & MemMeter functions ----------------------- // -------------------- PageMeter & MemMeter functions -----------------------
 End of changes. 2 change blocks. 
3 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)