devargs: make device types generic
[dpdk.git] / app / proc_info / main.c
index 9c9b2b5..d4f6a82 100644 (file)
@@ -107,7 +107,7 @@ proc_info_usage(const char *prgname)
                        "default\n"
                "  --metrics: to display derived metrics of the ports, disabled by "
                        "default\n"
-               "  --xstats-name NAME: to display single xstat value by NAME\n"
+               "  --xstats-name NAME: to display single xstat id by NAME\n"
                "  --xstats-ids IDLIST: to display xstat values by id. "
                        "The argument is comma-separated list of xstat ids to print out.\n"
                "  --stats-reset: to reset port statistics\n"
@@ -434,7 +434,7 @@ nic_xstats_by_ids_display(uint8_t port_id, uint64_t *ids, int len)
        int ret, i;
        static const char *nic_stats_border = "########################";
 
-       values = malloc(sizeof(values) * len);
+       values = malloc(sizeof(*values) * len);
        if (values == NULL) {
                printf("Cannot allocate memory for xstats\n");
                return;
@@ -447,7 +447,7 @@ nic_xstats_by_ids_display(uint8_t port_id, uint64_t *ids, int len)
                return;
        }
 
-       if (len != rte_eth_xstats_get_names(
+       if (len != rte_eth_xstats_get_names_by_id(
                        port_id, xstats_names, len, ids)) {
                printf("Cannot get xstat names\n");
                goto err;
@@ -456,7 +456,7 @@ nic_xstats_by_ids_display(uint8_t port_id, uint64_t *ids, int len)
        printf("###### NIC extended statistics for port %-2d #########\n",
                           port_id);
        printf("%s############################\n", nic_stats_border);
-       ret = rte_eth_xstats_get(port_id, ids, values, len);
+       ret = rte_eth_xstats_get_by_id(port_id, ids, values, len);
        if (ret < 0 || ret > len) {
                printf("Cannot get xstats\n");
                goto err;
@@ -481,12 +481,12 @@ nic_xstats_display(uint8_t port_id)
        int len, ret, i;
        static const char *nic_stats_border = "########################";
 
-       len = rte_eth_xstats_get_names(port_id, NULL, 0, NULL);
+       len = rte_eth_xstats_get_names_by_id(port_id, NULL, 0, NULL);
        if (len < 0) {
                printf("Cannot get xstats count\n");
                return;
        }
-       values = malloc(sizeof(values) * len);
+       values = malloc(sizeof(*values) * len);
        if (values == NULL) {
                printf("Cannot allocate memory for xstats\n");
                return;
@@ -498,7 +498,7 @@ nic_xstats_display(uint8_t port_id)
                free(values);
                return;
        }
-       if (len != rte_eth_xstats_get_names(
+       if (len != rte_eth_xstats_get_names_by_id(
                        port_id, xstats_names, len, NULL)) {
                printf("Cannot get xstat names\n");
                goto err;
@@ -508,7 +508,7 @@ nic_xstats_display(uint8_t port_id)
                           port_id);
        printf("%s############################\n",
                           nic_stats_border);
-       ret = rte_eth_xstats_get(port_id, NULL, values, len);
+       ret = rte_eth_xstats_get_by_id(port_id, NULL, values, len);
        if (ret < 0 || ret > len) {
                printf("Cannot get xstats\n");
                goto err;