#include <BG_AuxvReader.h>
Public Member Functions | |
| BG_AuxvReader (int _pid) | |
| Construct a new reader for the specified process. PID is according to MPIR proctable. | |
| ~BG_AuxvReader () | |
| bool | good () |
| const char * | error_msg () |
| Whether we encountered an error communicating wtih CIOD. | |
| bool | has_next () |
| Message associated with the last error. | |
| auxv_element | next () |
| Whether there are more auxv_elements to read. | |
Private Member Functions | |
| void | check_buffer () |
| Last element read. | |
Private Attributes | |
| const size_t | buffer_size |
| const int | pid |
| buffer size for chunks read from CN | |
| size_t | fetch_offset |
| process to read from | |
| size_t | read_offset |
| offset within aux vectors to fetch | |
| DebuggerInterface::BG_Debugger_Msg | ack_msg |
| local offset in buffer to read from | |
| const char * | error |
| BG msg containing fetched auxv buffer. | |
| auxv_element | elt |
| set if we encounter an error while reading. | |
Class for using CIO debugger interface to read auxv vectors. This will read all the vectors in order until there's nothing left. Sample usage:
BG_AuxvReader reader(mypid); while (reader.hasNext()) { if (!reader.good()) { handle error } auxv_element elt = reader.next(); do stuff with elt }
Note that the process on the compute node *must be stopped* for this to work properly. User of this class is responsible for stopping/restarting the process.
Definition at line 65 of file BG_AuxvReader.h.
| BG_AuxvReader::BG_AuxvReader | ( | int | _pid | ) |
Construct a new reader for the specified process. PID is according to MPIR proctable.
Definition at line 42 of file BG_AuxvReader.C.
References ACK, ack_msg, AT_IGNORE, elt, and auxv_element::type.
| BG_AuxvReader::~BG_AuxvReader | ( | ) |
Definition at line 107 of file BG_AuxvReader.C.
| void BG_AuxvReader::check_buffer | ( | ) | [private] |
Last element read.
Definition at line 57 of file BG_AuxvReader.C.
References ACK, ack_msg, AUX, BG_DEBUGGER_READ_PIPE, BG_DEBUGGER_WRITE_PIPE, buffer_size, DebuggerInterface::BG_Debugger_Msg::dataArea, error, fetch_offset, DebuggerInterface::GET_AUX_VECTORS, DebuggerInterface::GET_AUX_VECTORS_ACK, DebuggerInterface::BG_Debugger_Msg::header, pid, and read_offset.
Referenced by has_next(), and next().
| const char * BG_AuxvReader::error_msg | ( | ) |
Whether we encountered an error communicating wtih CIOD.
Definition at line 115 of file BG_AuxvReader.C.
References error.
| bool BG_AuxvReader::good | ( | ) |
Definition at line 110 of file BG_AuxvReader.C.
References error.
| bool BG_AuxvReader::has_next | ( | ) |
Message associated with the last error.
Definition at line 120 of file BG_AuxvReader.C.
References ACK, ack_msg, AT_NULL, check_buffer(), elt, error, read_offset, and auxv_element::type.
| auxv_element BG_AuxvReader::next | ( | ) |
Whether there are more auxv_elements to read.
Definition at line 129 of file BG_AuxvReader.C.
References ACK, ack_msg, check_buffer(), elt, read_offset, auxv_element::type, and auxv_element::value.
local offset in buffer to read from
Definition at line 71 of file BG_AuxvReader.h.
Referenced by BG_AuxvReader(), check_buffer(), has_next(), and next().
const size_t BG_AuxvReader::buffer_size [private] |
Definition at line 67 of file BG_AuxvReader.h.
Referenced by check_buffer().
auxv_element BG_AuxvReader::elt [private] |
set if we encounter an error while reading.
Definition at line 74 of file BG_AuxvReader.h.
Referenced by BG_AuxvReader(), has_next(), and next().
const char* BG_AuxvReader::error [private] |
BG msg containing fetched auxv buffer.
Definition at line 73 of file BG_AuxvReader.h.
Referenced by check_buffer(), error_msg(), good(), and has_next().
size_t BG_AuxvReader::fetch_offset [private] |
const int BG_AuxvReader::pid [private] |
buffer size for chunks read from CN
Definition at line 68 of file BG_AuxvReader.h.
Referenced by check_buffer().
size_t BG_AuxvReader::read_offset [private] |
offset within aux vectors to fetch
Definition at line 70 of file BG_AuxvReader.h.
Referenced by check_buffer(), has_next(), and next().
1.6.1