mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-20 18:24:13 +00:00
freetdm: allow IO statistics access to users
added ftdm iostats command
This commit is contained in:
1 parent
f527ed686f
commit
68b887c760
4 files changed
+135
-34
No files matched your search
@@ -707,7 +707,10 @@ typedef enum {
|
||||
FTDM_COMMAND_FLUSH_TX_BUFFERS = 45,
|
||||
FTDM_COMMAND_FLUSH_RX_BUFFERS = 46,
|
||||
FTDM_COMMAND_FLUSH_BUFFERS = 47,
|
||||
|
||||
/*!< Flush IO statistics */
|
||||
FTDM_COMMAND_FLUSH_IOSTATS = 48,
|
||||
|
||||
FTDM_COMMAND_SET_PRE_BUFFER_SIZE = 49,
|
||||
FTDM_COMMAND_SET_LINK_STATUS = 50,
|
||||
FTDM_COMMAND_GET_LINK_STATUS = 51,
|
||||
@@ -719,6 +722,11 @@ typedef enum {
|
||||
FTDM_COMMAND_START_MF_PLAYBACK = 57,
|
||||
FTDM_COMMAND_STOP_MF_PLAYBACK = 58,
|
||||
|
||||
/*!< Get a copy of the current IO stats */
|
||||
FTDM_COMMAND_GET_IOSTATS = 59,
|
||||
/*!< Enable/disable IO stats in the channel */
|
||||
FTDM_COMMAND_SWITCH_IOSTATS = 60,
|
||||
|
||||
FTDM_COMMAND_COUNT,
|
||||
} ftdm_command_t;
|
||||
|
||||
@@ -903,6 +911,37 @@ typedef enum {
|
||||
FTDM_MF_DIRECTION_BACKWARD = (1 << 9)
|
||||
} ftdm_mf_direction_flag_t;
|
||||
|
||||
/*! \brief IO Error statistics */
|
||||
typedef enum {
|
||||
FTDM_IOSTATS_ERROR_CRC = (1 << 0),
|
||||
FTDM_IOSTATS_ERROR_FRAME = (1 << 1),
|
||||
FTDM_IOSTATS_ERROR_ABORT = (1 << 2),
|
||||
FTDM_IOSTATS_ERROR_FIFO = (1 << 3),
|
||||
FTDM_IOSTATS_ERROR_DMA = (1 << 4),
|
||||
FTDM_IOSTATS_ERROR_QUEUE_THRES = (1 << 5), /* Queue reached high threshold */
|
||||
FTDM_IOSTATS_ERROR_QUEUE_FULL = (1 << 6), /* Queue is full */
|
||||
} ftdm_iostats_error_type_t;
|
||||
|
||||
/*! \brief IO statistics */
|
||||
typedef struct {
|
||||
struct {
|
||||
uint32_t errors;
|
||||
uint16_t flags;
|
||||
uint8_t queue_size; /*!< max queue size configured */
|
||||
uint8_t queue_len; /*!< Current number of elements in queue */
|
||||
uint64_t packets;
|
||||
} rx;
|
||||
|
||||
struct {
|
||||
uint32_t errors;
|
||||
uint16_t flags;
|
||||
uint8_t idle_packets;
|
||||
uint8_t queue_size; /*!< max queue size configured */
|
||||
uint8_t queue_len; /*!< Current number of elements in queue */
|
||||
uint64_t packets;
|
||||
} tx;
|
||||
} ftdm_channel_iostats_t;
|
||||
|
||||
/*! \brief Override the default queue handler */
|
||||
FT_DECLARE(ftdm_status_t) ftdm_global_set_queue_handler(ftdm_queue_handler_t *handler);
|
||||
|
||||
|
||||
@@ -359,35 +359,6 @@ typedef struct {
|
||||
ftdm_mutex_t *mutex;
|
||||
} ftdm_dtmf_debug_t;
|
||||
|
||||
typedef enum {
|
||||
FTDM_IOSTATS_ERROR_CRC = (1 << 0),
|
||||
FTDM_IOSTATS_ERROR_FRAME = (1 << 1),
|
||||
FTDM_IOSTATS_ERROR_ABORT = (1 << 2),
|
||||
FTDM_IOSTATS_ERROR_FIFO = (1 << 3),
|
||||
FTDM_IOSTATS_ERROR_DMA = (1 << 4),
|
||||
FTDM_IOSTATS_ERROR_QUEUE_THRES = (1 << 5), /* Queue reached high threshold */
|
||||
FTDM_IOSTATS_ERROR_QUEUE_FULL = (1 << 6), /* Queue is full */
|
||||
} ftdm_iostats_error_type_t;
|
||||
|
||||
typedef struct {
|
||||
struct {
|
||||
uint32_t errors;
|
||||
uint16_t flags;
|
||||
uint8_t queue_size; /* max queue size configured */
|
||||
uint8_t queue_len; /* Current number of elements in queue */
|
||||
uint64_t packets;
|
||||
} rx;
|
||||
|
||||
struct {
|
||||
uint32_t errors;
|
||||
uint16_t flags;
|
||||
uint8_t idle_packets;
|
||||
uint8_t queue_size; /* max queue size configured */
|
||||
uint8_t queue_len; /* Current number of elements in queue */
|
||||
uint64_t packets;
|
||||
} tx;
|
||||
} ftdm_channel_iostats_t;
|
||||
|
||||
/* 2^8 table size, one for each byte (sample) value */
|
||||
#define FTDM_GAINS_TABLE_SIZE 256
|
||||
struct ftdm_channel {
|
||||
|
||||
Reference in new issue
Block a user