Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_ddump.h File Reference
#include "ocs_textbuf.h"

Go to the source code of this file.

Macros

#define OCS_DDUMP_FLAGS_WQES   (1U << 0)
 
#define OCS_DDUMP_FLAGS_CQES   (1U << 1)
 
#define OCS_DDUMP_FLAGS_MQES   (1U << 2)
 
#define OCS_DDUMP_FLAGS_RQES   (1U << 3)
 
#define OCS_DDUMP_FLAGS_EQES   (1U << 4)
 
#define OCS_DDUMP_FLAGS_DEFAULT
 

Functions

int ocs_ddump (ocs_t *ocs, ocs_textbuf_t *textbuf, uint32_t flags, uint32_t qentries)
 Initiate ddump. More...
 
void ocs_ddump_startfile (ocs_textbuf_t *textbuf)
 Generate driver dump start of file information. More...
 
void ocs_ddump_endfile (ocs_textbuf_t *textbuf)
 Generate driver dump end of file information. More...
 
void ocs_ddump_section (ocs_textbuf_t *textbuf, const char *name, uint32_t instance)
 Generate driver dump section start data. More...
 
void ocs_ddump_endsection (ocs_textbuf_t *textbuf, const char *name, uint32_t instance)
 Generate driver dump section end data. More...
 
 __attribute__ ((format(printf, 3, 4))) extern void ocs_ddump_value(ocs_textbuf_t *textbuf
 
const char const char void ocs_ddump_buffer (ocs_textbuf_t *textbuf, const char *name, uint32_t instance, void *buffer, uint32_t size)
 Generate driver dump data for an arbitrary buffer of DWORDS. More...
 
int32_t ocs_save_ddump (ocs_t *ocs, uint32_t flags, uint32_t qentries)
 Capture and save ddump. More...
 
int32_t ocs_get_saved_ddump (ocs_t *ocs, ocs_textbuf_t *textbuf)
 Get saved ddump. More...
 
int32_t ocs_save_ddump_all (uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
 Capture and save ddump for all OCS instances. More...
 
int32_t ocs_adapter_ddump_clear_and_save (ocs_t *ocs, uint8_t bus, uint8_t dev, uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
 
int32_t ocs_clear_saved_ddump (ocs_t *ocs)
 Clear saved ddump. More...
 
void ocs_ddump_queue_entries (ocs_textbuf_t *textbuf, void *q_addr, uint32_t size, uint32_t length, int32_t index, uint32_t qentries)
 Generate driver dump for queue. More...
 

Variables

const char * name
 
const char const char * fmt
 

Macro Details

#define OCS_DDUMP_FLAGS_CQES   (1U << 1)

Definition at line 39 of file ocs_ddump.h.

#define OCS_DDUMP_FLAGS_DEFAULT
Value:
#define OCS_DDUMP_FLAGS_WQES
Definition: ocs_ddump.h:38
#define OCS_DDUMP_FLAGS_RQES
Definition: ocs_ddump.h:41
#define OCS_DDUMP_FLAGS_EQES
Definition: ocs_ddump.h:42
#define OCS_DDUMP_FLAGS_CQES
Definition: ocs_ddump.h:39
#define OCS_DDUMP_FLAGS_MQES
Definition: ocs_ddump.h:40

Definition at line 43 of file ocs_ddump.h.

#define OCS_DDUMP_FLAGS_EQES   (1U << 4)

Definition at line 42 of file ocs_ddump.h.

#define OCS_DDUMP_FLAGS_MQES   (1U << 2)

Definition at line 40 of file ocs_ddump.h.

#define OCS_DDUMP_FLAGS_RQES   (1U << 3)

Definition at line 41 of file ocs_ddump.h.

#define OCS_DDUMP_FLAGS_WQES   (1U << 0)

Definition at line 38 of file ocs_ddump.h.

Function Details

__attribute__ ( (format(printf, 3, 4))  )
int32_t ocs_adapter_ddump_clear_and_save ( ocs_t *  ocs,
uint8_t  bus,
uint8_t  dev,
uint32_t  flags,
uint32_t  qentries,
uint32_t  alloc_flag 
)
int32_t ocs_clear_saved_ddump ( ocs_t *  ocs)

Clear saved ddump.

Description
Clears saved ddump to make room for next one.
Parameters
ocsPointer to device context.
Returns
Returns 0 if ddump was cleared; > 0 if no saved ddump found.

Definition at line 827 of file ocs_ddump.c.

int ocs_ddump ( ocs_t *  ocs,
ocs_textbuf_t *  textbuf,
uint32_t  flags,
uint32_t  qentries 
)

Initiate ddump.

Description
Traverses the ocs/domain/port/node/io data structures to generate a driver dump.
Parameters
ocsPointer to device context
textbufPointer to text buffer
flagsThe ddump flags.
qentriesNumber of queue entries to dump.
Returns
Returns 0 on success, or a negative value on failure.

Definition at line 628 of file ocs_ddump.c.

const char const char void ocs_ddump_buffer ( ocs_textbuf_t *  textbuf,
const char *  name,
uint32_t  instance,
void *  buffer,
uint32_t  size 
)

Generate driver dump data for an arbitrary buffer of DWORDS.

A status value is added to textbuf

Parameters
textbufpointer to text buffer
namename of status variable
instanceinstance number of this section
bufferbuffer to print
sizesize of buffer in bytes
Returns
none

Definition at line 154 of file ocs_ddumplib.c.

void ocs_ddump_endfile ( ocs_textbuf_t *  textbuf)

Generate driver dump end of file information.

The end of file information is added to 'textbuf'

Parameters
textbufpointer to driver dump text buffer
Returns
none

Definition at line 73 of file ocs_ddumplib.c.

void ocs_ddump_endsection ( ocs_textbuf_t *  textbuf,
const char *  name,
uint32_t  instance 
)

Generate driver dump section end data.

The driver section end information is added to textbuf

Parameters
textbufpointer to text buffer
namename of section
instanceinstance number of this section
Returns
none

Definition at line 108 of file ocs_ddumplib.c.

void ocs_ddump_queue_entries ( ocs_textbuf_t *  textbuf,
void *  q_addr,
uint32_t  size,
uint32_t  length,
int32_t  index,
uint32_t  qentries 
)

Generate driver dump for queue.

Add queue elements to text buffer

Parameters
textbufpointer to driver dump text buffer
q_addraddress of start of queue
sizesize of each queue entry
lengthnumber of queue entries in the queue
indexcurrent index of queue
qentriesnumber of most recent queue entries to dump
Returns
none

Definition at line 196 of file ocs_ddumplib.c.

void ocs_ddump_section ( ocs_textbuf_t *  textbuf,
const char *  name,
uint32_t  instance 
)

Generate driver dump section start data.

The driver section start information is added to textbuf

Parameters
textbufpointer to text buffer
namename of section
instanceinstance number of this section
Returns
none

Definition at line 90 of file ocs_ddumplib.c.

void ocs_ddump_startfile ( ocs_textbuf_t *  textbuf)

Generate driver dump start of file information.

The start of file information is added to 'textbuf'

Parameters
textbufpointer to driver dump text buffer
Returns
none

Definition at line 53 of file ocs_ddumplib.c.

int32_t ocs_get_saved_ddump ( ocs_t *  ocs,
ocs_textbuf_t *  textbuf 
)

Get saved ddump.

Description
Copies saved ddump to given textbuf.
Parameters
ocsPointer to device context.
textbufThe textbuf to write the saved ddump to.
Returns
Returns 0 if ddump was saved; > 0 if no saved ddump found.

Definition at line 800 of file ocs_ddump.c.

int32_t ocs_save_ddump ( ocs_t *  ocs,
uint32_t  flags,
uint32_t  qentries 
)

Capture and save ddump.

Description
Captures and saves a ddump to the ocs_t structure to save the current state. The goal of this function is to save a ddump as soon as an issue is encountered. The saved ddump will be kept until the user reads it.
Parameters
ocsPointer to device context.
flagsThe ddump flags.
qentriesNumber of queue entries to dump.
Returns
Returns 0 if ddump was saved; > 0 if one already exists; < 0 on error.

Definition at line 733 of file ocs_ddump.c.

int32_t ocs_save_ddump_all ( uint32_t  flags,
uint32_t  qentries,
uint32_t  alloc_flag 
)

Capture and save ddump for all OCS instances.

Description
Calls ocs_save_ddump() for each OCS instance.
Parameters
flagsThe ddump flags.
qentriesNumber of queue entries to dump.
alloc_flagAllocate dump buffer if not already allocated.
Returns
Returns 0 if ddump was saved; > 0 if one already exists; < 0 on error.

Definition at line 765 of file ocs_ddump.c.

Variable Details

const char const char * fmt

Definition at line 54 of file ocs_ddump.h.

const char* name

Definition at line 54 of file ocs_ddump.h.