Skip to content

Commit

Permalink
shmmonitor: add severity setting
Browse files Browse the repository at this point in the history
  • Loading branch information
rbx committed May 7, 2021
1 parent 2c89b24 commit b67b80e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion fairmq/shmem/Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class Manager
}

if (!p.empty()) {
boost::process::spawn(p, "-x", "-m", "--shmid", id, "-d", "-t", "2000", verbose ? "--verbose" : "", env);
boost::process::spawn(p, "-x", "-m", "--shmid", id, "-d", "-t", "2000", (verbose ? "--verbose" : ""), env);
int numTries = 0;
do {
try {
Expand Down
4 changes: 2 additions & 2 deletions fairmq/shmem/Monitor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ std::pair<std::string, bool> RunRemoval(std::function<bool(const std::string&)>
return {name, true};
} else {
if (verbose) {
LOG(info) << "Did not remove '" << name << "'. Already removed?";
LOG(debug) << "Did not remove '" << name << "'. Already removed?";
}
return {name, false};
}
Expand Down Expand Up @@ -525,7 +525,7 @@ std::vector<std::pair<std::string, bool>> Monitor::Cleanup(const ShmId& shmId, b
RegionCounter* rc = managementSegment.find<RegionCounter>(bipc::unique_instance).first;
if (rc) {
if (verbose) {
LOG(info) << "Region counter found: " << rc->fCount;
LOG(debug) << "Region counter found: " << rc->fCount;
}
uint16_t regionCount = rc->fCount;

Expand Down
4 changes: 4 additions & 0 deletions fairmq/shmem/runMonitor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ int main(int argc, char** argv)
bool listAll = false;
string listAllPath;
bool verbose = false;
string severity;
int userId = -1;

options_description desc("Options");
Expand All @@ -109,6 +110,7 @@ int main(int argc, char** argv)
("list-all" , value<bool>(&listAll)->implicit_value(true), "List all sessions & segments")
("list-all-path" , value<string>(&listAllPath)->default_value("/dev/shm/"),"Path for the --list-all command to search segments in")
("verbose" , value<bool>(&verbose)->implicit_value(true), "Verbose mode (daemon will output to a file 'fairmq-shmmonitor_<timestamp>')")
("severity" , value<string>(&severity)->default_value("info"), "Log severity")
("user-id" , value<int>(&userId)->default_value(-1), "User id (used with --get-shmid)")
("help,h", "Print help");

Expand All @@ -122,6 +124,8 @@ int main(int argc, char** argv)

notify(vm);

fair::Logger::SetConsoleSeverity(severity);

if (getShmId) {
if (userId == -1) {
LOG(info) << "shmem id for session '" << sessionName << "' and current user id " << geteuid()
Expand Down

0 comments on commit b67b80e

Please sign in to comment.