Commit a54801ee authored by unknown's avatar unknown

NDB ndb_mgm: fix dump and signal log (more to do)


ndb/include/mgmapi/mgmapi.h:
  ndb_mgm: fix dump and signal log (more to do)
ndb/src/common/debugger/signaldata/SignalNames.cpp:
  ndb_mgm: fix dump and signal log (more to do)
ndb/src/mgmapi/mgmapi.cpp:
  ndb_mgm: fix dump and signal log (more to do)
ndb/src/mgmclient/CommandInterpreter.cpp:
  ndb_mgm: fix dump and signal log (more to do)
parent 9addd5f7
...@@ -122,7 +122,10 @@ extern "C" { ...@@ -122,7 +122,10 @@ extern "C" {
/* Service errors - Single User Mode */ /* Service errors - Single User Mode */
NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001, NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE = 4001,
NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002 NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE = 4002,
/* Usage errors */
NDB_MGM_USAGE_ERROR = 5001
}; };
struct Ndb_Mgm_Error_Msg { struct Ndb_Mgm_Error_Msg {
...@@ -158,7 +161,11 @@ extern "C" { ...@@ -158,7 +161,11 @@ extern "C" {
{ NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE, { NDB_MGM_COULD_NOT_ENTER_SINGLE_USER_MODE,
"Could not enter single user mode" }, "Could not enter single user mode" },
{ NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE, { NDB_MGM_COULD_NOT_EXIT_SINGLE_USER_MODE,
"Could not exit single user mode" } "Could not exit single user mode" },
/* Usage errors */
{ NDB_MGM_USAGE_ERROR,
"Usage error" }
}; };
const int ndb_mgm_noOfErrorMsgs = const int ndb_mgm_noOfErrorMsgs =
......
...@@ -446,6 +446,8 @@ const GsnName SignalNames [] = { ...@@ -446,6 +446,8 @@ const GsnName SignalNames [] = {
,{ GSN_STOP_REQ, "STOP_REQ" } ,{ GSN_STOP_REQ, "STOP_REQ" }
,{ GSN_STOP_REF, "STOP_REF" } ,{ GSN_STOP_REF, "STOP_REF" }
,{ GSN_API_VERSION_REQ, "API_VERSION_REQ" }
,{ GSN_API_VERSION_CONF, "API_VERSION_CONF" }
,{ GSN_ABORT_ALL_REQ, "ABORT_ALL_REQ" } ,{ GSN_ABORT_ALL_REQ, "ABORT_ALL_REQ" }
,{ GSN_ABORT_ALL_REF, "ABORT_ALL_REF" } ,{ GSN_ABORT_ALL_REF, "ABORT_ALL_REF" }
......
...@@ -1153,11 +1153,14 @@ ndb_mgm_dump_state(NdbMgmHandle handle, int nodeId, int* _args, ...@@ -1153,11 +1153,14 @@ ndb_mgm_dump_state(NdbMgmHandle handle, int nodeId, int* _args,
CHECK_CONNECTED(handle, -1); CHECK_CONNECTED(handle, -1);
char buf[256]; char buf[256];
char buf2[6];
buf[0] = 0; buf[0] = 0;
for (int i = 0; i < _num_args; i++){ for (int i = 0; i < _num_args; i++){
snprintf(buf2, 6, "%d ", _args[i]); unsigned n = strlen(buf);
strncat(buf, buf2, 256); if (n + 20 > sizeof(buf)) {
SET_ERROR(handle, NDB_MGM_USAGE_ERROR, "arguments too long");
return -1;
}
sprintf(buf + n, "%s%d", i ? " " : "", _args[i]);
} }
Properties args; Properties args;
......
...@@ -1363,36 +1363,29 @@ CommandInterpreter::executeLog(int processId, ...@@ -1363,36 +1363,29 @@ CommandInterpreter::executeLog(int processId,
if (! parseBlockSpecification(parameters, blocks)) { if (! parseBlockSpecification(parameters, blocks)) {
return; return;
} }
int len=0; int len=1;
Uint32 i; Uint32 i;
for(i=0; i<blocks.size(); i++) { for(i=0; i<blocks.size(); i++) {
ndbout_c("blocks %s %d",blocks[i], strlen(blocks[i])); len += strlen(blocks[i]) + 1;
len += strlen(blocks[i]);
} }
len += blocks.size()*2;
char * blockNames = (char*)my_malloc(len,MYF(MY_WME)); char * blockNames = (char*)my_malloc(len,MYF(MY_WME));
My_auto_ptr<char> ap1(blockNames); My_auto_ptr<char> ap1(blockNames);
blockNames[0] = 0;
for(i=0; i<blocks.size(); i++) { for(i=0; i<blocks.size(); i++) {
strcat(blockNames, blocks[i]); strcat(blockNames, blocks[i]);
strcat(blockNames, "|"); strcat(blockNames, "|");
} }
strcat(blockNames, "\0");
ndbout_c("blocknames %s", blockNames);
/*int res =*/ndb_mgm_log_signals(m_mgmsrv, int result = ndb_mgm_log_signals(m_mgmsrv,
processId, processId,
NDB_MGM_SIGNAL_LOG_MODE_INOUT, NDB_MGM_SIGNAL_LOG_MODE_INOUT,
blockNames, blockNames,
&reply); &reply);
#if 0
int result =
_mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::InOut, blocks);
if (result != 0) { if (result != 0) {
ndbout << _mgmtSrvr.getErrorText(result) << endl; ndbout_c("Execute LOG on node %d failed.", processId);
printError();
} }
#endif
} }
//***************************************************************************** //*****************************************************************************
...@@ -1401,17 +1394,7 @@ void ...@@ -1401,17 +1394,7 @@ void
CommandInterpreter::executeLogIn(int /* processId */, CommandInterpreter::executeLogIn(int /* processId */,
const char* parameters, bool /* all */) const char* parameters, bool /* all */)
{ {
Vector<const char*> blocks; ndbout << "Command LOGIN not implemented." << endl;
if (! parseBlockSpecification(parameters, blocks)) {
return;
}
#if 0
int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::In, blocks);
if (result != 0) {
ndbout << _mgmtSrvr.getErrorText(result) << endl;
}
#endif
} }
//***************************************************************************** //*****************************************************************************
...@@ -1420,19 +1403,7 @@ void ...@@ -1420,19 +1403,7 @@ void
CommandInterpreter::executeLogOut(int /*processId*/, CommandInterpreter::executeLogOut(int /*processId*/,
const char* parameters, bool /*all*/) const char* parameters, bool /*all*/)
{ {
Vector<const char*> blocks; ndbout << "Command LOGOUT not implemented." << endl;
if (! parseBlockSpecification(parameters, blocks)) {
return;
}
#if 0
int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::Out,
blocks);
if (result != 0) {
ndbout << _mgmtSrvr.getErrorText(result) << endl;
}
#endif
} }
//***************************************************************************** //*****************************************************************************
...@@ -1441,57 +1412,45 @@ void ...@@ -1441,57 +1412,45 @@ void
CommandInterpreter::executeLogOff(int /*processId*/, CommandInterpreter::executeLogOff(int /*processId*/,
const char* parameters, bool /*all*/) const char* parameters, bool /*all*/)
{ {
Vector<const char*> blocks; ndbout << "Command LOGOFF not implemented." << endl;
if (! parseBlockSpecification(parameters, blocks)) {
return;
}
#if 0
int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::Off,
blocks);
if (result != 0) {
ndbout << _mgmtSrvr.getErrorText(result) << endl;
}
#endif
} }
//***************************************************************************** //*****************************************************************************
//***************************************************************************** //*****************************************************************************
void void
CommandInterpreter::executeTestOn(int /*processId*/, CommandInterpreter::executeTestOn(int processId,
const char* parameters, bool /*all*/) const char* parameters, bool /*all*/)
{ {
if (! emptyString(parameters)) { if (! emptyString(parameters)) {
ndbout << "No parameters expected to this command." << endl; ndbout << "No parameters expected to this command." << endl;
return; return;
} }
connect();
#if 0 struct ndb_mgm_reply reply;
int result = _mgmtSrvr.startSignalTracing(processId); int result = ndb_mgm_start_signallog(m_mgmsrv, processId, &reply);
if (result != 0) { if (result != 0) {
ndbout << _mgmtSrvr.getErrorText(result) << endl; ndbout_c("Execute TESTON failed.");
printError();
} }
#endif
} }
//***************************************************************************** //*****************************************************************************
//***************************************************************************** //*****************************************************************************
void void
CommandInterpreter::executeTestOff(int /*processId*/, CommandInterpreter::executeTestOff(int processId,
const char* parameters, bool /*all*/) const char* parameters, bool /*all*/)
{ {
if (! emptyString(parameters)) { if (! emptyString(parameters)) {
ndbout << "No parameters expected to this command." << endl; ndbout << "No parameters expected to this command." << endl;
return; return;
} }
connect();
#if 0 struct ndb_mgm_reply reply;
int result = _mgmtSrvr.stopSignalTracing(processId); int result = ndb_mgm_stop_signallog(m_mgmsrv, processId, &reply);
if (result != 0) { if (result != 0) {
ndbout << _mgmtSrvr.getErrorText(result) << endl; ndbout_c("Execute TESTOFF failed.");
printError();
} }
#endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment