#include <errno.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <json-c/json.h>
#include <doca_argp.h>
#include <doca_dev.h>
#include <doca_error.h>
#include <doca_log.h>
#include <doca_telemetry_diag.h>
#include "telemetry_diag_sample.h"
Go to the source code of this file.
|
| | DOCA_LOG_REGISTER (TELEMETRY_DIAG::MAIN) |
| |
| static doca_error_t | pci_address_callback (void *param, void *config) |
| |
| static doca_error_t | data_ids_callback (void *param, void *config) |
| |
| static doca_error_t | output_callback (void *param, void *config) |
| |
| static doca_error_t | run_time_callback (void *param, void *config) |
| |
| static doca_error_t | sample_period_callback (void *param, void *config) |
| |
| static doca_error_t | log_max_num_samples_callback (void *param, void *config) |
| |
| static doca_error_t | max_num_samples_per_read_callback (void *param, void *config) |
| |
| static doca_error_t | sample_mode_callback (void *param, void *config) |
| |
| static doca_error_t | output_format_callback (void *param, void *config) |
| |
| static doca_error_t | force_ownership_callback (void *param, void *config) |
| |
| static doca_error_t | example_json_file_callback (void *param, void *config) |
| |
| static doca_error_t | register_telemetry_diag_params (void) |
| |
| static doca_error_t | parse_json_data_ids (struct telemetry_diag_sample_cfg *cfg, struct json_object *json_data_ids, int array_len) |
| |
| static doca_error_t | set_default_data_ids (struct telemetry_diag_sample_cfg *cfg) |
| |
| static doca_error_t | parse_and_read_data_ids_json_file (struct telemetry_diag_sample_cfg *cfg) |
| |
| static json_object * | create_data_id_pair (char *name, char *data_id_string) |
| |
| static doca_error_t | create_default_json (struct telemetry_diag_sample_cfg *cfg, struct json_object *example_json) |
| |
| static doca_error_t | generate_example_json (struct telemetry_diag_sample_cfg *cfg) |
| |
| static void | set_default_params (struct telemetry_diag_sample_cfg *cfg) |
| |
| int | main (int argc, char **argv) |
| |
◆ DATA_ID_PORT_0_RX_BYTES
| #define DATA_ID_PORT_0_RX_BYTES 0x1020000100000000 |
◆ DATA_ID_PORT_0_RX_PACKETS
| #define DATA_ID_PORT_0_RX_PACKETS 0x1020000300000000 |
◆ DATA_ID_PORT_0_TX_BYTES
| #define DATA_ID_PORT_0_TX_BYTES 0x1140000100000000 |
◆ DATA_ID_PORT_0_TX_PACKETS
| #define DATA_ID_PORT_0_TX_PACKETS 0x1140000300000000 |
◆ DATA_ID_STRING_MAX_LEN
| #define DATA_ID_STRING_MAX_LEN 20 |
◆ DEFAULT_DATA_IDS_PATH
| #define DEFAULT_DATA_IDS_PATH "/0" |
◆ DEFAULT_EXAMPLE_JSON_PATH
| #define DEFAULT_EXAMPLE_JSON_PATH "/0" |
◆ DEFAULT_FORCE_OWNERSHIP
| #define DEFAULT_FORCE_OWNERSHIP 0 |
◆ DEFAULT_LOG_MAX_NUM_SAMPLES
| #define DEFAULT_LOG_MAX_NUM_SAMPLES 10 |
◆ DEFAULT_MAX_NUM_SAMPLES_PER_READ
| #define DEFAULT_MAX_NUM_SAMPLES_PER_READ 128 |
◆ DEFAULT_OUTPUT_FORMAT
◆ DEFAULT_OUTPUT_PATH
| #define DEFAULT_OUTPUT_PATH "/tmp/out.csv" |
◆ DEFAULT_SAMPLE_MODE
◆ DEFAULT_SAMPLE_PERIOD_NS
| #define DEFAULT_SAMPLE_PERIOD_NS 100000 /* 100 usec */ |
◆ DEFAULT_TOTAL_RUN_TIME_SECS
| #define DEFAULT_TOTAL_RUN_TIME_SECS 1 |
◆ JSON_DATA_ID_KEY
| #define JSON_DATA_ID_KEY "data_id" |
◆ JSON_NAME_KEY
| #define JSON_NAME_KEY "name" |
◆ MAX_DESCRIPTION_LEN
| #define MAX_DESCRIPTION_LEN 256 |
◆ create_data_id_pair()
| static json_object* create_data_id_pair |
( |
char * |
name, |
|
|
char * |
data_id_string |
|
) |
| |
|
static |
◆ create_default_json()
◆ data_ids_callback()
| static doca_error_t data_ids_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ DOCA_LOG_REGISTER()
| DOCA_LOG_REGISTER |
( |
TELEMETRY_DIAG::MAIN |
| ) |
|
◆ example_json_file_callback()
| static doca_error_t example_json_file_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ force_ownership_callback()
| static doca_error_t force_ownership_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ generate_example_json()
◆ log_max_num_samples_callback()
| static doca_error_t log_max_num_samples_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ max_num_samples_per_read_callback()
| static doca_error_t max_num_samples_per_read_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ output_callback()
| static doca_error_t output_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ output_format_callback()
| static doca_error_t output_format_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ parse_and_read_data_ids_json_file()
◆ parse_json_data_ids()
◆ pci_address_callback()
| static doca_error_t pci_address_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ register_telemetry_diag_params()
◆ run_time_callback()
| static doca_error_t run_time_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ sample_mode_callback()
| static doca_error_t sample_mode_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ sample_period_callback()
| static doca_error_t sample_period_callback |
( |
void * |
param, |
|
|
void * |
config |
|
) |
| |
|
static |
◆ set_default_data_ids()
◆ set_default_params()