source: rtems/c/src/lib/libbsp/shmdr/dump.c @ 48bfd992

4.104.114.84.95
Last change on this file since 48bfd992 was 48bfd992, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 30, 1999 at 7:58:02 PM

Renamed shm.h to shm_driver.h to avoid conflicts with POSIX shm.h.

Renamed file shmsupp/intr.c in some BSPs to shmsupp/cause_intr.c to
avoid conflict with rtems/src/intr.c (Classic API Interrupt Manager).

  • 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-1999.
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.OARcorp.com/rtems/license.html.
15 *
16 *  $Id$
17 */
18
19#include <rtems.h>
20#include <stdio.h>
21
22#include "shm_driver.h"
23
24void
25Shm_Print_statistics(void)
26{
27  rtems_unsigned32  ticks;
28  rtems_unsigned32  ticks_per_second;
29  rtems_unsigned32  seconds;
30  int               packets_per_second;
31
32  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks );
33  (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &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  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.