tools/Master.cpp
changeset 956 d9b9bc794d10
parent 951 dc84a0af63da
child 957 ed5ac2e83495
equal deleted inserted replaced
955:9b1c277a1b34 956:d9b9bc794d10
    70         for (i = 0; i < numDomains; i++) {
    70         for (i = 0; i < numDomains; i++) {
    71             outputDomainData(i);
    71             outputDomainData(i);
    72         }
    72         }
    73     } else {
    73     } else {
    74         outputDomainData(domainIndex);
    74         outputDomainData(domainIndex);
       
    75     }
       
    76 }
       
    77 
       
    78 /****************************************************************************/
       
    79 
       
    80 void Master::setDebug(const vector<string> &commandArgs)
       
    81 {
       
    82     stringstream str;
       
    83     int debugLevel;
       
    84     
       
    85     if (commandArgs.size() != 1) {
       
    86         stringstream err;
       
    87         err << "'debug' takes exactly one argument!";
       
    88         throw MasterException(err.str());
       
    89     }
       
    90 
       
    91     str << commandArgs[0];
       
    92     str >> debugLevel;
       
    93 
       
    94     if (str.fail()) {
       
    95         stringstream err;
       
    96         err << "Invalid debug level '" << commandArgs[0] << "'!";
       
    97         throw MasterException(err.str());
       
    98     }
       
    99 
       
   100     if (ioctl(fd, EC_IOCTL_DEBUG_LEVEL, debugLevel) < 0) {
       
   101         stringstream err;
       
   102         err << "Failed to set debug level: " << strerror(errno);
       
   103         throw MasterException(err.str());
    75     }
   104     }
    76 }
   105 }
    77 
   106 
    78 /****************************************************************************/
   107 /****************************************************************************/
    79 
   108