int now_sec = fromstart.sec();
// do any catching up we need to
- while (now_sec - last_flush >= g_conf.log_interval) {
+ while (now_sec - last_flush >= g_conf.logger_interval) {
generic_dout(20) << "fromstart " << fromstart << " last_flush " << last_flush << " flushing" << dendl;
for (list<Logger*>::iterator p = logger_list.begin();
p != logger_list.end();
++p)
(*p)->_flush();
- last_flush += g_conf.log_interval;
+ last_flush += g_conf.logger_interval;
}
// schedule next flush event
utime_t next;
- next.sec_ref() = start.sec() + last_flush + g_conf.log_interval;
+ next.sec_ref() = start.sec() + last_flush + g_conf.logger_interval;
next.usec_ref() = start.usec();
generic_dout(20) << "logger now=" << now
<< " start=" << start
Mutex::Locker l(logger_lock);
struct stat st;
- if (!g_conf.log)
+ if (!g_conf.logger)
return;
filename = "";
::mkdir(filename.c_str(), 0750);
filename += "/";
- if (g_conf.log_name) {
- filename += g_conf.log_name;
+ if (g_conf.logger_subdir) {
+ filename += g_conf.logger_subdir;
::mkdir( filename.c_str(), 0755 ); // make sure dir exists
filename += "/";
}
long Logger::inc(int key, long v)
{
- if (!open || !g_conf.log)
+ if (!open || !g_conf.logger)
return 0;
logger_lock.Lock();
int i = type->lookup_key(key);
double Logger::finc(int key, double v)
{
- if (!open || !g_conf.log)
+ if (!open || !g_conf.logger)
return 0;
logger_lock.Lock();
int i = type->lookup_key(key);
long Logger::set(int key, long v)
{
- if (!open || !g_conf.log)
+ if (!open || !g_conf.logger)
return 0;
logger_lock.Lock();
int i = type->lookup_key(key);
double Logger::fset(int key, double v)
{
- if (!open || !g_conf.log)
+ if (!open || !g_conf.logger)
return 0;
logger_lock.Lock();
int i = type->lookup_key(key);
double Logger::favg(int key, double v)
{
- if (!open || !g_conf.log)
+ if (!open || !g_conf.logger)
return 0;
logger_lock.Lock();
int i = type->lookup_key(key);
long Logger::get(int key)
{
- if (!open || !g_conf.log)
+ if (!open || !g_conf.logger)
return 0;
logger_lock.Lock();
int i = type->lookup_key(key);
void _dout_open_log()
{
// logging enabled?
- if (!(g_conf.dout_dir && g_conf.file_logs)) {
+ if (!(g_conf.log_dir && g_conf.file_logs)) {
_dout_need_open = false;
return;
}
// calculate log dir, filename, etc.
if (!_dout_path[0]) {
- if (g_conf.dout_dir[0] == '/')
- strcpy(_dout_dir, g_conf.dout_dir);
+ if (g_conf.log_dir[0] == '/')
+ strcpy(_dout_dir, g_conf.log_dir);
else {
getcwd(_dout_dir, 100);
strcat(_dout_dir, "/");
- strcat(_dout_dir, g_conf.dout_dir);
+ strcat(_dout_dir, g_conf.log_dir);
}
- if (g_conf.dout_sym_dir[0] == '/')
- strcpy(_dout_symlink_dir, g_conf.dout_sym_dir);
+ if (g_conf.log_sym_dir[0] == '/')
+ strcpy(_dout_symlink_dir, g_conf.log_sym_dir);
else {
getcwd(_dout_symlink_dir, 100);
strcat(_dout_symlink_dir, "/");
- strcat(_dout_symlink_dir, g_conf.dout_sym_dir);
+ strcat(_dout_symlink_dir, g_conf.log_sym_dir);
}
char hostname[80];
int _dout_rename_output_file() // after calling daemon()
{
- if (g_conf.dout_dir && g_conf.file_logs) {
+ if (g_conf.log_dir && g_conf.file_logs) {
char oldpath[1000];
char hostname[80];
gethostname(hostname, 79);
int _dout_create_courtesy_output_symlink(const char *type, int n)
{
- if (g_conf.dout_dir && g_conf.file_logs) {
+ if (g_conf.log_dir && g_conf.file_logs) {
if (_dout_need_open)
_dout_open_log();
file_logs: false,
// profiling and debugging
- log: true,
- log_interval: 1,
- log_name: (char*)0,
-
- log_messages: true,
- log_pins: true,
-
+ logger: true,
+ logger_interval: 1,
logger_calc_variance: true,
-
- dout_dir: INSTALL_PREFIX "/var/log/ceph", // if daemonize == true
- dout_sym_dir: INSTALL_PREFIX "/var/log/ceph", // if daemonize == true
+ logger_subdir: 0,
logger_dir: INSTALL_PREFIX "/var/log/ceph/stat",
+
+ log_dir: INSTALL_PREFIX "/var/log/ceph", // if daemonize == true
+ log_sym_dir: INSTALL_PREFIX "/var/log/ceph", // if daemonize == true
+
pid_file: 0,
conf_file: INSTALL_PREFIX "/etc/ceph/ceph.conf",
CF_READ("global", "num mds", num_mds);
CF_READ("global", "num osd", num_osd);
CF_READ("global", "mkfs", mkfs);
+ CF_READ_STR("global", "monmap file", monmap_file);
CF_READ("global", "daemonize", daemonize);
CF_READ("global", "file logs", file_logs);
- CF_READ("global", "log", log);
- CF_READ("global", "log interval", log_interval);
- CF_READ_STR("global", "log name", log_name);
- CF_READ("global", "log messages", log_messages);
- CF_READ("global", "log pins", log_pins);
- CF_READ_STR("global", "dout dir", dout_dir);
- CF_READ_STR("global", "dout sym dir", dout_sym_dir);
+ CF_READ("global", "logger", logger);
+ CF_READ("global", "logger interval", logger_interval);
+ CF_READ_STR("global", "logger calc variance", logger_subdir);
+ CF_READ_STR("global", "logger subdir", logger_subdir);
CF_READ_STR("global", "logger dir", logger_dir);
+
+ CF_READ_STR("global", "log dir", log_dir);
+ CF_READ_STR("global", "log sym dir", log_sym_dir);
+
CF_READ_STR("global", "pid file", pid_file);
- CF_READ_STR("global", "monmap file", monmap_file);
+
CF_READ("global", "chdir root", chdir_root);
CF_READ("debug", "debug", debug);
//g_conf.fake_osd_sync = atoi(args[++i]);
- else if (strcmp(args[i], "--dout_dir") == 0 && isarg)
- g_conf.dout_dir = args[++i];
+ else if (strcmp(args[i], "--log_dir") == 0 && isarg)
+ g_conf.log_dir = args[++i];
else if (//strcmp(args[i], "-o") == 0 ||
- strcmp(args[i], "--dout_sym_dir") == 0 && isarg)
- g_conf.dout_sym_dir = args[++i];
+ strcmp(args[i], "--log_sym_dir") == 0 && isarg)
+ g_conf.log_sym_dir = args[++i];
else if (strcmp(args[i], "--logger_dir") == 0 && isarg)
g_conf.logger_dir = args[++i];
else if ((strcmp(args[i], "--pid_file") == 0 ||
g_debug_after_conf = g_conf;
}
- else if (strcmp(args[i], "--log") == 0 && isarg)
- g_conf.log = atoi(args[++i]);
- else if (strcmp(args[i], "--log_name") == 0 && isarg)
- g_conf.log_name = args[++i];
+ else if (strcmp(args[i], "--logger") == 0 && isarg)
+ g_conf.logger = atoi(args[++i]);
+ else if (strcmp(args[i], "--logger_subdir") == 0 && isarg)
+ g_conf.logger_subdir = args[++i];
else if (strcmp(args[i], "--fakemessenger_serialize") == 0 && isarg)
g_conf.fakemessenger_serialize = atoi(args[++i]);
extern entity_addr_t g_my_addr;
struct md_config_t {
- int num_mon;
- int num_mds;
- int num_osd;
- int num_client;
+ int num_mon;
+ int num_mds;
+ int num_osd;
+ int num_client;
bool mkfs;
bool daemonize;
bool file_logs;
- // profiling
- bool log;
- int log_interval;
- const char *log_name;
-
- bool log_messages;
- bool log_pins;
-
+ // logger (profiling)
+ bool logger;
+ int logger_interval;
bool logger_calc_variance;
-
- const char *dout_dir;
- const char *dout_sym_dir;
+ const char *logger_subdir;
const char *logger_dir;
+
+ const char *log_dir;
+ const char *log_sym_dir;
+
const char *pid_file;
const char *conf_file;
done
-ARGS="--dout_dir /data/`hostname`"
+ARGS="--log_dir /data/`hostname`"
MOUNTOPTIONS="-o notreelog,flushoncommit"
ssh root@$host cd $HOME/ceph/src \; ./cosd --mkfs_for_osd $osd $devm # --osd_auto_weight 1
fi
echo starting cosd
- ssh root@$host cd $HOME/ceph/src \; ulimit -c unlimited \; ./crun $norestart ./cosd $devm --dout_dir /data/$host $COSD_ARGS -f &
+ ssh root@$host cd $HOME/ceph/src \; ulimit -c unlimited \; ./crun $norestart ./cosd $devm --log_dir /data/$host $COSD_ARGS -f &
done
done
//mds->logger->set("buf",buffer_total_alloc);
}
- if (g_conf.log_pins) {
+ //if (g_conf.log_pins) {
// pin
/*
for (int i=0; i<CInode::NUM_PINS; i++) {
it->second);
}
*/
- }
+ //}
}