git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
app/testpmd: fix bonding mode set
[dpdk.git]
/
app
/
proc-info
/
main.c
diff --git
a/app/proc-info/main.c
b/app/proc-info/main.c
index
a427104
..
56070a3
100644
(file)
--- a/
app/proc-info/main.c
+++ b/
app/proc-info/main.c
@@
-27,10
+27,11
@@
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_log.h>
#include <rte_per_lcore.h>
#include <rte_lcore.h>
#include <rte_log.h>
-#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_string_fns.h>
#include <rte_branch_prediction.h>
#include <rte_string_fns.h>
+#ifdef RTE_LIB_METRICS
#include <rte_metrics.h>
#include <rte_metrics.h>
+#endif
#include <rte_cycles.h>
#ifdef RTE_LIB_SECURITY
#include <rte_security.h>
#include <rte_cycles.h>
#ifdef RTE_LIB_SECURITY
#include <rte_security.h>
@@
-59,8
+60,10
@@
static uint32_t enable_collectd_format;
static int stdout_fd;
/**< Host id process is running on */
static char host_id[MAX_LONG_OPT_SZ];
static int stdout_fd;
/**< Host id process is running on */
static char host_id[MAX_LONG_OPT_SZ];
+#ifdef RTE_LIB_METRICS
/**< Enable metrics. */
static uint32_t enable_metrics;
/**< Enable metrics. */
static uint32_t enable_metrics;
+#endif
/**< Enable stats reset. */
static uint32_t reset_stats;
/**< Enable xstats reset. */
/**< Enable stats reset. */
static uint32_t reset_stats;
/**< Enable xstats reset. */
@@
-108,8
+111,10
@@
proc_info_usage(const char *prgname)
" --stats: to display port statistics, enabled by default\n"
" --xstats: to display extended port statistics, disabled by "
"default\n"
" --stats: to display port statistics, enabled by default\n"
" --xstats: to display extended port statistics, disabled by "
"default\n"
+#ifdef RTE_LIB_METRICS
" --metrics: to display derived metrics of the ports, disabled by "
"default\n"
" --metrics: to display derived metrics of the ports, disabled by "
"default\n"
+#endif
" --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"
" --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"
@@
-218,7
+223,9
@@
proc_info_parse_args(int argc, char **argv)
{"stats", 0, NULL, 0},
{"stats-reset", 0, NULL, 0},
{"xstats", 0, NULL, 0},
{"stats", 0, NULL, 0},
{"stats-reset", 0, NULL, 0},
{"xstats", 0, NULL, 0},
+#ifdef RTE_LIB_METRICS
{"metrics", 0, NULL, 0},
{"metrics", 0, NULL, 0},
+#endif
{"xstats-reset", 0, NULL, 0},
{"xstats-name", required_argument, NULL, 1},
{"collectd-format", 0, NULL, 0},
{"xstats-reset", 0, NULL, 0},
{"xstats-name", required_argument, NULL, 1},
{"collectd-format", 0, NULL, 0},
@@
-260,10
+267,12
@@
proc_info_parse_args(int argc, char **argv)
else if (!strncmp(long_option[option_index].name, "xstats",
MAX_LONG_OPT_SZ))
enable_xstats = 1;
else if (!strncmp(long_option[option_index].name, "xstats",
MAX_LONG_OPT_SZ))
enable_xstats = 1;
+#ifdef RTE_LIB_METRICS
else if (!strncmp(long_option[option_index].name,
"metrics",
MAX_LONG_OPT_SZ))
enable_metrics = 1;
else if (!strncmp(long_option[option_index].name,
"metrics",
MAX_LONG_OPT_SZ))
enable_metrics = 1;
+#endif
/* Reset stats */
if (!strncmp(long_option[option_index].name, "stats-reset",
MAX_LONG_OPT_SZ))
/* Reset stats */
if (!strncmp(long_option[option_index].name, "stats-reset",
MAX_LONG_OPT_SZ))
@@
-593,6
+602,7
@@
nic_xstats_clear(uint16_t port_id)
printf("\n NIC extended statistics for port %d cleared\n", port_id);
}
printf("\n NIC extended statistics for port %d cleared\n", port_id);
}
+#ifdef RTE_LIB_METRICS
static void
metrics_display(int port_id)
{
static void
metrics_display(int port_id)
{
@@
-620,7
+630,7
@@
metrics_display(int port_id)
names = rte_malloc(NULL, sizeof(struct rte_metric_name) * len, 0);
if (names == NULL) {
names = rte_malloc(NULL, sizeof(struct rte_metric_name) * len, 0);
if (names == NULL) {
- printf("Cannot allocate memory for metr
ci
s names\n");
+ printf("Cannot allocate memory for metr
ic
s names\n");
rte_free(metrics);
return;
}
rte_free(metrics);
return;
}
@@
-653,6
+663,7
@@
metrics_display(int port_id)
rte_free(metrics);
rte_free(names);
}
rte_free(metrics);
rte_free(names);
}
+#endif
static void
show_security_context(uint16_t portid, bool inline_offload)
static void
show_security_context(uint16_t portid, bool inline_offload)
@@
-1098,7
+1109,7
@@
show_tm(void)
caplevel.n_nodes_max,
caplevel.n_nodes_nonleaf_max,
caplevel.n_nodes_leaf_max);
caplevel.n_nodes_max,
caplevel.n_nodes_nonleaf_max,
caplevel.n_nodes_leaf_max);
- printf("\t -- i
nde
tical: non leaf %u leaf %u\n",
+ printf("\t -- i
den
tical: non leaf %u leaf %u\n",
caplevel.non_leaf_nodes_identical,
caplevel.leaf_nodes_identical);
caplevel.non_leaf_nodes_identical,
caplevel.leaf_nodes_identical);
@@
-1252,7
+1263,7
@@
show_ring(char *name)
printf(" - Name (%s) on socket (%d)\n"
" - flags:\n"
"\t -- Single Producer Enqueue (%u)\n"
printf(" - Name (%s) on socket (%d)\n"
" - flags:\n"
"\t -- Single Producer Enqueue (%u)\n"
- "\t -- Single Consmer Dequeue (%u)\n",
+ "\t -- Single Cons
u
mer Dequeue (%u)\n",
ptr->name,
ptr->memzone->socket_id,
ptr->flags & RING_F_SP_ENQ,
ptr->name,
ptr->memzone->socket_id,
ptr->flags & RING_F_SP_ENQ,
@@
-1522,14
+1533,18
@@
main(int argc, char **argv)
else if (nb_xstats_ids > 0)
nic_xstats_by_ids_display(i, xstats_ids,
nb_xstats_ids);
else if (nb_xstats_ids > 0)
nic_xstats_by_ids_display(i, xstats_ids,
nb_xstats_ids);
+#ifdef RTE_LIB_METRICS
else if (enable_metrics)
metrics_display(i);
else if (enable_metrics)
metrics_display(i);
+#endif
}
}
+#ifdef RTE_LIB_METRICS
/* print port independent stats */
if (enable_metrics)
metrics_display(RTE_METRICS_GLOBAL);
/* print port independent stats */
if (enable_metrics)
metrics_display(RTE_METRICS_GLOBAL);
+#endif
/* show information for PMD */
if (enable_shw_port)
/* show information for PMD */
if (enable_shw_port)