source: rtems/c/src/libchip/shmdr/dump.c @ 9eef52b

4.104.114.84.95
Last change on this file since 9eef52b was 60b791ad, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 17, 1998 at 11:46:28 PM

updated copyright to 1998

  • Property mode set to 100644
File size: 1.4 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-1998.
10 *  On-Line Applications Research Corporation (OAR).
11 *  Copyright assigned to U.S. Government, 1994.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.OARcorp.com/rtems/license.html.
16 *
17 *  $Id$
18 */
19
20#include <rtems.h>
21#include <stdio.h>
22
23#include "shm.h"
24
25void
26Shm_Print_statistics(void)
27{
28  rtems_unsigned32  ticks;
29  rtems_unsigned32  ticks_per_second;
30  rtems_unsigned32  seconds;
31  int               packets_per_second;
32
33  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks );
34  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second );
35
36  seconds = ticks / ticks_per_second;
37  if ( seconds == 0 )
38    seconds = 1;
39
40  packets_per_second = Shm_Receive_message_count / seconds;
41  if ( (Shm_Receive_message_count % seconds) >= (seconds / 2) )
42    packets_per_second++;
43
44  printf( "\n\nSHMDR STATISTICS (NODE %d)\n", Shm_Local_node );
45  printf( "TICKS SINCE BOOT = %d\n", ticks );
46  printf( "TICKS PER SECOND = %d\n", ticks_per_second );
47  printf( "ISRs=%d\n",     Shm_Interrupt_count );
48  printf( "RECV=%d\n",     Shm_Receive_message_count );
49  printf( "NULL=%d\n",     Shm_Null_message_count );
50  printf( "PKTS/SEC=%d\n", packets_per_second );
51}
Note: See TracBrowser for help on using the repository browser.