From ab933e9fd74d5a4e20eeb30e3fab3977e98b8743 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Sun, 14 Jan 2018 18:13:09 +0100 Subject: Integrate irq mode into PROX (support display and command line) irq mode can be used to show how a core is interrupted by other tasks. This mode does not handle packets. It only loops reading tsc. When the difference between two consecutive calls to rdtsc() is high then it means the core was interrupted. This task implementes the display, so that we can see a histogram of interrupts as well as the maximum, per core. Command line is also supported, through "show irq buckets" (too show the intervals of each buckets, in micrcoseconds), and the stats command line (showing the number of items in each buckets and the max).. Change-Id: I153cc3deaa7b86ae2776ea44e46ef9ecfd116992 Signed-off-by: Xavier Simonart --- VNFs/DPPD-PROX/cmd_parser.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'VNFs/DPPD-PROX/cmd_parser.c') diff --git a/VNFs/DPPD-PROX/cmd_parser.c b/VNFs/DPPD-PROX/cmd_parser.c index 18a4f5fc..09ea9653 100644 --- a/VNFs/DPPD-PROX/cmd_parser.c +++ b/VNFs/DPPD-PROX/cmd_parser.c @@ -1664,6 +1664,28 @@ static int parse_cmd_lat_stats(const char *str, struct input *input) return 0; } +static int parse_cmd_show_irq_buckets(const char *str, struct input *input) +{ + char buf[4096] = {0}; + unsigned int i, c; + unsigned lcores[RTE_MAX_LCORE], lcore_id, task_id, nb_cores; + + if (parse_core_task(str, lcores, &task_id, &nb_cores)) + return -1; + + if (cores_task_are_valid(lcores, task_id, nb_cores)) { + for (c = 0; c < nb_cores; c++) { + lcore_id = lcores[c]; + get_irq_buckets_by_core_task(buf, lcore_id, task_id); + plog_info("%s", buf); + if (input->reply) + input->reply(input, buf, strlen(buf)); + buf[0] = 0; + } + } + return 0; +} + static int parse_cmd_irq(const char *str, struct input *input) { unsigned int i, c; @@ -1906,6 +1928,7 @@ static struct cmd_str cmd_strings[] = { {"tot imissed tot", "", "Print total number of imissed since reset", parse_cmd_tot_imissed_tot}, {"lat stats", " ", "Print min,max,avg latency as measured during last sampling interval", parse_cmd_lat_stats}, {"irq stats", " ", "Print irq related infos", parse_cmd_irq}, + {"show irq buckets", " ", "Print irq buckets", parse_cmd_show_irq_buckets}, {"lat packets", " ", "Print the latency for each of the last set of packets", parse_cmd_lat_packets}, {"accuracy limit", " ", "Only consider latency of packets that were measured with an error no more than ", parse_cmd_accuracy}, {"core stats", " ", "Print rx/tx/drop for task running on core ", parse_cmd_core_stats}, @@ -1928,7 +1951,7 @@ static struct cmd_str cmd_strings[] = { {"port down", "", "Set the port down", parse_cmd_port_down}, {"port link state", "", "Get link state (up or down) for port", parse_cmd_port_link_state}, {"port xstats", "", "Get extra statistics for the port", parse_cmd_xstats}, - {"stats", "", "Get stats as sepcified by . A comma-separated list of can be supplied", parse_cmd_stats}, + {"stats", "", "Get stats as specified by . A comma-separated list of can be supplied", parse_cmd_stats}, {"cgnat dump public hash", " ", "Dump cgnat public hash table", parse_cmd_cgnat_public_hash}, {"cgnat dump private hash", " ", "Dump cgnat private hash table", parse_cmd_cgnat_private_hash}, {"delay_us", " ", "Set the delay in usec for the impair mode to ", parse_cmd_delay_us}, -- cgit 1.2.3-korg