rcapd_main.c revision f1710550bd8341486e7494e781335ba875c9b12c
0N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A#include <stdio_ext.h>
0N/A#include "rcapd_mapping.h"
0N/A#include "rcapd_rfd.h"
0N/A#include "rcapd_stat.h"
0N/A#define POSITIVE_MIN(x, y) \
0N/Atypedef struct soft_scan_arg {
0N/Aint should_run;
0N/Astatic int should_reconfigure;
0N/Astatic int verify_statistics(void);
0N/Astatic int update_statistics(void);
abort();
(int)pid);
int fd;
int can_try_uncached;
if (cached_fd >= 0) {
can_try_uncached = 0;
if (fd >= 0) {
if (excess > 0)
(long long)excess);
update_phys_total(void)
if (termination_signal == 0)
should_run = 0;
scan_abort();
abort();
finish_configuration(void)
update_statistics) != 0)
reconfigure(void)
"ineffective/scans/unenforced/samplings: %llu/%llu/%llu/%llu, RSS "
/ MILLISEC));
update_statistics(void)
if (fd >= 0) {
sizeof (rs)) {
return (res);
verify_statistics(void)
return (update_statistics());
rcapd_usage(void)
check_update_statistics(void)
if (update_statistics() != 0)
int res;
ever_ran = 0;
switch (res) {
should_fork = 0;
if (debug_mode == 0) {
should_fork = 0;
rcapd_usage();
return (E_USAGE);
if (child > 0)
verify_statistics) != 0)
should_reconfigure = 0;
while (should_run != 0) {
if (ever_ran == 0) {
reconfigure();
if (next_report == 0 &&
if (next_proc_walk == 0 &&
if (next_rss_sample == 0 &&
should_reconfigure = 0;
if (memory_pressure >
if (enforce_soft_caps == 0) {
enforce_soft_caps = 0;
if (old_sp == 0)
if (global_scanner_running == 0) {
(enforce_soft_caps == 0)))
&arg);
if (termination_signal != 0)
if (ever_ran != 0)
return (E_SUCCESS);