ToolctlMessages.h

Go to the documentation of this file.
00001 /* begin_generated_IBM_copyright_prolog                             */
00002 /*                                                                  */
00003 /* This is an automatically generated copyright prolog.             */
00004 /* After initializing,  DO NOT MODIFY OR MOVE                       */
00005 /* ================================================================ */
00006 /* IBM Confidential                                                 */
00007 /*                                                                  */
00008 /* Licensed Machine Code Source Materials                           */
00009 /*                                                                  */
00010 /* Product(s):                                                      */
00011 /*     Blue Gene/Q Licensed Machine Code                            */
00012 /*                                                                  */
00013 /* (C) Copyright IBM Corp.  2011, 2011                              */
00014 /*                                                                  */
00015 /* The Source code for this program is not published  or otherwise  */
00016 /* divested of its trade secrets,  irrespective of what has been    */
00017 /* deposited with the U.S. Copyright Office.                        */
00018 /* ================================================================ */
00019 /*                                                                  */
00020 /* end_generated_IBM_copyright_prolog                               */
00021 
00022 //! \file  ToolctlMessages.h
00023 //! \brief Declarations for bgcios::toolctl message classes.
00024 
00025 #ifndef TOOLCTLMESSAGES_H
00026 #define TOOLCTLMESSAGES_H
00027 
00028 // Includes
00029 //#include <ramdisk/include/services/MessageHeader.h>
00030 #include <inttypes.h>
00031 #include <sys/types.h>
00032 #include <sys/stat.h>
00033 #include <signal.h>
00034 
00035 namespace bgcios
00036 {
00037     namespace toolctl
00038     {
00039 
00040 //! Type for thread ids.
00041 typedef uint32_t BG_ThreadID_t;
00042 
00043 //! Type for virtual addresses.
00044 typedef uint64_t BG_Addr_t;
00045 
00046 //! Type for special, general purpose, and debug registers.
00047 typedef uint64_t BG_Reg_t;
00048 
00049 //! Type for signal set;
00050 typedef uint64_t BG_Sigset_t;
00051 
00052 
00053 //-------------------------------
00054 // Constants
00055 //-------------------------------
00056 
00057 //! Base port number for RDMA connections.
00058 const uint16_t BaseRdmaPort = 7614;
00059 
00060 //! Current version of protocol.
00061 const uint8_t ProtocolVersion = 4;
00062 
00063 //! Maximum number of query commands in one message.
00064 const uint16_t MaxQueryCommands   = 16;
00065 
00066 //! Maximum number of update commands in one message.
00067 const uint16_t MaxUpdateCommands  =  16;
00068 
00069 //! Maximum number of bytes of memory in GetMemoryAck and SetMemory commands.
00070 const uint32_t MaxMemorySize = 65024;
00071 
00072 //! Maximum number of thread ids in GetThreadListAck command.
00073 const uint32_t MaxThreadIds = 1024;
00074 
00075 //! Maximum number of aux vector words in GetAuxVectorAck command.
00076 const uint32_t MaxAuxVecDWords = 32;
00077 
00078 //! Maximum number of stack frames in GetThreadDataAck command.
00079 const uint32_t MaxStackFrames = 400;
00080 
00081 //! Number of general purpose registers.
00082 const uint32_t NumGPRegs = 32;
00083 
00084 //! Number of floating point registers.
00085 const uint32_t NumFPRegs = 32;
00086 
00087 //! Priority level for query access in Attach message.
00088 const uint8_t QueryPriorityLevel = 0;
00089 
00090 //! Minimum priority level for update access in Attach message.
00091 const uint8_t MinUpdatePriorityLevel = 1;
00092 
00093 //! Maximum priority level for update access in Attach message.
00094 const uint8_t MaxUpdatePriorityLevel = 99;
00095 
00096 //! Maximum number of active tools.
00097 const size_t MaxActiveTools = 4;
00098 
00099 //! Maximum number of ranks per compute node.
00100 const uint16_t MaxRanksPerNode = 64;
00101 
00102 //! Maximum pathname size for persistent files
00103 const uint16_t MaxPersistPathnameSize = 128;
00104 
00105 //! Maximum number of persistent files to be returned
00106 const uint16_t MaxPersistPathnames = 256;
00107 
00108 //!Tool tag size
00109 const uint16_t ToolTagSize = 8;
00110 
00111 //! Message types
00112 
00113 const uint16_t ErrorAck           = 5000;
00114 const uint16_t Attach             = 5001;
00115 const uint16_t AttachAck          = 5002;
00116 const uint16_t Detach             = 5003;
00117 const uint16_t DetachAck          = 5004;
00118 const uint16_t Query              = 5005;
00119 const uint16_t QueryAck           = 5006;
00120 const uint16_t Update             = 5007;
00121 const uint16_t UpdateAck          = 5008;
00122 const uint16_t SetupJob           = 5009;
00123 const uint16_t SetupJobAck        = 5010;
00124 const uint16_t Notify             = 5011;
00125 const uint16_t NotifyAck          = 5012;
00126 const uint16_t Control            = 5013;
00127 const uint16_t ControlAck         = 5014;
00128 
00129 //! Command types for Query and QueryAck messages.
00130 
00131 const uint16_t GetSpecialRegs     = 101;
00132 const uint16_t GetSpecialRegsAck  = 102;
00133 const uint16_t GetGeneralRegs     = 103;
00134 const uint16_t GetGeneralRegsAck  = 104;
00135 const uint16_t GetFloatRegs       = 105;
00136 const uint16_t GetFloatRegsAck    = 106;
00137 const uint16_t GetDebugRegs       = 107;
00138 const uint16_t GetDebugRegsAck    = 108;
00139 const uint16_t GetMemory          = 109;
00140 const uint16_t GetMemoryAck       = 110;
00141 const uint16_t GetThreadList      = 111;
00142 const uint16_t GetThreadListAck   = 112;
00143 const uint16_t GetAuxVectors      = 113;
00144 const uint16_t GetAuxVectorsAck   = 114;
00145 const uint16_t GetProcessData     = 115;
00146 const uint16_t GetProcessDataAck  = 116;
00147 const uint16_t GetThreadData      = 117;
00148 const uint16_t GetThreadDataAck   = 118;
00149 const uint16_t GetPreferences     = 119;
00150 const uint16_t GetPreferencesAck  = 120;
00151 const uint16_t GetFilenames       = 121;
00152 const uint16_t GetFilenamesAck    = 122;
00153 const uint16_t GetFileStatData    = 123;
00154 const uint16_t GetFileStatDataAck = 124;
00155 const uint16_t GetFileContents    = 125;
00156 const uint16_t GetFileContentsAck = 126;
00157 
00158 //! Command types for Update and UpdateAck messages.
00159 
00160 const uint16_t SetGeneralReg            = 201;
00161 const uint16_t SetGeneralRegAck         = 202;
00162 const uint16_t SetFloatReg              = 203;
00163 const uint16_t SetFloatRegAck           = 204;
00164 const uint16_t SetDebugReg              = 205;
00165 const uint16_t SetDebugRegAck           = 206;
00166 const uint16_t SetMemory                = 207;
00167 const uint16_t SetMemoryAck             = 208;
00168 const uint16_t HoldThread               = 209;
00169 const uint16_t HoldThreadAck            = 210;
00170 const uint16_t ReleaseThread            = 211;
00171 const uint16_t ReleaseThreadAck         = 212;
00172 const uint16_t InstallTrapHandler       = 213;
00173 const uint16_t InstallTrapHandlerAck    = 214;
00174 const uint16_t AllocateMemory           = 215;
00175 const uint16_t AllocateMemoryAck        = 216;
00176 const uint16_t SendSignal               = 217;
00177 const uint16_t SendSignalAck            = 218;
00178 const uint16_t ContinueProcess          = 219;
00179 const uint16_t ContinueProcessAck       = 220;
00180 const uint16_t StepThread               = 221;
00181 const uint16_t StepThreadAck            = 222;
00182 const uint16_t SetBreakpoint            = 223;
00183 const uint16_t SetBreakpointAck         = 224;
00184 const uint16_t ResetBreakpoint          = 225;
00185 const uint16_t ResetBreakpointAck       = 226;
00186 const uint16_t SetWatchpoint            = 227;
00187 const uint16_t SetWatchpointAck         = 228;
00188 const uint16_t ResetWatchpoint          = 229;
00189 const uint16_t ResetWatchpointAck       = 230;
00190 const uint16_t RemoveTrapHandler        = 233;
00191 const uint16_t RemoveTrapHandlerAck     = 234;
00192 const uint16_t SetPreferences           = 235;
00193 const uint16_t SetPreferencesAck        = 236;
00194 const uint16_t FreeMemory               = 237;
00195 const uint16_t FreeMemoryAck            = 238;
00196 const uint16_t SetSpecialReg            = 239;
00197 const uint16_t SetSpecialRegAck         = 240;
00198 const uint16_t SetGeneralRegs           = 241;
00199 const uint16_t SetGeneralRegsAck        = 242;
00200 const uint16_t SetFloatRegs             = 243;
00201 const uint16_t SetFloatRegsAck          = 244;
00202 const uint16_t SetDebugRegs             = 245; 
00203 const uint16_t SetDebugRegsAck          = 246;
00204 const uint16_t SetSpecialRegs           = 247; 
00205 const uint16_t SetSpecialRegsAck        = 248;
00206 const uint16_t ReleaseControl           = 249;
00207 const uint16_t ReleaseControlAck        = 250;
00208 const uint16_t SetContinuationSignal    = 251;
00209 const uint16_t SetContinuationSignalAck = 252;
00210 
00211  
00212 
00213 // ------------------------------
00214 // Enumerations
00215 // ------------------------------
00216 
00217 //! Process select enumerations.
00218 
00219 enum ProcessSelect
00220 {
00221     RankInHeader = 0,         //!< Target is the rank number in the message header.
00222     RanksInNode               //!< Target is all ranks within the node.
00223 };
00224 
00225 //! Dynamic notify mode enumerations.
00226 
00227 enum DynamicNotifyMode
00228 {
00229     DynamicNotifyDLoader = 0, //!< On job start, interrupt executable at start of the dynamic linker.
00230     DynamicNotifyStart        //!< On job start, interrupt executable at start of the application.
00231 };
00232 
00233 //! Data Address Compare interrupt behavior enumerations.
00234 
00235 enum DACTrapMode
00236 {
00237     DACTrap_NoChange = 0, //!< Do not modify the current DAC Trap Mode preference.    
00238     TrapOnDAC,            //!< Data address compare interrupts will be presented on the instruction that attempted to access the data. 
00239     TrapAfterDAC          //!< Data address compare interrupts will be presented on the instruction following the data access. 
00240 };
00241 
00242 //! Notify message types
00243 
00244 enum NotifyMessageType
00245 {
00246     NotifyMessageType_Signal,      //!< Notify message is due to the occurrence of a signal.
00247     NotifyMessageType_Termination, //!< Notify message is due to process termination.
00248     NotifyMessageType_Control      //!< Notify message is due to a change or conflict in control authority.
00249 };
00250 
00251 //! Notification reason enumerations. 
00252 
00253 enum NotifySignalReason
00254 {
00255     NotifySignal_Generic,         //!< Notification due to a signal.
00256     NotifySignal_Breakpoint,      //!< Notification due to a breakpoint trap condition.
00257     NotifySignal_WatchpointRead,  //!< Notification due to a read watchpoint match.
00258     NotifySignal_WatchpointWrite, //!< Notification due to a write watchpoint match.
00259     NotifySignal_StepComplete,    //!< Notification due to a step request completion.
00260 };
00261 
00262 //! Notification control reason enumerations.
00263 
00264 enum NotifyControlReason
00265 {
00266     NotifyControl_Conflict,       //!< Notification due to another tool requesting control authority.
00267     NotifyControl_Available       //!< Notification due to a tool relinquishing control authority.
00268 };
00269 
00270 // Notification control action for the ReleaseControl message.
00271 
00272 enum ReleaseControlNotify
00273 {
00274     ReleaseControlNotify_Inactive, //!< Do not send an Available notify message when the next tool releases control.
00275     ReleaseControlNotify_Active    //!< Send Available notify message when next tool releases control.
00276 };
00277 
00278 //! Speculative access control.
00279 
00280 enum SpecAccess
00281 {
00282     SpecAccess_UseThreadState = 0,  //!< Read and write operations will use the current state of the thread.
00283     SpecAccess_ForceNonSpeculative  //!< Read and write operations will be forced to be non-speculative.
00284 };
00285 
00286 //! Shared memory access control enumerations.
00287 
00288 enum SharedMemoryAccess
00289 {
00290     SharedMemoryAccess_NotAllow = 0, //!< Do not allow shared process memory to be operated on.
00291     SharedMemoryAccess_Allow         //!< Allow shared process memory to be operatated on.
00292 };
00293 
00294 //! Fast Breakpoint enable/disable enumerations.
00295 
00296 enum FastBreakMode
00297 {
00298     FastBreak_NoChange = 0, //!< Do not modify the current FastTrapMode preference.
00299     FastBreak_Disable,      //!< Disable Fast Breakpoint mode.
00300     FastBreak_Enable        //!< Enable Fast Breakpoint mode. 
00301 };
00302 
00303 //! Fast Watchpoint enabled/disable enumerations.
00304 
00305 enum FastWatchMode
00306 {
00307     FastWatch_NoChange = 0, //!< Do not modify the current FastTrapMode preference.
00308     FastWatch_Disable,      //!< Disable Fast Watchpoint mode.
00309     FastWatch_Enable        //!< Enable Fast Watchpoint mode. 
00310 };
00311 
00312 //! Command Return Code enumerations. 
00313 
00314 enum CmdReturnCode
00315 {
00316     CmdSuccess    = 0,       //!< The command executed successfully.
00317     CmdTIDinval   = 1,       //!< The Thread ID specified no longer corresponds to an active thread in this process or the thread is not in the expected state.
00318     CmdInval      = 2,       //!< The command is not recognized.
00319     CmdTimeout    = 3,       //!< Timeout waiting for the target thread to respond.
00320     CmdAllocErr   = 4,       //!< Could not allocate necessary memory in the outbound message area.
00321     CmdParmErr    = 5,       //!< An invalid paramter was supplied with the command.
00322     CmdBrkptFail  = 6,       //!< A failure occurred while attempting to set or clear a breakpoint.
00323     CmdAddrErr    = 7,       //!< Invalid value provided for the address parameter. 
00324     CmdLngthErr   = 8,       //!< Invalid value provided for the length parameter.
00325     CmdHwdUnavail = 9,       //!< Hardware resource conflict.
00326     CmdMemUnavail = 10,      //!< The requested memory allocation could not be satified.
00327     CmdFileNotFound= 11,     //!< The requested filename was not found.
00328     CmdConflict   = 12,      //!< The command conflicts with other commands in the command list.
00329     CmdPendingNotify = 13    //!< The release control command could not complete because of a pending signal notify that has not been satisfied.
00330 };
00331 
00332 //! State of a thread enumerations.
00333 
00334 enum BG_Thread_State
00335 {
00336     Run = 1,     //!< Thread is running executable code.
00337     Sleep,       //!< Thread is in a timed sleep.
00338     FutexWait,   //!< Thread is waiting on a futex.
00339     Idle         //!< Thread is available.
00340 };
00341 
00342 //! Tool state of thread enumerations.
00343 
00344 enum BG_Thread_ToolState
00345 {
00346     Active = 1,  //!< Thread state has not been modified by a tool.
00347     Hold,        //!< The thread is in the Hold state. A ReleaseThread will remove the hold.
00348     Suspend,     //!< Signal delivery on a thread in the process has suspended this thread. 
00349     HoldSuspend  //!< Thread is Suspended and Held.
00350 };
00351 
00352 //! Speculation state of thread enumerations.
00353 
00354 enum BG_Thread_SpecState
00355 {
00356     NonSpeculative,                 //!< Thread is running in non-speculative mode.
00357     TransactionalMemory,            //!< Thread is running in transactional memory mode.
00358     TransactionalMemory_Invalid,    //!< Thread is running in transactional memory mode, but the specid is invalid.  
00359                                     //!< Read operations return non-speculative storage, write operations are discarded.
00360     SpeculativeExecution,           //!< Thread is running in speculative execution mode.
00361     SpeculativeExecution_Invalid    //!< Thread is running in speculative execution mode, but the specid is invalid.  
00362                                     //!< Read operations return non-speculative storage, write operations are discarded.
00363 };
00364 
00365 //! Watchpoint type enumerations.
00366 
00367 enum WatchType
00368 {
00369     WatchRead = 1,  //!< Watch read. 
00370     WatchWrite,     //!< Watch write.
00371     WatchReadWrite  //!< Watch read and write.
00372 };
00373 
00374 //! Set Special Register enumerations.
00375 
00376 enum SpecialRegSelect 
00377 {
00378     iar = 1,   //!< Instruction address register.
00379     lr,        //!< Link register.
00380     msr,       //!< Machine status register.
00381     cr,        //!< Condition register.
00382     ctr,       //!< Count register.
00383     xer,       //!< XER register.
00384     fpscr,     //!< Floating point status and control register.
00385     dear,      //!< Data effective address register.
00386     esr        //!< Exception status register.
00387 };
00388 
00389 //! Set General Register enumerations.
00390 
00391 enum GeneralRegSelect
00392 {
00393     gpr0=0,gpr1,gpr2,gpr3,gpr4,gpr5,gpr6,gpr7, 
00394     gpr8,gpr9,gpr10,gpr11,gpr12,gpr13,gpr14,gpr15,      
00395     gpr16,gpr17,gpr18,gpr19,gpr20,gpr21,gpr22,gpr23,     
00396     gpr24,gpr25,gpr26,gpr27,gpr28,gpr29,gpr30,gpr31      
00397 };
00398 
00399 //! Set General Register enumerations.
00400 
00401 enum FloatRegSelect
00402 {
00403     fpr0=0,fpr1,fpr2,fpr3,fpr4,fpr5,fpr6,fpr7, 
00404     fpr8,fpr9,fpr10,fpr11,fpr12,fpr13,fpr14,fpr15,      
00405     fpr16,fpr17,fpr18,fpr19,fpr20,fpr21,fpr22,fpr23,     
00406     fpr24,fpr25,fpr26,fpr27,fpr28,fpr29,fpr30,fpr31      
00407 };
00408 
00409 //! Set Debug Register enumerations.
00410 
00411 enum DebugRegSelect
00412 {
00413     dbcr0 = 1,  //!< Debug control register 0.
00414     dbcr1,      //!< Debug control register 1.
00415     dbcr2,      //!< Debug control register 2.
00416     dbcr3,      //!< Debug control register 3.
00417     dac1,       //!< Data address compare register 1.
00418     dac2,       //!< Data address compare register 2.
00419     dac3,       //!< Data address compare register 3.
00420     dac4,       //!< Data address compare register 4.
00421     iac1,       //!< Instruction address compare register 1.
00422     iac2,       //!< Instruction address compare register 2.
00423     iac3,       //!< Instruction address compare register 3.
00424     iac4,       //!< Instruction address compare register 4.
00425     dbsr        //!< Debug status register.
00426 };
00427 
00428 
00429 //-------------------------------
00430 // Message and Command Structures
00431 //-------------------------------
00432 
00433 //! QPX Floating point register
00434 
00435 union BG_Float
00436 {
00437     double    d[ 4];
00438     float     f[ 8];
00439     uint64_t ll[ 4];
00440     uint32_t  l[ 8];
00441     uint8_t   b[32];
00442 };
00443 
00444 //! Descriptor for a command in Query, QueryAck, Update and UpdateAck messages.
00445 
00446 struct CommandDescriptor
00447 {
00448     uint16_t type;        //!< Command type.
00449     uint16_t reserved;    //!< Reserved for future use.
00450     uint32_t offset;      //!< Offset to command in message.
00451     uint32_t length;      //!< Length of command data.
00452     uint32_t returnCode;  //!< Command return code.
00453 };
00454 
00455 //! Tool message base class
00456 
00457 class ToolMessage
00458 {
00459 public:
00460     struct MessageHeader header;        //!< Message header.
00461     uint32_t toolId;                    //!< Tool identifier.
00462 };
00463 
00464 //! Message to acknowledge a message that is in error.
00465 
00466 struct ErrorAckMessage : public ToolMessage
00467 {
00468 };
00469 
00470 //! Message to attach to a compute node process.
00471 
00472 struct AttachMessage : public ToolMessage 
00473 {
00474 public:
00475     char           toolTag[ToolTagSize];  //!< Character string identifier provided by the calling tool.
00476     uint8_t        priority;              //!< Priority level for delivery of Notify message.
00477     ProcessSelect  procSelect;            //!< Attach to either all processes in the node or one process in the node
00478 };
00479 
00480 //! Message to acknowledge attaching to a compute node process.
00481 
00482 struct AttachAckMessage : public ToolMessage
00483 {
00484     uint16_t numProcess;             //!< Number of processes attached to.
00485     uint32_t rank[MaxRanksPerNode]; //!< Rank numbers of all attached processes.
00486 };
00487 
00488 //! Message to request control authority.
00489 
00490 class ControlMessage : public ToolMessage 
00491 {
00492 public:
00493     BG_Sigset_t       notifySet;        //!< Set of signals that tool is notified of when encountered. Use notifySignalSet(sigset_t*) to initialize
00494     uint32_t          sndSignal;        //!< Signal, if any, to be sent to the process leader after control authority has been granted (e.g. SIGTRAP, SIGSTOP)
00495     DynamicNotifyMode dynamicNotifyMode;//!< Dynamic application attachment notify mode.
00496     DACTrapMode       dacTrapMode;      //!< Data Address Compare trap presentation mode.
00497 
00498     //! Set the signals of interest for this tool
00499     inline void notifySignalSet(sigset_t *sigset)
00500     {
00501         // convert the user sigset data into format required by the kernel. 
00502         notifySet = *((uint64_t*)sigset);
00503     }
00504 };
00505 
00506 //! Message to acknowledge request for control authority.
00507 
00508 struct ControlAckMessage : public ToolMessage
00509 {
00510     uint16_t controllingToolId; //!< ToolID that has control authority.
00511     char     toolTag[ToolTagSize];        //!< ToolTag of the tool that has control authority
00512     uint8_t  priority;          //!< Priority of the tool that has control authority
00513 };
00514 
00515 //! Message to detach from a compute node process.
00516 
00517 struct DetachMessage : public ToolMessage
00518 {
00519     ProcessSelect  procSelect;  //!< Detach to either all processes in the node or one process in the node
00520 };
00521 
00522 //! Message to acknowledge detaching from a compute node process.
00523 
00524 struct DetachAckMessage : public ToolMessage
00525 {
00526     uint16_t numProcess;   //!< Number of processes detached.
00527     uint32_t rank[MaxRanksPerNode];     //!< Rank numbers of all detached processes.
00528 };
00529 
00530 //! Message to query a compute node process.
00531 
00532 struct QueryMessage : public ToolMessage
00533 {
00534     uint16_t numCommands;                               //!< Number of commands in message.
00535     struct CommandDescriptor cmdList[MaxQueryCommands]; //!< List of command descriptors.
00536 };
00537 
00538 //! Message to acknowledge querying a compute node process.
00539 
00540 struct QueryAckMessage : public ToolMessage
00541 {
00542     uint16_t numCommands;                               //!< Number of commands in message.
00543     struct CommandDescriptor cmdList[MaxQueryCommands]; //!< List of command descriptors.
00544 };
00545 
00546 //! Message to update state of a compute node process.
00547 
00548 struct UpdateMessage : public ToolMessage
00549 {
00550     uint16_t numCommands;                                //!< Number of commands in message.
00551     struct CommandDescriptor cmdList[MaxUpdateCommands]; //!< List of command descriptors.
00552 };
00553 
00554 //! Message to acknowledge updating state of a compute node process.
00555 
00556 struct UpdateAckMessage : public ToolMessage
00557 {
00558     uint16_t numCommands;                                //!< Number of commands in message.
00559     struct CommandDescriptor cmdList[MaxUpdateCommands]; //!< List of command descriptors.
00560 };
00561 
00562 //! Message to setup for running a new job.
00563 
00564 struct SetupJobMessage : public ToolMessage
00565 {
00566     uint16_t numRanks;                  //!< Number of ranks running on compute node for job. 
00567     uint32_t ranks[MaxRanksPerNode];    //!< Rank of each process running on compute node.
00568     uid_t    userId;                    //!< User id.
00569     gid_t    groupId;                   //!< Primary group id.
00570     uint32_t nodeId;                    //!< Node id used to name symbolic link in toolctl_node directory.
00571                                         //!< The value matches the pid field in the MPIR_PROCDESC structure.
00572 };
00573 
00574 //! Message to acknowledge setting up for a new job.
00575 
00576 struct SetupJobAckMessage : public ToolMessage
00577 {
00578 };
00579 
00580 //! Message to notify of an event within the compute node change of a compute node process.
00581 
00582 struct NotifyMessage : public ToolMessage
00583 {
00584     NotifyMessageType notifyMessageType;    //!< Which type of notify message is this.
00585     union
00586     {
00587         struct {                            //!< Definition for NotifyMessageType_Signal.
00588             uint32_t           signum;      //!< Signal number.
00589             BG_ThreadID_t      threadID;    //!< Thread id.
00590             BG_Addr_t          instAddress; //!< Address of interrupted instruction (signal notification).
00591             BG_Addr_t          dataAddress; //!< Address of the data access causing a watchpoint event.
00592             NotifySignalReason reason;      //!< Signal Notification reason.
00593         } signal;
00594         struct {                            //!< Definition for NotifyMessageType_Termination.
00595             int                exitStatus;  //!< Process exit status. Byte2: exit return code Byte3: terminating signal number
00596         } termination;
00597         struct {                            //!< Definition for NotifyMessageType_Control.
00598             uint32_t            toolid;     //!< ToolId.
00599             char                toolTag[ToolTagSize]; //!< Tool character string.
00600             uint8_t             priority;   //!< Tool priority.
00601             NotifyControlReason reason;     //!< Control Authority notification reason: Conflict or Available.
00602         } control;
00603     } type;
00604 };
00605 
00606 //! Message to acknowledge notifying status change of a compute node process.
00607 
00608 struct NotifyAckMessage : public ToolMessage
00609 {
00610 };
00611 
00612 //! Structure for stack frame entry.
00613 
00614 struct BG_Stack_Info
00615 {
00616     BG_Addr_t frameAddr;  //!< Address of next stack frame entry.
00617     BG_Addr_t savedLR;    //!< Saved link register.
00618 };
00619 
00620 //! Structure for debug registers
00621 
00622 struct BG_Debug_Regs
00623 {
00624     BG_Reg_t dbcr0;    //!< Debug control register 0.
00625     BG_Reg_t dbcr1;    //!< Debug control register 1.
00626     BG_Reg_t dbcr2;    //!< Debug control register 2.
00627     BG_Reg_t dbcr3;    //!< Debug control register 3.
00628     BG_Reg_t dac1;     //!< Data address compare register 1.
00629     BG_Reg_t dac2;     //!< Data address compare register 2.
00630     BG_Reg_t dac3;     //!< Data address compare register 3.
00631     BG_Reg_t dac4;     //!< Data address compare register 4.
00632     BG_Reg_t iac1;     //!< Instruction address compare register 1.
00633     BG_Reg_t iac2;     //!< Instruction address compare register 2.
00634     BG_Reg_t iac3;     //!< Instruction address compare register 3.
00635     BG_Reg_t iac4;     //!< Instruction address compare register 4.
00636     BG_Reg_t dbsr;     //!< Debug status register.
00637 };
00638 
00639 //! Structure for special registers
00640  
00641 struct BG_Special_Regs
00642 {
00643     BG_Reg_t iar;      //!< Instruction address register.
00644     BG_Reg_t lr;       //!< Link register.
00645     BG_Reg_t msr;      //!< Machine state register.
00646     BG_Reg_t cr;       //!< Condition register.
00647     BG_Reg_t ctr;      //!< Count register.
00648     BG_Reg_t xer;      //!< Integer exception register.
00649     BG_Reg_t fpscr;    //!< Floating point status and control register.
00650     BG_Reg_t dear;     //!< Data exception address register.
00651     BG_Reg_t esr;      //!< Exception syndrome register.
00652 };
00653 
00654 //! Tool command base class
00655 
00656 class ToolCommand
00657 {
00658 public:
00659     BG_ThreadID_t threadID;             //!< Thread id.
00660 };
00661 
00662 //! Command to get special registers.
00663 
00664 struct GetSpecialRegsCmd : public ToolCommand
00665 {
00666 };
00667 
00668 //! Command to acknowledge getting special registers.
00669 
00670 struct GetSpecialRegsAckCmd : public ToolCommand
00671 {
00672     BG_Special_Regs sregs;
00673 };
00674 
00675 //! Command to get general purpose registers.
00676 
00677 struct GetGeneralRegsCmd : public ToolCommand
00678 {
00679 };
00680 
00681 //! Command to acknowledge getting general purpose registers.
00682 
00683 struct GetGeneralRegsAckCmd : public ToolCommand
00684 {
00685     BG_Reg_t gpr[NumGPRegs];           //!< Get of general purpose registers.
00686 };
00687 
00688 //! Command to get floating point registers.
00689 
00690 struct GetFloatRegsCmd : public ToolCommand
00691 {
00692 };
00693 
00694 //! Command to acknowledge getting floating point registers.
00695 
00696 struct GetFloatRegsAckCmd : public ToolCommand
00697 {
00698     BG_Float fpr[NumFPRegs];           //!< Get of floating point registers
00699 };
00700 
00701 //! Command to get debug registers.
00702 
00703 struct GetDebugRegsCmd : public ToolCommand
00704 {
00705 };
00706 
00707 //! Command to acknowledge getting debug registers.
00708 
00709 struct GetDebugRegsAckCmd : public ToolCommand
00710 {
00711     BG_Debug_Regs dbregs;               //!< Debug registers
00712 };
00713 
00714 //! Command to get memory contents.
00715 
00716 struct GetMemoryCmd : public ToolCommand
00717 {
00718     BG_Addr_t addr;                     //!< Address of memory to return.
00719     uint32_t length;                    //!< Length of memory in bytes.
00720     SpecAccess specAccess;              //!< Should speculative access be permitted. 
00721 };
00722 
00723 //! Command to acknowledge getting memory contents.
00724 
00725 struct GetMemoryAckCmd : public ToolCommand
00726 {
00727     BG_Addr_t addr;                     //!< Address of returned memory.
00728     uint32_t length;                    //!< Length of memory in bytes.
00729     unsigned char data[0];              //!< Memory contents. Variable size data area up to MaxMemorySize.
00730 };
00731 
00732 //! Command to get aux vector data.
00733 
00734 struct GetAuxVectorsCmd : public ToolCommand
00735 {
00736 };
00737 
00738 //! Command to acknowledge getting aux vector data.
00739 
00740 struct GetAuxVectorsAckCmd : public ToolCommand
00741 {
00742     uint32_t length;                    //!< Length of data in bytes.
00743     uint64_t data[MaxAuxVecDWords];     //!< Aux vector data.
00744 };
00745 
00746 //! Command to get process data.
00747 
00748 struct GetProcessDataCmd : public ToolCommand
00749 {
00750 };
00751 
00752 //! Command to acknowledge getting process data.
00753 
00754 struct GetProcessDataAckCmd : public ToolCommand
00755 {
00756     uint32_t  rank;                      //!< MPI rank.
00757     uint32_t  tgid;                      //!< Thread group id.
00758     uint32_t  aCoord;                    //!< A coordinate.
00759     uint32_t  bCoord;                    //!< B coordinate.
00760     uint32_t  cCoord;                    //!< C coordinate.
00761     uint32_t  dCoord;                    //!< D coordinate.
00762     uint32_t  eCoord;                    //!< E coordinate.
00763     uint32_t  tCoord;                    //!< T coordinate.
00764     BG_Addr_t sharedMemoryStartAddr;     //!< Shared memory region start address.
00765     BG_Addr_t sharedMemoryEndAddr;       //!< Shared memory region end address.
00766     BG_Addr_t persistMemoryStartAddr;    //!< Persistent memory region start address.
00767     BG_Addr_t persistMemoryEndAddr;      //!< Persistent memory region end address.
00768     BG_Addr_t heapStartAddr;             //!< Heap start address.
00769     BG_Addr_t heapEndAddr;               //!< Heap end address. 
00770     BG_Addr_t heapBreakAddr;             //!< Heap break address.
00771     BG_Addr_t mmapStartAddr;             //!< Memory map start address.
00772     BG_Addr_t mmapEndAddr;               //!< Memory map end address.
00773     struct timeval jobTime;              //!< Time job has been running.
00774 };
00775 
00776 //! Command to get thread data.
00777 
00778 struct GetThreadDataCmd : public ToolCommand
00779 {
00780 };
00781 
00782 
00783 //! Command to acknowledge getting thread data.
00784 
00785 struct GetThreadDataAckCmd : public ToolCommand
00786 {
00787     int                 core;                //!< Processor Core ID (0..16).
00788     int                 thread;              //!< Processor Thread ID (0..3).
00789     BG_Thread_State     state;               //!< State of thread.
00790     BG_Thread_ToolState toolState;           //!< Tool State of thread.
00791     BG_Thread_SpecState specState;           //!< State of thread's speculative accesses.
00792     BG_Addr_t           guardStartAddr;      //!< Guard page start address.
00793     BG_Addr_t           guardEndAddr;        //!< Guard page end address.
00794     BG_Addr_t           stackStartAddr;      //!< Stack start address.
00795     BG_Addr_t           stackCurrentAddr;    //!< Current stack address.
00796     uint32_t            numStackFrames;      //!< Number of stack frame entries in list.
00797     BG_Stack_Info stackInfo[MaxStackFrames]; //!< Stack trace back.
00798 };
00799 
00800 //! Command to get the list of threads for a process.
00801 
00802 struct GetThreadListCmd : public ToolCommand
00803 {
00804 };
00805 
00806 //! Command to acknowledge getting the list of threads.
00807 
00808 struct GetThreadListAckCmd : public ToolCommand
00809 {
00810     uint32_t numthreads;                 //!< Number of threads returned.
00811     struct
00812     {
00813         uint32_t tid;                    //!< Thread identifier.
00814         struct
00815         {
00816             uint32_t commthread : 1;     //!< Commthread indicator.
00817             uint32_t unused : 31;
00818         } info;
00819     } threadlist[MaxThreadIds];          //!< Thread list entries.
00820 };
00821 
00822 //! Command to send a signal.
00823 
00824 struct SendSignalCmd : public ToolCommand
00825 {
00826     uint32_t signum;                     //!< Signal number to send.
00827 };
00828 
00829 //! Command to acknowledge getting a signal.
00830 
00831 struct SendSignalAckCmd : public ToolCommand
00832 {
00833 };
00834 
00835 //! Command to set special register.
00836 
00837 struct SetSpecialRegCmd : public ToolCommand
00838 {
00839     SpecialRegSelect reg_select;        //!< Special purpose register selection.
00840     BG_Reg_t         value;             //!< Register value.
00841 };
00842 
00843 //! Command to acknowledge setting special register.
00844 
00845 struct SetSpecialRegAckCmd : public ToolCommand
00846 {
00847 };
00848 
00849 //! Command to set set general register.
00850 
00851 struct SetGeneralRegCmd : public ToolCommand
00852 {
00853     GeneralRegSelect reg_select;        //!< General purpose register selection.
00854     BG_Reg_t         value;             //!< Register value.
00855 };
00856 
00857 //! Command to acknowledge setting general register.
00858 
00859 struct SetGeneralRegAckCmd : public ToolCommand
00860 {
00861 };
00862 
00863 //! Command to set set general registers.
00864 
00865 struct SetGeneralRegsCmd : public ToolCommand
00866 {
00867     BG_Reg_t gpr[NumGPRegs];           //!< Set of general purpose registers.
00868 };
00869 
00870 //! Command to acknowledge setting general registers.
00871 
00872 struct SetGeneralRegsAckCmd : public ToolCommand
00873 {
00874 };
00875 
00876 //! Command to set floating point register.
00877 
00878 struct SetFloatRegCmd : public ToolCommand
00879 {
00880     FloatRegSelect reg_select;         //!< Floating point register selection.
00881     BG_Float       value;              //!< Register value.
00882 
00883 };
00884 
00885 //! Command to acknowledge setting of floating point register.
00886 
00887 struct SetFloatRegAckCmd : public ToolCommand
00888 {
00889 };
00890 
00891 //! Command to set floating point registers.
00892 
00893 struct SetFloatRegsCmd : public ToolCommand
00894 {
00895     BG_Float fpr[NumFPRegs];           //!< Set of floating point registers
00896 };
00897 
00898 //! Command to acknowledge setting of floating point registers.
00899 
00900 struct SetFloatRegsAckCmd : public ToolCommand
00901 {
00902 };
00903 
00904 //! Command to set a debug register.
00905 
00906 struct SetDebugRegCmd : public ToolCommand
00907 {
00908     DebugRegSelect reg_select;          //!< Debug register selection.
00909     BG_Reg_t       value;               //!< Register value.
00910 };
00911 
00912 //! Command to acknowledge setting of a debug register.
00913 
00914 struct SetDebugRegAckCmd : public ToolCommand
00915 {
00916 };
00917 
00918 //! Command to set a debug registers.
00919 
00920 struct SetDebugRegsCmd : public ToolCommand
00921 {
00922     BG_Debug_Regs dbregs;               //!< Debug registers
00923 };
00924 
00925 //! Command to acknowledge setting of a debug registers.
00926 
00927 struct SetDebugRegsAckCmd : public ToolCommand
00928 {
00929 };
00930 
00931 //! Command to set a special registers.
00932 
00933 struct SetSpecialRegsCmd : public ToolCommand
00934 {
00935     BG_Special_Regs sregs;               //!< Special registers
00936 };
00937 
00938 //! Command to acknowledge setting of a special registers.
00939 
00940 struct SetSpecialRegsAckCmd : public ToolCommand
00941 {
00942 };
00943 
00944 //! Command to set memory. To write a memory breakpoint, a separate command is provided. 
00945 
00946 struct SetMemoryCmd : public ToolCommand
00947 {
00948     BG_Addr_t          addr;                //!< Address of memory to set.
00949     uint32_t           length;              //!< Length of memory in bytes.
00950     SpecAccess         specAccess;          //!< Should speculative access be permitted.
00951     SharedMemoryAccess sharedMemoryAccess;  //!< Should Shared process data writes be allowed. 
00952     unsigned char      data[0];             //!< Memory contents. Variable size data area up to MaxMemorySize
00953 };
00954 
00955 //! Command to acknowledge setting of memory.
00956 
00957 struct SetMemoryAckCmd : public ToolCommand
00958 {
00959     BG_Addr_t addr;     //!< Address of memory.
00960     uint32_t  length;   //!< Length of memory in bytes.
00961 };
00962 
00963 //! Command to hold a thread.
00964 
00965 struct HoldThreadCmd : public ToolCommand
00966 {
00967 };
00968 
00969 //! Command to acknowledge setting a hold on a thread.
00970 
00971 struct HoldThreadAckCmd : public ToolCommand
00972 {
00973 };
00974 
00975 //! Command to release a thread.
00976 
00977 struct ReleaseThreadCmd : public ToolCommand
00978 {
00979 };
00980 
00981 //! Command to acknowledge releasing of a thread.
00982 
00983 struct ReleaseThreadAckCmd : public ToolCommand
00984 {
00985 };
00986 
00987 //! Command to release all threads in a process.
00988 
00989 struct ReleaseAllThreadsCmd : public ToolCommand
00990 {
00991 };
00992 
00993 //! Command to acknowledge releasing of all threads.
00994 
00995 struct ReleaseAllThreadsAckCmd : public ToolCommand
00996 {
00997 };
00998 
00999 //! Command to install a trap handler.
01000 
01001 struct InstallTrapHandlerCmd : public ToolCommand
01002 {
01003     void  (*trap_handler)(int, siginfo_t *, void *);   //!< Signal handler function for SIGTRAP
01004 };
01005 
01006 //! Command to acknowledge installing a trap handler.
01007 
01008 struct InstallTrapHandlerAckCmd : public ToolCommand
01009 {
01010 };
01011 
01012 //! Command to remove a trap handler.
01013 
01014 struct RemoveTrapHandlerCmd : public ToolCommand
01015 {
01016 };
01017 
01018 //! Command to acknowledge removing a trap handler.
01019 
01020 struct RemoveTrapHandlerAckCmd : public ToolCommand
01021 {
01022 };
01023 
01024 //! Command to mmap.
01025 
01026 struct AllocateMemoryCmd : public ToolCommand
01027 {
01028     size_t alloc_size;  //!< Amount of memory to allocate.
01029 };
01030 
01031 //! Command to acknowledge mmaping.
01032 
01033 struct AllocateMemoryAckCmd : public ToolCommand
01034 {
01035     void *alloc_addr;   //!< Address of allocated memory.
01036 };
01037 
01038 //! Command to free an mmap allocation.
01039 
01040 struct FreeMemoryCmd : public ToolCommand
01041 {
01042     void  *alloc_addr;  //!< Address of memory to be freed.
01043     size_t alloc_size;  //!< Size of the memory to be freed. 
01044 };
01045 
01046 //! Command to acknowledge freeing an mmap allocation.
01047 
01048 struct FreeMemoryAckCmd : public ToolCommand
01049 {
01050 };
01051 
01052 //! Command to set the mask indicating the signals this tool is interested in.
01053 
01054 struct SetSignalMaskCmd : public ToolCommand
01055 {
01056 };
01057 
01058 //! Command to acknowledge setting of the signals mask.
01059 
01060 struct SetSignalMaskAckCmd : public ToolCommand
01061 {
01062 };
01063 
01064 //! Command to perform a continue process.
01065 
01066 struct ContinueProcessCmd : public ToolCommand
01067 {
01068 };
01069 
01070 //! Command to acknowledge the execution of a continue process.
01071 
01072 struct ContinueProcessAckCmd : public ToolCommand
01073 {
01074 };
01075 
01076 //! Command to perform a step.
01077 
01078 struct StepThreadCmd : public ToolCommand
01079 {
01080 };
01081 
01082 //! Command to acknowledge the execution of a step request.
01083 
01084 struct StepThreadAckCmd : public ToolCommand
01085 {
01086 };
01087 
01088 //! Command to set a memory breakpoint.
01089 
01090 struct SetBreakpointCmd : public ToolCommand
01091 {
01092     BG_Addr_t addr;        //!< Address of memory.
01093     uint32_t  instruction; //!< Trap instruction.
01094 };
01095 
01096 //! Command to acknowledge setting of a memory breakpoint.
01097 
01098 struct SetBreakpointAckCmd : public ToolCommand
01099 {
01100 };
01101 
01102 //! Command to reset a memory breakpoint.
01103 
01104 struct ResetBreakpointCmd : public ToolCommand
01105 {
01106     BG_Addr_t addr;        //!< Address of memory.
01107     uint32_t  instruction; //!< Original instruction
01108 };
01109 
01110 //! Command to acknowledge resetting of a memory breakpoint.
01111 
01112 struct ResetBreakpointAckCmd : public ToolCommand
01113 {
01114 };
01115 
01116 //! Command to set a memory watchpoint. 
01117 //! The address must be aligned on the same boundary as the length. For example
01118 //! a watch of an 8 byte area must have the address starting on an 8 byte boundary.
01119 //!   
01120 struct SetWatchpointCmd : public ToolCommand
01121 {
01122     BG_Addr_t  addr;      //!< Address of memory.
01123     uint32_t   length;    //!< Length of watched memory area
01124     WatchType  type;      //!< Type of watch: read, write, any.
01125 };
01126 
01127 //! Command to acknowledge setting of a memory watchpoint.
01128 
01129 struct SetWatchpointAckCmd : public ToolCommand
01130 {
01131 };
01132 
01133 //! Command to reset a memory watchpoint.
01134 
01135 struct ResetWatchpointCmd : public ToolCommand
01136 {
01137     BG_Addr_t addr;       //!< Address of memory.
01138 };
01139 
01140 //! Command to acknowledge resetting of a memory watchpoint.
01141 
01142 struct ResetWatchpointAckCmd : public ToolCommand
01143 {
01144 };
01145 
01146 //! Command to set preferences.
01147 
01148 struct SetPreferencesCmd : public ToolCommand
01149 {
01150     FastBreakMode breakpointMode;  //!< Enable or disable fast breakpoints.
01151     FastWatchMode watchpointMode;  //!< Enable or disable fast watchpoints.
01152     DACTrapMode   dacMode;         //!< Data address compare interrupt delivery on/after the matching instruction.
01153 };
01154 
01155 //! Command to acknowledge set preferences.
01156 
01157 struct SetPreferencesAckCmd : public ToolCommand
01158 {
01159 };
01160 //! Command to get preferences.
01161 
01162 struct GetPreferencesCmd : public ToolCommand
01163 {
01164 };
01165 
01166 //! Command to acknowledge set preferences.
01167 
01168 struct GetPreferencesAckCmd : public ToolCommand
01169 {
01170     FastBreakMode breakpointMode;  //!< Are fast breakpoints enabled or disabled.
01171     FastWatchMode watchpointMode;  //!< Are fast watchpoints enabled or disabled.
01172     DACTrapMode   dacMode;         //!< Is trap-on or trap-after mode enabled.
01173 };
01174 
01175 //! Command to list the persistent files
01176 struct GetFilenamesCmd : public ToolCommand
01177 {
01178 };
01179 
01180 //! Ack Command to return a list of files
01181 
01182 struct GetFilenamesAckCmd : public ToolCommand
01183 {
01184     uint32_t numFiles;
01185     char     pathname[MaxPersistPathnames][MaxPersistPathnameSize];
01186 };
01187 
01188 //! Command to stat a file
01189 
01190 struct GetFileStatDataCmd : public ToolCommand
01191 {
01192     char pathname[MaxPersistPathnameSize];
01193 };
01194 
01195 //! Command to ack the stat of a file
01196 
01197 struct GetFileStatDataAckCmd : public ToolCommand
01198 {
01199     struct stat64 stat;
01200 };
01201 
01202 //! Command to read a file
01203 
01204 struct GetFileContentsCmd : public ToolCommand
01205 {
01206     char   pathname[MaxPersistPathnameSize];
01207     size_t offset;
01208     size_t numbytes;
01209 };
01210 
01211 //! Command to ack the read of a file
01212 
01213 struct GetFileContentsAckCmd : public ToolCommand
01214 {
01215     size_t numbytes;
01216     char   data[0];        //!< Variable size data area up to MaxMemorySize
01217 };
01218 
01219 //! Command to release control authority
01220 
01221 struct ReleaseControlCmd : public ToolCommand
01222 {
01223     ReleaseControlNotify notify;        //!< Controls the sending of the next Notify Available message to this tool.
01224 };
01225 
01226 //! Command to ack the release of control authority
01227 
01228 struct ReleaseControlAckCmd : public ToolCommand
01229 {
01230 };
01231 
01232 //! Command to set the continuation signal
01233 
01234 struct SetContinuationSignalCmd : public ToolCommand
01235 {
01236     uint32_t             signum;        //!< Signal to be set.     
01237 };
01238 
01239 //! Command to ack the set continuation signal
01240 
01241 struct SetContinuationSignalAckCmd : public ToolCommand
01242 {
01243 };
01244 
01245 
01246     } // namespace toolctl
01247 
01248 } // namespace bgcios
01249 
01250 #endif // TOOLCTLMESSAGES_H
01251 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1