source: rtems/c/src/libchip/shmdr/dump.c @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on May 11, 1995 at 5:39:37 PM

Initial revision

  • Property mode set to 100644
File size: 1.5 KB
Line 
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, 1990, 1991, 1992, 1993, 1994.
10 *  On-Line Applications Research Corporation (OAR).
11 *  All rights assigned to U.S. Government, 1994.
12 *
13 *  This material may be reproduced by or for the U.S. Government pursuant
14 *  to the copyright license under the clause at DFARS 252.227-7013.  This
15 *  notice must appear in all copies of this file and its derivatives.
16 *
17 *  $Id$
18 */
19
20#include <rtems.h>
21#include <stdio.h>
22#include <libcsupport.h>
23
24#include "shm.h"
25
26void
27Shm_Print_statistics(void)
28{
29  rtems_unsigned32  ticks;
30  rtems_unsigned32  ticks_per_second;
31  rtems_unsigned32  seconds;
32  int               packets_per_second;
33
34  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks );
35  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );
36
37  seconds = ticks / ticks_per_second;
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  printf( "\n\nSHMDR STATISTICS (NODE %d)\n", Shm_Local_node );
44  printf( "TICKS SINCE BOOT = %d\n", ticks );
45  printf( "TICKS PER SECOND = %d\n", ticks_per_second );
46  printf( "ISRs=%d\n",     Shm_Interrupt_count );
47  printf( "RECV=%d\n",     Shm_Receive_message_count );
48  printf( "NULL=%d\n",     Shm_Null_message_count );
49  printf( "PKTS/SEC=%d\n", packets_per_second );
50}
Note: See TracBrowser for help on using the repository browser.