1 | /* |
---|
2 | * This routine is invoked following a reset to report the statistics |
---|
3 | * gathered during the previous execution. |
---|
4 | * |
---|
5 | * Input parameters: NONE |
---|
6 | * |
---|
7 | * Output parameters: NONE |
---|
8 | * |
---|
9 | * COPYRIGHT (c) 1989-2007. |
---|
10 | * On-Line Applications Research Corporation (OAR). |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.org/license/LICENSE. |
---|
15 | */ |
---|
16 | |
---|
17 | #include <rtems.h> |
---|
18 | #include <stdio.h> |
---|
19 | #include <inttypes.h> |
---|
20 | #include <rtems/bspIo.h> |
---|
21 | |
---|
22 | #include "shm_driver.h" |
---|
23 | |
---|
24 | void |
---|
25 | Shm_Print_statistics(void) |
---|
26 | { |
---|
27 | uint32_t ticks; |
---|
28 | uint32_t ticks_per_second; |
---|
29 | uint32_t seconds; |
---|
30 | uint32_t packets_per_second; |
---|
31 | |
---|
32 | ticks = rtems_clock_get_ticks_since_boot(); |
---|
33 | ticks_per_second = rtems_clock_get_ticks_per_second(); |
---|
34 | |
---|
35 | seconds = ticks / ticks_per_second; |
---|
36 | if ( seconds == 0 ) |
---|
37 | seconds = 1; |
---|
38 | |
---|
39 | packets_per_second = Shm_Receive_message_count / seconds; |
---|
40 | if ( (Shm_Receive_message_count % seconds) >= (seconds / 2) ) |
---|
41 | packets_per_second++; |
---|
42 | |
---|
43 | printk( "\n\nSHMDR STATISTICS (NODE %" PRId32 ")\n", |
---|
44 | Multiprocessing_configuration.node ); |
---|
45 | printk( "TICKS SINCE BOOT = %" PRId32 "\n", ticks ); |
---|
46 | printk( "TICKS PER SECOND = %" PRId32 "\n", ticks_per_second ); |
---|
47 | printk( "ISRs=%" PRId32 "\n", Shm_Interrupt_count ); |
---|
48 | printk( "RECV=%" PRId32 "\n", Shm_Receive_message_count ); |
---|
49 | printk( "NULL=%" PRId32 "\n", Shm_Null_message_count ); |
---|
50 | printk( "PKTS/SEC=%" PRId32 "\n", packets_per_second ); |
---|
51 | } |
---|