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

4.104.11
Last change on this file since dd9cc9f7 was 534c893, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 18, 2008 at 5:15:51 PM

2008-12-18 Joel Sherrill <joel.sherrill@…>

  • libchip/shmdr/dump.c, libchip/shmdr/init.c, libchip/shmdr/send.c, libchip/shmdr/shm_driver.h: Cleanup and remove variables which duplicated data.
  • 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-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.com/license/LICENSE.
15 *
16 *  $Id$
17 */
18
19#include <rtems.h>
20#include <stdio.h>
21#include <inttypes.h>
22#include <rtems/bspIo.h>
23
24#include "shm_driver.h"
25
26void
27Shm_Print_statistics(void)
28{
29  uint32_t    ticks;
30  uint32_t    ticks_per_second;
31  uint32_t    seconds;
32  int         packets_per_second;
33
34  ticks            = rtems_clock_get_ticks_since_boot();
35  ticks_per_second = rtems_clock_get_ticks_per_second();
36
37  seconds = ticks / ticks_per_second;
38  if ( seconds == 0 )
39    seconds = 1;
40
41  packets_per_second = Shm_Receive_message_count / seconds;
42  if ( (Shm_Receive_message_count % seconds) >= (seconds / 2) )
43    packets_per_second++;
44
45  printk( "\n\nSHMDR STATISTICS (NODE %" PRId32 ")\n",
46    Multiprocessing_configuration.node );
47  printk( "TICKS SINCE BOOT = %" PRId32 "\n", ticks );
48  printk( "TICKS PER SECOND = %" PRId32 "\n", ticks_per_second );
49  printk( "ISRs=%" PRId32 "\n",     Shm_Interrupt_count );
50  printk( "RECV=%" PRId32 "\n",     Shm_Receive_message_count );
51  printk( "NULL=%" PRId32 "\n",     Shm_Null_message_count );
52  printk( "PKTS/SEC=%" PRId32 "\n", packets_per_second );
53}
Note: See TracBrowser for help on using the repository browser.