Thread (18 messages) 18 messages, 4 authors, 2017-07-06

Re: [PATCH v3] app/testpmd: print statistics periodically

From: De Lara Guarch, Pablo <hidden>
Date: 2017-06-20 08:34:15

-----Original Message-----
From: Thomas Monjalon [mailto:thomas@monjalon.net]
Sent: Monday, June 19, 2017 10:22 PM
To: De Lara Guarch, Pablo
Cc: dev@dpdk.org; Wu, Jingjing
Subject: Re: [dpdk-dev] [PATCH v3] app/testpmd: print statistics
periodically

15/06/2017 03:48, Pablo de Lara:
quoted
+print_stats(void)
+{
+	uint8_t i;
+	const char clr[] = { 27, '[', '2', 'J', '\0' };
+	const char topLeft[] = { 27, '[', '1', ';', '1', 'H', '\0' };
Spotted a CamelCase ;)
Is there a punishment planned in the contributor's guide?
Sorry, got this from another app, will fix this.
quoted
+		if (stats_period != 0) {
+			uint64_t prev_tsc = 0, cur_tsc, timer_tsc = 0;
+			uint64_t timer_period;
+
+			/* Convert to number of cycles */
+			timer_period = stats_period * rte_get_timer_hz();
+
+			while (1) {
+				cur_tsc = rte_rdtsc();
+				timer_tsc += cur_tsc - prev_tsc;
Please forget (Intel) TSC wording and prefer the more generic
rte_get_timer_cycles() function.
Good point, will fix in the v4.

Thanks,
Pablo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help