@@ -644,7 +644,7 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data)
644644
645645#if NET_TC_TX_COUNT > 1
646646 printk ("TX traffic class statistics:\n" );
647- printk ("TC Priority\tSent pkts\tbytes\n" );
647+ printk ("TC Priority\tSent pkts\tbytes\n" );
648648
649649 for (i = 0 ; i < NET_TC_TX_COUNT ; i ++ ) {
650650 printk ("[%d] %s (%d)\t%d\t\t%d\n" , i ,
@@ -658,7 +658,7 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data)
658658
659659#if NET_TC_RX_COUNT > 1
660660 printk ("RX traffic class statistics:\n" );
661- printk ("TC Priority\tRecv pkts\tbytes\n" );
661+ printk ("TC Priority\tRecv pkts\tbytes\n" );
662662
663663 for (i = 0 ; i < NET_TC_RX_COUNT ; i ++ ) {
664664 printk ("[%d] %s (%d)\t%d\t\t%d\n" , i ,
@@ -668,9 +668,53 @@ static void net_shell_print_statistics(struct net_if *iface, void *user_data)
668668 GET_STAT (iface , tc .recv [i ].pkts ),
669669 GET_STAT (iface , tc .recv [i ].bytes ));
670670 }
671- }
672671#endif
672+ }
673673#endif /* NET_TC_COUNT > 1 */
674+
675+ #if (NET_TC_COUNT > 1 ) && defined(CONFIG_NET_PKT_TIMESTAMP )
676+ {
677+ int i ;
678+
679+ #if NET_TC_TX_COUNT > 1
680+ printk ("TX timestamp statistics:\n" );
681+ printk ("TC Low\tAvg\tHigh (in nanoseconds)\n" );
682+
683+ for (i = 0 ; i < NET_TC_TX_COUNT ; i ++ ) {
684+ if (GET_STAT (ts .tx [i ].time .low ) == 0 &&
685+ GET_STAT (ts .tx [i ].time .average ) == 0 &&
686+ GET_STAT (ts .tx [i ].time .high ) == 0 ) {
687+ continue ;
688+ }
689+
690+ printk ("[%d] %s %u\t%u\t%u\n" , i ,
691+ priority2str (GET_STAT (tc .sent [i ].priority )),
692+ GET_STAT (ts .tx [i ].time .low ),
693+ GET_STAT (ts .tx [i ].time .average ),
694+ GET_STAT (ts .tx [i ].time .high ));
695+ }
696+ #endif
697+
698+ #if NET_TC_RX_COUNT > 1
699+ printk ("RX timestamp statistics:\n" );
700+ printk ("TC Low\tAvg\tHigh (in nanoseconds)\n" );
701+
702+ for (i = 0 ; i < NET_TC_RX_COUNT ; i ++ ) {
703+ if (GET_STAT (ts .rx [i ].time .low ) == 0 &&
704+ GET_STAT (ts .rx [i ].time .average ) == 0 &&
705+ GET_STAT (ts .rx [i ].time .high ) == 0 ) {
706+ continue ;
707+ }
708+
709+ printk ("[%d] %s %u\t%u\t%u\n" , i ,
710+ priority2str (GET_STAT (tc .recv [i ].priority )),
711+ GET_STAT (ts .rx [i ].time .low ),
712+ GET_STAT (ts .rx [i ].time .average ),
713+ GET_STAT (ts .rx [i ].time .high ));
714+ }
715+ #endif
716+ }
717+ #endif /* (NET_TC_COUNT > 1) && CONFIG_NET_PKT_TIMESTAMP */
674718}
675719#endif /* CONFIG_NET_STATISTICS */
676720
0 commit comments