29#if __linux__ || __APPLE__
48#define MAX_DEVICE_NAME_SIZE (9)
49#define ABSOLUTE_TEMP_ZERO (-273)
64#include <cutils/properties.h>
65#define PROP_DECODER_TYPE "nidec_service_init"
66#define LOG_TAG "ni_rsrc_mon"
83static BOOL WINAPI console_ctrl_handler(DWORD ctrl_type)
117void sig_handler(
int sig)
119 if (sig == SIGTERM || sig == SIGINT || sig == SIGHUP)
132void setup_signal_handler(
void)
134 if (signal(SIGTERM, sig_handler) == SIG_ERR ||
135 signal(SIGHUP, sig_handler) == SIG_ERR ||
136 signal(SIGINT, sig_handler) == SIG_ERR)
138 perror(
"ERROR: signal handler setup");
149void get_pcie_addr(
char *device_name,
char *pcie)
161int get_numa_node(
char *device_name)
180 ni_device_handle_t device_handle)
184 fprintf(stderr,
"Error: device_type %d is not a valid device type\n",
189 if (
device_handles[xcoder_device_type][module_id] == device_handle)
192 NI_INVALID_DEVICE_HANDLE;
197 "Error: device_handle to remove %" PRId64
198 "not match device_handles[%d][%d]=%" PRId64
"\n",
199 (int64_t)device_handle, device_type, module_id,
221 const size_t len = strlen(numArray);
223 for (i = 0; i < len; i++)
225 if (!isdigit(numArray[i]))
227 fprintf(stderr,
"invalid, ABORTING\n");
232 return len == i ?
atoi(numArray) : 0;
245 if ( *(int32_t*)a < *(int32_t*)b )
return -1;
246 if ( *(int32_t*)a > *(int32_t*)b )
return 1;
257 else if ((index >= 0 && index < 4) || (index >= 10 && index < 13))
261 else if (index >= 4 && index < 10)
265 else if (index >= 13 && index < 15)
274static char sid[5] =
"0000";
280 snprintf(sid,
sizeof(sid),
"%04x", 0);
285 snprintf(sid,
sizeof(sid),
"%04x",
id);
293 int32_t **module_ids)
295 unsigned int device_count;
298 size_of_i32 =
sizeof(int32_t);
300 device_count = p_device_queue->
xcoder_cnt[device_type];
301 *module_ids = malloc(size_of_i32 * device_count);
304 fprintf(stderr,
"ERROR: malloc() failed for module_ids\n");
309 p_device_queue->
xcoders[device_type],
310 size_of_i32 * device_count);
318 g_device_type_str[device_type],
331 if (!p_device_context)
339 if (
device_handles[xcoder_device_type][module_id] != NI_INVALID_DEVICE_HANDLE)
348 if (p_session_context->
device_handle != NI_INVALID_DEVICE_HANDLE)
355 if (p_session_context->
device_handle == NI_INVALID_DEVICE_HANDLE)
360 "ERROR: ni_device_open2() failed for %s: %s\n",
369 p_session_context->
hw_id =
378 "ERROR: cannot print detailed info for %s as it has FW API "
401 "ERROR: ni_device_session_query() returned %d for %s:%s:%d\n",
418 memcpy(p_session_context->
fw_rev,
431 if (!p_device_context)
437 if (p_session_context->
device_handle == NI_INVALID_DEVICE_HANDLE)
442 "ERROR: ni_device_open2() failed for %s: %s\n",
450 p_session_context->
hw_id =
454 return return_code ? false :
true;
460 unsigned int module_count;
461 int32_t *module_id_arr = NULL;
466 module_count =
get_modules(module_type, coders, module_name, &module_id_arr);
468 printf(
"Error: module not found!\n");
472 bool gen_log_file =
true;
474 void* p_log_buffer = NULL;
475 if (devid >= 0 && (uint32_t)devid < module_count)
481 if (!
open_and_get_log(p_device_context, sessionCtxt, &p_log_buffer, gen_log_file)) {
482 printf(
"Error: failed to dump fw log of card:%d blk_name:%s\n",
485 printf(
"Success: dumped fw log of card:%d blk_name:%s\n",
495 for (i = 0; i < module_count; i++)
498 if (!
open_and_get_log(p_device_context, sessionCtxt, &p_log_buffer, gen_log_file)) {
499 printf(
"Error: failed to dump fw log of card:%d blk_name:%s\n",
503 printf(
"Success: dumped fw log of card:%d blk_name:%s\n",
518 switch (*p_device_type)
531#define DYN_STR_BUF_CHUNK_SIZE 4096
553 int add_buf_size = 0;
554 char *tmp_char_ptr = NULL;
558 fprintf(stderr,
"ERROR: invalid param *dyn_str_buf\n");
572 formatted_len = vsnprintf(NULL, 0, fmt, tmp_vl);
577 add_buf_size = (formatted_len + 1) > avail_buf ?
591 fprintf(stderr,
"ERROR: strcat_dyn_buf() failed realloc()\n");
618 unsigned int index, device_count;
640 strcat_dyn_buf(&output_buf,
"Num %ss: %u\n", device_name, device_count);
646 "INDEX LOAD(VPU MODEL FW ) INST MEM(TOTAL CRITICAL SHARE ) "
647 "DEVICE L_FL2V N_FL2V FR N_FR\n");
652 "INDEX LOAD(VPU FW ) INST MEM(TOTAL SHARE ) "
653 "DEVICE L_FL2V N_FL2V FR N_FR\n");
657 "INDEX LOAD(VPU MODEL FW ) INST MEM(TOTAL CRITICAL SHARE P2P) "
658 "DEVICE L_FL2V N_FL2V FR N_FR\n");
662 "INDEX LOAD( FW ) INST MEM(TOTAL SHARE P2P) "
663 "DEVICE L_FL2V N_FL2V FR N_FR\n");
669 for (index = 0; index < device_count; index++)
677 device_name, detail, detail_data_v1))
686 "%-5d %-3u %-3u %-3u %-3u/%-3d %-3u %-3u "
687 "%-3u %-11s %-8.8s %-8.8s %-8.8s %-8.8s\n",
706 "%-5d %-3u %-3u %-3u/%-3d %-3u "
707 "%-3u %-11s %-8.8s %-8.8s %-8.8s %-8.8s\n",
723 "%-5d %-3u %-3u %-3u %-3u/%-3d %-3u %-3u "
724 "%-3u %-3u %-11s %-8.8s %-8.8s %-8.8s %-8.8s\n",
743 "%-5d %-3u %-3u/%-3d %-3u "
744 "%-3u %-3u %-11s %-8.8s %-8.8s %-8.8s %-8.8s\n",
791 g_temp_load = (uint32_t*)calloc(device_count,
sizeof(uint32_t));
794 fprintf(stderr,
"ERROR: calloc() failed for g_temp_load\n");
797 g_temp_pload = (uint32_t*)calloc(device_count,
sizeof(uint32_t));
800 fprintf(stderr,
"ERROR: calloc() failed for g_temp_pload\n");
806 fprintf(stderr,
"ERROR: calloc() failed for g_temp_pthroughput\n");
812 fprintf(stderr,
"ERROR: calloc() failed for g_temp_sharemem\n");
825 "INDEX LOAD( FW ) PCIE_Card2Host_Gbps "
826 "DEVICE L_FL2V N_FL2V FR N_FR\n");
831 "INDEX LOAD( FW ) MEM( SHARE ) "
832 "DEVICE L_FL2V N_FL2V FR N_FR\n");
837 printf(
"%s", output_buf.
str_buf);
846 for (index = 0; index < device_count; index++)
855 device_name, detail, detail_data_v1))
864 "ERROR: ni_query_nvme_status() returned %d for %s:%s:%d\n",
887 "%-11s %-8.8s %-8.8s %-8.8s %-8.8s\n",
904 "%-11s %-8.8s %-8.8s %-8.8s %-8.8s\n",
928 printf(
"%s", output_buf.
str_buf);
935 bool copied_block_name;
939 unsigned int number_of_quadras;
940 unsigned int number_of_device_types_present;
941 unsigned int device_type_counter;
942 unsigned int *maximum_firmware_loads;
943 unsigned int *maximum_firmware_loads_per_quadra;
957 maximum_firmware_loads = calloc(number_of_quadras,
sizeof(
unsigned int));
958 if (!maximum_firmware_loads)
960 fprintf(stderr,
"calloc() returned NULL\n");
964 maximum_firmware_loads_per_quadra = NULL;
965 p_device_context = NULL;
967 for (guid = 0; guid < number_of_quadras; guid++)
970 maximum_firmware_loads_per_quadra = maximum_firmware_loads + guid;
971 number_of_device_types_present = 0;
972 device_type_counter = 0;
973 copied_block_name =
false;
976 device_type < maximum_device_type;
979 if (p_device_queue->
xcoders[device_type][guid] != -1)
981 number_of_device_types_present++;
986 device_type < maximum_device_type;
990 g_device_type_str[device_type],
993 if (p_device_queue->
xcoders[device_type][guid] == -1)
1000 p_device_queue->
xcoders[device_type][guid]);
1004 device_name, detail, detail_data_v1))
1015 "%s: Simple output not supported. Try '-o full' "
1025 if (!copied_block_name)
1030 copied_block_name =
true;
1033 if (*maximum_firmware_loads_per_quadra < p_session_context->load_query.
fw_load)
1038 device_type_counter++;
1039 if (device_type_counter < number_of_device_types_present)
1060 if (*maximum_firmware_loads_per_quadra < load_query.
fw_load)
1062 *maximum_firmware_loads_per_quadra = load_query.
fw_load;
1064 if (*maximum_firmware_loads_per_quadra < load_query.
tp_fw_load)
1066 *maximum_firmware_loads_per_quadra = load_query.
tp_fw_load;
1069 *maximum_firmware_loads_per_quadra);
1074 stderr,
"ERROR: ni_query_nvme_status() returned %d for %s:%s:%d\n",
1088 printf(
"%s", output_buf.
str_buf);
1090 free(maximum_firmware_loads);
1096 unsigned int i, index, device_count;
1098 int32_t *module_ids;
1106 int first_item_printed = 0;
1107 int first_device_type_printed = 0;
1112 device_type != max_device_type;
1125 if(first_device_type_printed)
1134 first_item_printed = 0;
1136 for (i = 0; i < device_count; i++)
1144 device_name, detail, detail_data_v1))
1153 if(first_item_printed)
1162 "\t\t\t\"NUMBER\": %u,\n"
1163 "\t\t\t\"INDEX\": %u,\n"
1164 "\t\t\t\"AvgCost\": %u,\n"
1165 "\t\t\t\"FrameRate\": %u,\n"
1166 "\t\t\t\"IDR\": %u,\n"
1167 "\t\t\t\"InFrame\": %u,\n"
1168 "\t\t\t\"OutFrame\": %u,\n"
1169 "\t\t\t\"Width\": %u,\n"
1170 "\t\t\t\"Height\": %u,\n"
1171 "\t\t\t\"SID\": \"%s\",\n"
1172 "\t\t\t\"DEVICE\": \"%s\"\n"
1190 "\t\t\t\"NUMBER\": %u,\n"
1191 "\t\t\t\"INDEX\": %u,\n"
1192 "\t\t\t\"AvgCost\": %u,\n"
1193 "\t\t\t\"FrameRate\": %u,\n"
1194 "\t\t\t\"IDR\": %u,\n"
1195 "\t\t\t\"UserIDR\": %u,\n"
1196 "\t\t\t\"InFrame\": %u,\n"
1197 "\t\t\t\"OutFrame\": %u,\n"
1198 "\t\t\t\"BR\": %u,\n"
1199 "\t\t\t\"AvgBR\": %u,\n"
1200 "\t\t\t\"Width\": %u,\n"
1201 "\t\t\t\"Height\": %u,\n"
1202 "\t\t\t\"Format\": \"%s\",\n"
1203 "\t\t\t\"SID\": \"%s\",\n"
1204 "\t\t\t\"DEVICE\": \"%s\"\n"
1222 first_item_printed = 1;
1231 first_device_type_printed = 1;
1239 printf(
"%s", output_buf.
str_buf);
1250 unsigned int i, index, device_count;
1252 int32_t *module_ids;
1253 uint32_t total_contexts;
1255 uint32_t model_load;
1257 char pcie[64] = {0};
1271 device_type != max_device_type;
1285 for (i = 0; i < device_count; i++)
1293 device_name, detail, detail_data_v1))
1330 "\t\t\t\"NUMBER\": %u,\n"
1331 "\t\t\t\"INDEX\": %u,\n"
1332 "\t\t\t\"AvgCost\": %u,\n"
1333 "\t\t\t\"FrameRate\": %u,\n"
1334 "\t\t\t\"IDR\": %u,\n"
1335 "\t\t\t\"InFrame\": %u,\n"
1336 "\t\t\t\"OutFrame\": %u,\n"
1337 "\t\t\t\"Width\": %u,\n"
1338 "\t\t\t\"Height\": %u,\n"
1339 "\t\t\t\"SID\": %s,\n"
1340 "\t\t\t\"DEVICE\": \"%s\",\n"
1358 "\t\t\t\"NUMBER\": %u,\n"
1359 "\t\t\t\"INDEX\": %u,\n"
1360 "\t\t\t\"AvgCost\": %u,\n"
1361 "\t\t\t\"FrameRate\": %u,\n"
1362 "\t\t\t\"IDR\": %u,\n"
1363 "\t\t\t\"UserIDR\": %u,\n"
1364 "\t\t\t\"InFrame\": %u,\n"
1365 "\t\t\t\"OutFrame\": %u,\n"
1366 "\t\t\t\"BR\": %u,\n"
1367 "\t\t\t\"AvgBR\": %u,\n"
1368 "\t\t\t\"Width\": %u,\n"
1369 "\t\t\t\"Height\": %u,\n"
1370 "\t\t\t\"Format\": %s,\n"
1371 "\t\t\t\"SID\": %s,\n"
1372 "\t\t\t\"DEVICE\": \"%s\",\n"
1406 "\t\t\t\"NUMBER\": %u,\n"
1407 "\t\t\t\"INDEX\": %d,\n"
1408 "\t\t\t\"LOAD\": %u,\n"
1409 "\t\t\t\"LOAD-ALL\": %u,\n"
1410 "\t\t\t\"MODEL_LOAD\": %u,\n"
1411 "\t\t\t\"MODEL_LOAD-ALL\": %u,\n"
1412 "\t\t\t\"FW_LOAD\": %u,\n"
1413 "\t\t\t\"INST\": %u,\n"
1414 "\t\t\t\"INST-ALL\": %u,\n"
1415 "\t\t\t\"MAX_INST\": %d,\n"
1416 "\t\t\t\"MEM\": %u,\n"
1417 "\t\t\t\"CRITICAL_MEM\": %u,\n"
1418 "\t\t\t\"SHARE_MEM\": %u,\n"
1419 "\t\t\t\"P2P_MEM\": %u,\n"
1420 "\t\t\t\"DEVICE\": \"%s\",\n"
1421 "\t\t\t\"L_FL2V\": \"%s\",\n"
1422 "\t\t\t\"N_FL2V\": \"%s\",\n"
1423 "\t\t\t\"FR\": \"%.8s\",\n"
1424 "\t\t\t\"N_FR\": \"%.8s\""
1426 ",\n\t\t\t\"NUMA_NODE\": %d,\n"
1427 "\t\t\t\"PCIE_ADDR\": \"%s\"\n"
1434 device_name, device_count,
1464 "\t\t\t\"NUMBER\": %u,\n"
1465 "\t\t\t\"INDEX\": %d,\n"
1466 "\t\t\t\"LOAD\": %u,\n"
1467 "\t\t\t\"MODEL_LOAD\": %u,\n"
1468 "\t\t\t\"FW_LOAD\": %u,\n"
1469 "\t\t\t\"INST\": %u,\n"
1470 "\t\t\t\"MAX_INST\": %d,\n"
1471 "\t\t\t\"MEM\": %u,\n"
1472 "\t\t\t\"CRITICAL_MEM\": %u,\n"
1473 "\t\t\t\"SHARE_MEM\": %u,\n"
1474 "\t\t\t\"P2P_MEM\": %u,\n"
1475 "\t\t\t\"DEVICE\": \"%s\",\n"
1476 "\t\t\t\"L_FL2V\": \"%s\",\n"
1477 "\t\t\t\"N_FL2V\": \"%s\",\n"
1478 "\t\t\t\"FR\": \"%.8s\",\n"
1479 "\t\t\t\"N_FR\": \"%.8s\""
1481 ",\n\t\t\t\"NUMA_NODE\": %d,\n"
1482 "\t\t\t\"PCIE_ADDR\": \"%s\"\n"
1489 device_name, device_count,
1526 printf(
"%s", output_buf.
str_buf);
1549 printf(
"%s", output_buf.
str_buf);
1556 g_temp_load = (uint32_t*)calloc(device_count,
sizeof(uint32_t));
1559 fprintf(stderr,
"ERROR: calloc() failed for g_temp_load\n");
1562 g_temp_pload = (uint32_t*)calloc(device_count,
sizeof(uint32_t));
1565 fprintf(stderr,
"ERROR: calloc() failed for g_temp_pload\n");
1571 fprintf(stderr,
"ERROR: calloc() failed for g_temp_pthroughput\n");
1577 fprintf(stderr,
"ERROR: calloc() failed for g_temp_sharemem\n");
1586 for (i = 0; i < device_count; i++)
1594 device_name, detail, detail_data_v1))
1604 "ERROR: ni_query_nvme_status() returned %d for %s:%s:%d\n",
1632 "\t\t\t\"NUMBER\": %u,\n"
1633 "\t\t\t\"INDEX\": %d,\n"
1634 "\t\t\t\"LOAD\": 0,\n"
1635 "\t\t\t\"MODEL_LOAD\": 0,\n"
1636 "\t\t\t\"FW_LOAD\": %u,\n"
1637 "\t\t\t\"INST\": 0,\n"
1638 "\t\t\t\"MAX_INST\": 0,\n"
1639 "\t\t\t\"MEM\": 0,\n"
1640 "\t\t\t\"CRITICAL_MEM\": 0,\n"
1641 "\t\t\t\"SHARE_MEM\": %u,\n"
1642 "\t\t\t\"PCIE_THROUGHPUT\": %.1f,\n"
1643 "\t\t\t\"P2P_MEM\": 0,\n"
1644 "\t\t\t\"DEVICE\": \"%s\",\n"
1645 "\t\t\t\"L_FL2V\": \"%s\",\n"
1646 "\t\t\t\"N_FL2V\": \"%s\",\n"
1647 "\t\t\t\"FR\": \"%.8s\",\n"
1648 "\t\t\t\"N_FR\": \"%.8s\""
1650 ",\n\t\t\t\"NUMA_NODE\": %d,\n"
1651 "\t\t\t\"PCIE_ADDR\": \"%s\"\n"
1658 device_name, device_count,
1680 "\t\t\t\"NUMBER\": %u,\n"
1681 "\t\t\t\"INDEX\": %d,\n"
1682 "\t\t\t\"LOAD\": 0,\n"
1683 "\t\t\t\"MODEL_LOAD\": 0,\n"
1684 "\t\t\t\"FW_LOAD\": %u,\n"
1685 "\t\t\t\"INST\": 0,\n"
1686 "\t\t\t\"MAX_INST\": 0,\n"
1687 "\t\t\t\"MEM\": 0,\n"
1688 "\t\t\t\"CRITICAL_MEM\": 0,\n"
1689 "\t\t\t\"SHARE_MEM\": %u,\n"
1690 "\t\t\t\"P2P_MEM\": 0,\n"
1691 "\t\t\t\"DEVICE\": \"%s\",\n"
1692 "\t\t\t\"L_FL2V\": \"%s\",\n"
1693 "\t\t\t\"N_FL2V\": \"%s\",\n"
1694 "\t\t\t\"FR\": \"%.8s\",\n"
1695 "\t\t\t\"N_FR\": \"%.8s\""
1697 ",\n\t\t\t\"NUMA_NODE\": %d,\n"
1698 "\t\t\t\"PCIE_ADDR\": \"%s\"\n"
1705 device_name, device_count,
1731 printf(
"%s", output_buf.
str_buf);
1738 bool has_written_start =
false;
1740 unsigned int index, device_count;
1741 int32_t *module_ids;
1742 uint32_t total_contexts;
1744 uint32_t model_load;
1746 char pcie[64] = {0};
1751 char power_consumption[16];
1772 if (!has_written_start)
1775 has_written_start =
true;
1782 for (index = 0; index < device_count; index++)
1790 device_name, detail, detail_data_v1))
1829 "\t\t\"NUMBER\": %u,\n"
1830 "\t\t\"INDEX\": %d,\n"
1831 "\t\t\"LOAD\": %u,\n"
1832 "\t\t\"LOAD-ALL\": %u,\n"
1833 "\t\t\"MODEL_LOAD\": %u,\n"
1834 "\t\t\"MODEL_LOAD-ALL\": %u,\n"
1835 "\t\t\"FW_LOAD\": %u,\n"
1836 "\t\t\"INST\": %u,\n"
1837 "\t\t\"INST-ALL\": %u,\n"
1838 "\t\t\"MAX_INST\": %d,\n"
1839 "\t\t\"MEM\": %u,\n"
1840 "\t\t\"CRITICAL_MEM\": %u,\n"
1841 "\t\t\"SHARE_MEM\": %u,\n"
1842 "\t\t\"P2P_MEM\": %u,\n"
1843 "\t\t\"DEVICE\": \"%s\",\n"
1844 "\t\t\"L_FL2V\": \"%s\",\n"
1845 "\t\t\"N_FL2V\": \"%s\",\n"
1846 "\t\t\"FR\": \"%.8s\",\n"
1847 "\t\t\"N_FR\": \"%.8s\""
1849 ",\n\t\t\"NUMA_NODE\": %d,\n"
1850 "\t\t\"PCIE_ADDR\": \"%s\""
1877 "\t\t\"NUMBER\": %u,\n"
1878 "\t\t\"INDEX\": %d,\n"
1879 "\t\t\"LOAD\": %u,\n"
1880 "\t\t\"MODEL_LOAD\": %u,\n"
1881 "\t\t\"FW_LOAD\": %u,\n"
1882 "\t\t\"INST\": %u,\n"
1883 "\t\t\"MAX_INST\": %d,\n"
1884 "\t\t\"MEM\": %u,\n"
1885 "\t\t\"CRITICAL_MEM\": %u,\n"
1886 "\t\t\"SHARE_MEM\": %u,\n"
1887 "\t\t\"P2P_MEM\": %u,\n"
1888 "\t\t\"DEVICE\": \"%s\",\n"
1889 "\t\t\"L_FL2V\": \"%s\",\n"
1890 "\t\t\"N_FL2V\": \"%s\",\n"
1891 "\t\t\"FR\": \"%.8s\",\n"
1892 "\t\t\"N_FR\": \"%.8s\""
1894 ",\n\t\t\"NUMA_NODE\": %d,\n"
1895 "\t\t\"PCIE_ADDR\": \"%s\""
1920 ",\n\t\t\"TEMP\": %d,\n"
1921 "\t\t\"POWER\": \"%s\"\n"
1930 if (index < device_count - 1)
1972 printf(
"%s", output_buf.
str_buf);
1979 g_temp_load = (uint32_t*)calloc(device_count,
sizeof(uint32_t));
1982 fprintf(stderr,
"ERROR: calloc() failed for g_temp_load\n");
1985 g_temp_pload = (uint32_t*)calloc(device_count,
sizeof(uint32_t));
1988 fprintf(stderr,
"ERROR: calloc() failed for g_temp_pload\n");
1994 fprintf(stderr,
"ERROR: calloc() failed for g_temp_pthroughput\n");
2000 fprintf(stderr,
"ERROR: calloc() failed for g_temp_sharemem\n");
2008 for (index = 0; index < device_count; index++)
2017 device_name, detail, detail_data_v1))
2027 "ERROR: ni_query_nvme_status() returned %d for %s:%s:%d\n",
2065 "\t\t\"NUMBER\": %u,\n"
2066 "\t\t\"INDEX\": %d,\n"
2067 "\t\t\"LOAD\": 0,\n"
2068 "\t\t\"MODEL_LOAD\": 0,\n"
2069 "\t\t\"FW_LOAD\": %u,\n"
2070 "\t\t\"INST\": 0,\n"
2071 "\t\t\"MAX_INST\": 0,\n"
2073 "\t\t\"CRITICAL_MEM\": 0,\n"
2074 "\t\t\"SHARE_MEM\": %u,\n"
2075 "\t\t\"PCIE_THROUGHPUT\": %.1f,\n"
2076 "\t\t\"P2P_MEM\": 0,\n"
2077 "\t\t\"DEVICE\": \"%s\",\n"
2078 "\t\t\"L_FL2V\": \"%s\",\n"
2079 "\t\t\"N_FL2V\": \"%s\",\n"
2080 "\t\t\"FR\": \"%.8s\",\n"
2081 "\t\t\"N_FR\": \"%.8s\""
2083 ",\n\t\t\"NUMA_NODE\": %d,\n"
2084 "\t\t\"PCIE_ADDR\": \"%s\""
2105 "\t\t\"NUMBER\": %u,\n"
2106 "\t\t\"INDEX\": %d,\n"
2107 "\t\t\"LOAD\": 0,\n"
2108 "\t\t\"MODEL_LOAD\": 0,\n"
2109 "\t\t\"FW_LOAD\": %u,\n"
2110 "\t\t\"INST\": 0,\n"
2111 "\t\t\"MAX_INST\": 0,\n"
2113 "\t\t\"CRITICAL_MEM\": 0,\n"
2114 "\t\t\"SHARE_MEM\": %u,\n"
2115 "\t\t\"P2P_MEM\": 0,\n"
2116 "\t\t\"DEVICE\": \"%s\",\n"
2117 "\t\t\"L_FL2V\": \"%s\",\n"
2118 "\t\t\"N_FL2V\": \"%s\",\n"
2119 "\t\t\"FR\": \"%.8s\",\n"
2120 "\t\t\"N_FR\": \"%.8s\""
2122 ",\n\t\t\"NUMA_NODE\": %d,\n"
2123 "\t\t\"PCIE_ADDR\": \"%s\""
2140 ",\n\t\t\"TEMP\": %d,\n"
2141 "\t\t\"POWER\": \"%s\"\n"
2150 if (index < device_count - 1)
2177 printf(
"%s", output_buf.
str_buf);
2184 int index, instance_count;
2186 unsigned int module_count;
2188 int32_t *module_id_arr = NULL;
2197 module_type != max_device_type;
2211 strcat_dyn_buf(&output_buf,
"Num %ss: %u\n", module_name, module_count);
2219 "%-5s %-7s %-9s %-5s %-7s %-8s %-4s %-5s %-6s %-5s %-14s %-20s\n",
"INDEX",
2220 "AvgCost",
"FrameRate",
"IDR",
"InFrame",
"OutFrame",
"fps",
"Width",
"Height",
2221 "SID",
"DEVICE",
"NAMESPACE");
2226 "%-5s %-7s %-9s %-5s %-7s %-8s %-5s %-6s %-5s %-14s %-20s\n",
"INDEX",
2227 "AvgCost",
"FrameRate",
"IDR",
"InFrame",
"OutFrame",
"Width",
"Height",
2228 "SID",
"DEVICE",
"NAMESPACE");
2236 "%-5s %-7s %-9s %-5s %-7s %-7s %-8s %-4s %-10s %-10s %-5s %-6s %-9s %-5s %-14s %-20s\n",
"INDEX",
2237 "AvgCost",
"FrameRate",
"IDR",
"UserIDR",
"InFrame",
"OutFrame",
"fps",
"BR",
"AvgBR",
"Width",
"Height",
2238 "Format",
"SID",
"DEVICE",
"NAMESPACE");
2243 "%-5s %-7s %-9s %-5s %-7s %-7s %-8s %-10s %-10s %-5s %-6s %-9s %-5s %-14s %-20s\n",
"INDEX",
2244 "AvgCost",
"FrameRate",
"IDR",
"UserIDR",
"InFrame",
"OutFrame",
"BR",
"AvgBR",
"Width",
"Height",
2245 "Format",
"SID",
"DEVICE",
"NAMESPACE");
2251 "%-5s %-4s %-10s %-4s %-4s %-9s %-7s %-14s\n",
"INDEX",
2252 "LOAD",
"MODEL_LOAD",
"INST",
"MEM",
"SHARE_MEM",
"P2P_MEM",
2256 for (i = 0; i < module_count; i++)
2264 module_name, detail, detail_data_v1))
2272 if(previous_detail_data_p && checkInterval)
2274 if(previous_detail_data_p[module_type][i].sInstDetailStatus[index].ui16FrameRate)
2279 "%-5d %-7d %-9d %-5u %-7d %-8d %-4d %-5d %-6d %-5s %-14s %-20s\n",
2286 (detail_data_v1->
sInstDetailStatus[index].
ui32NumOutFrame - previous_detail_data_p[module_type][i].sInstDetailStatus[index].ui32NumOutFrame) / checkInterval,
2296 "%-5d %-7d %-9d %-5u %-7d %-7d %-8d %-4d %-10d %-10d %-5d %-6d %-9s %-5s %-14s %-20s\n",
2304 (detail_data_v1->
sInstDetailStatus[index].
ui32NumOutFrame - previous_detail_data_p[module_type][i].sInstDetailStatus[index].ui32NumOutFrame) / checkInterval,
2321 "%-5d %-7d %-9d %-5u %-7d %-8d %-5d %-6d %-5s %-14s %-20s\n",
2337 "%-5d %-7d %-9d %-5u %-7d %-7d %-8d %-10d %-10d %-5d %-6d %-9s %-5s %-14s %-20s\n",
2357 if(previous_detail_data_p)
2365 "%-5d %-4u %-10u %-4u %-4u %-9u %-7u %-14s\n",
2384 free(module_id_arr);
2388 printf(
"%s", output_buf.
str_buf);
2395 unsigned int index, device_count;
2396 int32_t *module_ids;
2401 char power_consumption[16];
2402 int instance_count = 0;
2414 printf(
"%s", output_buf.
str_buf);
2419 for (index = 0; index < device_count; index++)
2422 if (!p_device_context)
2429 if (
device_handles[xcoder_device_type][module_id] != NI_INVALID_DEVICE_HANDLE)
2438 if (p_session_context->
device_handle != NI_INVALID_DEVICE_HANDLE)
2445 if (p_session_context->
device_handle == NI_INVALID_DEVICE_HANDLE)
2450 "ERROR: ni_device_open2() failed for %s: %s\n",
2471 "%-4s %-8s %-8s %-14s\n",
"TEMP",
"POWER",
"FLAVOR",
"DEVICE");
2473 "%-4d %-8s %-8c %-14s\n",
2481 if (instance_count == 0)
2484 "%-8s %-8s %-8s %-8s %-8.8s %-8.8s \n",
"INDEX",
"TEMP",
"POWER",
"FLAVOR",
"FR",
"SN");
2487 "%-8d %-8d %-8s %-8c %-8.8s %-8.*s \n",
2499 printf(
"%s", output_buf.
str_buf);
2506 setvbuf(stdout, NULL, _IOLBF, BUFSIZ);
2508 int skip_init_rsrc = 0;
2509 int should_match_rev = 1;
2516 time_t startTime = {0}, now = {0};
2517 int timeout_seconds = 0;
2518 struct tm *ltime = NULL;
2520 long long time_diff_hours, time_diff_minutes, time_diff_seconds;
2525 bool fw_log_dump =
false;
2526 bool core_reset_log_dump =
false;
2528 int refresh_device_pool = 1;
2529 bool is_first_query =
true;
2533 SetConsoleCtrlHandler(console_ctrl_handler, TRUE);
2535 setup_signal_handler();
2539 while ((opt =
getopt(argc, argv,
"n:o:D:C:k:R:rt:Sl:hvd")) != -1)
2545 if (!strcmp(
optarg,
"json"))
2549 else if (!strcmp(
optarg,
"simple"))
2553 else if (!strcmp(
optarg,
"text"))
2557 else if (!strcmp(
optarg,
"full"))
2561 else if (!strcmp(
optarg,
"json1"))
2565 else if (!strcmp(
optarg,
"json2"))
2569 else if (!strcmp(
optarg,
"extra"))
2575 fprintf(stderr,
"Error: unknown selection for outputFormat: %s\n",
optarg);
2588 if (core_reset_log_dump)
2597 should_match_rev = 0;
2601 printf(
"Timeout will be set %d\n", timeout_seconds);
2612 fprintf(stderr,
"FATAL: invalid log level selected: %s\n",
optarg);
2618 printf(
"-------- ni_rsrc_mon v%s --------\n"
2619 "The ni_rsrc_mon program provides a real-time view of NETINT Quadra resources\n"
2620 "running on the system.\n"
2622 "Usage: ni_rsrc_mon [OPTIONS]\n"
2623 "-n Specify reporting interval in one second interval. If 0 or no selection,\n"
2624 " report only once.\n"
2626 "-R Specify if refresh devices on host in each monitor interval.\n"
2627 " If 0, only refresh devices at the start.\n"
2629 "-o Output format. [text, simple, full, json, json1, json2, extra]\n"
2631 "-D Dump firmware logs to current directory. Default: 0(not dump fw log).\n"
2632 "-C Dump firmware core reset logs to current directory. Default: 0(not dump fw log).\n"
2633 "-k Specify to dump which card's firmware logs.\n"
2634 " Default: -1(dump fw log of all cards).\n"
2635 "-r Initialize Quadra device regardless firmware release version to\n"
2636 " libxcoder version compatibility.\n"
2637 " Default: only initialize devices with compatible firmware version.\n"
2638 "-t Set timeout time in seconds for device polling. Program will exit with\n"
2639 " failure if timeout is reached without finding at least one device. If 0 or\n"
2640 " no selection, poll indefinitely until a Quadra device is found.\n"
2642 "-S Skip init_rsrc.\n"
2643 "-d Print detailed information for decoder/encoder in text and json formats.\n"
2644 "-l Set loglevel of libxcoder API.\n"
2645 " [none, fatal, error, info, debug, trace]\n"
2647 "-h Open this help message.\n"
2648 "-v Print version info.\n"
2650 "Simple output shows the maximum firmware load amongst the subsystems on the\n"
2653 "Reporting columns for text output format\n"
2654 "INDEX index number used by resource manager to identify the resource\n"
2655 "LOAD realtime load given in percentage. This value is max of VPU and FW load reported in full output format\n"
2656 "MODEL_LOAD estimated load based on framerate and resolution\n"
2657 "INST number of job instances\n"
2658 "MEM usage of memory by the subsystem\n"
2659 "SHARE_MEM usage of memory shared across subsystems on the same device\n"
2660 "P2P_MEM usage of memory by P2P\n"
2661 "DEVICE path to NVMe device file handle\n"
2662 "NAMESPACE path to NVMe namespace file handle\n"
2663 "Additional information only in text(Default) mode \n"
2664 "TEMP current temperature (degrees Celsius)\n"
2665 "POWER current power(mW), N/A when query power not supported\n"
2666 "FLAVOR current Flavor, N/A when query flavor not supported\n"
2667 "FR current firmware revision\n"
2668 "SN serial number of the Quadra device\n"
2670 "Additional reporting columns for full output format\n"
2671 "VPU same as LOAD in JSON outputs\n"
2673 "TOTAL same as MEM\n"
2674 "CRITICAL usage of memory considered critical\n"
2675 "L_FL2V last ran firmware loader 2 version\n"
2676 "N_FL2V nor flash firmware loader 2 version\n"
2677 "FR current firmware revision\n"
2678 "N_FR nor flash firmware revision\n"
2679 "Unique field PCIe_Card2Host_Gbps for PCIE throughput from card to host in GBps(Values in steps of 100 Mbps)\n"
2681 "Additional reporting columns for full JSON formats\n"
2683 "FW_LOAD system load\n"
2685 "Extra output shows TEMP and POWER and FLAVOR of the Quadra device \n",
2689 printf(
"Release ver: %s\n"
2699 fprintf(stderr,
"FATAL: unknown option '-%c'\n", opt);
2702 fprintf(stderr,
"FATAL: unknown option character '\\x%x'\n", opt);
2709 fprintf(stderr,
"FATAL: option '-%c' lacks arg\n", opt);
2712 fprintf(stderr,
"FATAL: unhandled option\n");
2717 if(checkInterval > 0 && printFormat ==
FMT_JSON)
2719 fprintf(stderr,
"EXIT: -o json cannot use with -n params\n");
2723 if ((argc <= 2) && (
optind == 1))
2738 fprintf(stderr,
"FATAL: cannot allocate momory for ni_session_context_t\n");
2743 if (!skip_init_rsrc && (ret =
ni_rsrc_init(should_match_rev,timeout_seconds)) != 0)
2747 fprintf(stderr,
"FATAL: NI resource unavailable\n");
2748#if defined(__linux__)
2751 fprintf(stderr,
"Proceeding to dump firmware logs as root\n");
2754 fprintf(stderr,
"This operation requires root (sudo). Please rerun: sudo %s \n", argv[0]);
2757 int rc = ni_rsrc_log_dump(
".", core_reset_log_dump);
2759 fprintf(stderr,
"Firmware log dump: all devices successful.\n");
2761 fprintf(stderr,
"Firmware log dump: No Quadra devices found. Nothing to dump.\n");
2763 fprintf(stderr,
"Firmware log dump: One or more device logs failed to dump. Check previous error messages for details.\n");
2765 fprintf(stderr,
"Firmware log dump: Unexpected error, return code %d\n", rc);
2772 fprintf(stderr,
"FATAL: cannot access NI resource\n");
2781 fprintf(stderr,
"FATAL: cannot get devices info\n");
2788 printf(
"**************************************************\n");
2800 startTime = time(NULL);
2805 if(previous_detail_data == NULL)
2807 fprintf(stderr,
"FATAL: Allocate buffer fail\n");
2811 memset((
void *)previous_detail_data, 0, allocate_size);
2816 struct tm temp_time;
2820 strftime(buf,
sizeof(buf),
"%c", ltime);
2822 time_diff_seconds = (
long long)difftime(now, startTime);
2823 time_diff_minutes = time_diff_seconds / 60;
2824 time_diff_hours = time_diff_minutes / 60;
2827 if (is_first_query || refresh_device_pool)
2834 printf(
"%s up %02lld" ":%02lld" ":%02lld" " v%s\n", buf, time_diff_hours, time_diff_minutes % 60, time_diff_seconds % 60,
2841 if (WAIT_ABANDONED == WaitForSingleObject(p_device_pool->
lock, INFINITE))
2843 fprintf(stderr,
"ERROR: Failed to obtain mutex: %p\n", p_device_pool->
lock);
2848 if ( lockf(p_device_pool->
lock, F_LOCK, 0) )
2850 perror(
"ERROR: cannot lock p_device_pool");
2857 ReleaseMutex((HANDLE)p_device_pool->
lock);
2859 if ( lockf(p_device_pool->
lock, F_ULOCK, 0) )
2861 perror(
"ERROR: cannot unlock p_device_pool");
2865 switch (printFormat)
2869 print_text(coders, p_xCtxt, detail, &detail_data_v1, previous_detail_data, checkInterval);
2878 print_json(coders, p_xCtxt, detail, &detail_data_v1);
2883 print_json1(coders, p_xCtxt, 0, &detail_data_v1, 1);
2893 print_json1(coders, p_xCtxt, 0, &detail_data_v1, 2);
2905 is_first_query =
false;
2909 printf(
"**************************************************\n");
2914 if (checkInterval == 0)
2926 if (WAIT_ABANDONED == WaitForSingleObject(p_device_pool->
lock, INFINITE))
2928 fprintf(stderr,
"ERROR: Failed to obtain mutex: %p\n", p_device_pool->
lock);
2933 if ( lockf(p_device_pool->
lock, F_LOCK, 0) )
2935 perror(
"ERROR: cannot lock p_device_pool");
2940 ReleaseMutex((HANDLE)p_device_pool->
lock);
2942 if ( lockf(p_device_pool->
lock, F_ULOCK, 0) )
2944 perror(
"ERROR: cannot unlock p_device_pool");
2947#if defined(__linux__)
2948 if (core_reset_log_dump)
2950 fprintf(stderr,
"Proceeding to dump firmware logs as root\n");
2953 fprintf(stderr,
"This operation requires root (sudo). Please rerun: sudo %s \n", argv[0]);
2956 int rc = ni_rsrc_log_dump(
".", core_reset_log_dump);
2958 fprintf(stderr,
"Firmware log dump: all devices successful.\n");
2960 fprintf(stderr,
"Firmware log dump: No Quadra devices found. Nothing to dump.\n");
2962 fprintf(stderr,
"Firmware log dump: One or more device logs failed to dump. Check previous error messages for details.\n");
2964 fprintf(stderr,
"Firmware log dump: Unexpected error, return code %d\n", rc);
2985#ifdef __OPENHARMONY__
2986 system(
"chmod -R 777 /dev/shm/");
2987#ifdef XCODER_LINUX_VIRTIO_DRIVER_ENABLED
2988 system(
"chmod 777 /dev/block/vd* 2>/dev/null");
2990#elif defined(_ANDROID)
2991 system(
"chmod -R 777 /dev/shm/");
2992 system(
"chmod 777 /dev/block/nvme* 2>/dev/null");
2993 system(
"chmod 777 /dev/nvme* 2>/dev/null");
2994 property_set(
"ni_rsrc_init_completed",
"yes");
2998 if(checkInterval && previous_detail_data)
3000 free(previous_detail_data);
#define NI_XCODER_REVISION_API_MAJOR_VER_IDX
#define NI_MAX_DEVICE_CNT
#define NI_XCODER_REVISION
#define LIBXCODER_API_VERSION
#define NI_MAX_DEVICE_NAME_LEN
#define NI_MAX_CONTEXTS_PER_HW_INSTANCE
@ NI_DEVICE_TYPE_XCODER_MAX
#define GET_XCODER_DEVICE_TYPE(t)
@ NI_RETCODE_ERROR_RESOURCE_UNAVAILABLE
#define IS_XCODER_DEVICE_TYPE(t)
ni_retcode_t ni_query_nvme_status(ni_session_context_t *p_ctx, ni_load_query_t *p_load_query)
Query NVMe load from the device.
ni_retcode_t ni_device_session_query(ni_session_context_t *p_ctx, ni_device_type_t device_type)
Query session data from the device - If device_type is valid, will query session data from specified ...
ni_session_context_t * ni_device_session_context_alloc_init(void)
Allocate and initialize a new ni_session_context_t struct.
ni_retcode_t ni_device_session_query_detail_v1(ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_instance_mgr_detail_status_v1_t *detail_data)
Query detail session data from the device - If device_type is valid, will query session data from spe...
ni_retcode_t ni_device_session_query_detail(ni_session_context_t *p_ctx, ni_device_type_t device_type, ni_instance_mgr_detail_status_t *detail_data)
Query detail session data from the device - If device_type is valid, will query session data from spe...
void ni_device_close(ni_device_handle_t device_handle)
Close device and release resources.
ni_retcode_t ni_device_alloc_and_get_firmware_logs(ni_session_context_t *p_ctx, void **p_log_buffer, bool gen_log_file)
Allocate log buffer if needed and retrieve firmware logs from device.
ni_retcode_t ni_query_extra_info(ni_device_handle_t device_handle, ni_device_extra_info_t *p_dev_extra_info, uint8_t fw_rev[])
Query CompositeTemp from device.
ni_device_handle_t ni_device_open2(const char *p_dev, ni_device_mode_t mode)
Open device and return device device_handle if successful.
void ni_device_session_context_clear(ni_session_context_t *p_ctx)
Clear already allocated session context.
Public definitions for operating NETINT video processing devices for video processing.
struct _ni_instance_mgr_detail_status_v1 ni_instance_mgr_detail_status_v1_t
int getopt(int argc, char *argv[], const char *optstring)
Implementation of getopt() and getopt_long() for Windows environment.
ni_log_level_t arg_to_ni_log_level(const char *arg_str)
Convert terminal arg string to ni_log_level_t.
void ni_log_set_level(ni_log_level_t level)
Set ni_log_level.
#define NI_SW_RELEASE_TIME
int ni_rsrc_get_numa_node(char *device_name)
get linux numa_node
void ni_rsrc_free_device_context(ni_device_context_t *p_device_context)
Free previously allocated device context.
ni_retcode_t ni_rsrc_refresh(int should_match_rev)
Scan and refresh all resources on the host, taking into account hot-plugged and pulled out cards.
void ni_rsrc_free_device_pool(ni_device_pool_t *p_device_pool)
Free all resources taken by the device pool.
Public definitions for managing NETINT video processing devices.
LIB_API ni_device_context_t * ni_rsrc_get_device_context(ni_device_type_t type, int guid)
Allocates and returns a pointer to ni_device_context_t struct based on provided device_type and guid....
LIB_API ni_device_pool_t * ni_rsrc_get_device_pool(void)
Create and return the allocated ni_device_pool_t struct.
LIB_API int ni_rsrc_init(int should_match_rev, int timeout_seconds)
Initialize and create all resources required to work with NETINT NVMe transcoder devices....
int compareInt32_t(const void *a, const void *b)
compare two int32_t for qsort
char * get_pixel_format(ni_device_context_t *p_device_context, int index)
uint32_t * g_temp_pthroughput
#define DYN_STR_BUF_CHUNK_SIZE
uint32_t * g_temp_sharemem
#define MAX_DEVICE_NAME_SIZE
bool open_and_get_log(ni_device_context_t *p_device_context, ni_session_context_t *p_session_context, void **p_log_buffer, bool gen_log_file)
int remove_device_from_saved(ni_device_type_t device_type, int32_t module_id, ni_device_handle_t device_handle)
remove one device from stored device_handles
void print_text(ni_device_queue_t *coders, ni_session_context_t *sessionCtxt, int detail, ni_instance_mgr_detail_status_v1_t *detail_data_v1, ni_instance_mgr_detail_status_v1_t(*previous_detail_data_p)[NI_DEVICE_TYPE_XCODER_MAX], int checkInterval)
struct dyn_str_buf dyn_str_buf_t
int strcat_dyn_buf(dyn_str_buf_t *dyn_str_buf, const char *fmt,...)
Accumulate string data in a dynamically sized buffer. This is useful to separate error messages from ...
void print_full_text(ni_device_queue_t *p_device_queue, ni_session_context_t *p_session_context, int detail, ni_instance_mgr_detail_status_v1_t *detail_data_v1)
bool open_and_query(ni_device_type_t device_type, ni_device_context_t *p_device_context, ni_session_context_t *p_session_context, char *device_name, int detail, ni_instance_mgr_detail_status_v1_t *detail_data_v1)
int argToI(char *numArray)
convert number from argv input to integer if safe
void clear_dyn_str_buf(dyn_str_buf_t *dyn_str_buf)
void print_json_detail(ni_device_queue_t *p_device_queue, ni_session_context_t *p_session_context, ni_instance_mgr_detail_status_v1_t *detail_data_v1)
void print_json1(ni_device_queue_t *p_device_queue, ni_session_context_t *p_session_context, int detail, ni_instance_mgr_detail_status_v1_t *detail_data_v1, int format)
ni_device_handle_t device_handles[NI_DEVICE_TYPE_XCODER_MAX][NI_MAX_DEVICE_CNT]
bool swap_encoder_and_uploader(ni_device_type_t *p_device_type, char *device_name)
char * get_session_id(ni_device_context_t *p_device_context, int id)
void dump_fw_log(ni_device_queue_t *coders, ni_session_context_t *sessionCtxt, int devid)
unsigned int get_modules(ni_device_type_t device_type, ni_device_queue_t *p_device_queue, char *device_name, int32_t **module_ids)
void print_json(ni_device_queue_t *p_device_queue, ni_session_context_t *p_session_context, int detail, ni_instance_mgr_detail_status_v1_t *detail_data_v1)
void print_extra(ni_device_queue_t *p_device_queue, ni_session_context_t *p_session_context, int internal_call)
#define ABSOLUTE_TEMP_ZERO
void print_simple_text(ni_device_queue_t *p_device_queue, ni_session_context_t *p_session_context, int detail, ni_instance_mgr_detail_status_v1_t *detail_data_v1)
uint32_t g_xcoder_stop_process
Private definitions used by ni_rsrc_api.cpp for management of NETINT video processing devices.
void get_dev_pcie_addr(char *device_name, char *pcie, char *domain, char *slot, char *dev, char *func)
ni_retcode_t ni_strncpy(char *dest, size_t dmax, const char *src, size_t slen)
ni_retcode_t ni_strerror(char *dest, size_t dmax, int errnum)
ni_retcode_t ni_strcpy(char *dest, size_t dmax, const char *src)
void ni_usleep(int64_t usec)
struct tm * ni_localtime(struct tm *dest, const time_t *src)
int ni_vsprintf(char *dest, const size_t dmax, const char *fmt, va_list args)
int ni_sprintf(char *dest, size_t dmax, const char *fmt,...)
int ni_cmp_fw_api_ver(const char ver1[], const char ver2[])
Compare two 3 character strings containing a FW API version. Handle comparision when FW API version f...
ni_device_info_t * p_device_info
uint8_t serial_number[20]
char dev_name[NI_MAX_DEVICE_NAME_LEN]
char blk_name[NI_MAX_DEVICE_NAME_LEN]
uint8_t fl_ver_last_ran[8]
uint8_t fw_rev_nor_flash[8]
uint8_t fl_ver_nor_flash[8]
ni_device_queue_t * p_device_queue
int32_t xcoders[NI_DEVICE_TYPE_XCODER_MAX][NI_MAX_DEVICE_CNT]
uint32_t xcoder_cnt[NI_DEVICE_TYPE_XCODER_MAX]
ni_instance_mgr_detail_status_append_t sInstDetailStatusAppend[NI_MAX_CONTEXTS_PER_HW_INSTANCE]
ni_instance_mgr_detail_status_t sInstDetailStatus[NI_MAX_CONTEXTS_PER_HW_INSTANCE]
uint32_t fw_share_mem_usage
uint32_t fw_p2p_mem_usage
uint32_t fw_video_shared_mem_usage
uint32_t active_hwuploaders
uint32_t fw_video_mem_usage
uint32_t overall_fw_model_load
uint32_t overall_current_load
uint32_t overall_instance_count
ni_device_handle_t device_handle
ni_load_query_t load_query
ni_device_handle_t blk_io_handle
ni_overall_load_query_t overall_load_query