comparison packages/kernel/current/tests/tm_basic.cxx @ 8:ece80412419a ecos-sw-1999-05-21

Merge from eCos master repository on 1999-05-21-22:05:54-BST
author jlarmour
date Fri, 21 May 1999 15:09:30 +0000
parents 1d7f19c9e4d1
children d3fbcdfa1b2f
comparison
equal deleted inserted replaced
7:e55593b6dcea 8:ece80412419a
47 #include <cyg/kernel/clock.inl> 47 #include <cyg/kernel/clock.inl>
48 #include <cyg/kernel/kapi.h> 48 #include <cyg/kernel/kapi.h>
49 49
50 #include <cyg/infra/testcase.h> 50 #include <cyg/infra/testcase.h>
51 51
52 #include <cyg/kernel/stackmon.hxx>
53
52 // Define this to see the statistics with the first sample datum removed. 54 // Define this to see the statistics with the first sample datum removed.
53 // This can expose the effects of caches on the speed of operations. 55 // This can expose the effects of caches on the speed of operations.
54 #undef STATS_WITHOUT_FIRST_SAMPLE 56 #undef STATS_WITHOUT_FIRST_SAMPLE
55 57
56 #if defined(CYGFUN_KERNEL_API_C) && \ 58 #if defined(CYGFUN_KERNEL_API_C) && \
1434 #ifdef HAL_CLOCK_LATENCY 1436 #ifdef HAL_CLOCK_LATENCY
1435 cyg_int32 clock_ave; 1437 cyg_int32 clock_ave;
1436 #endif 1438 #endif
1437 1439
1438 disable_clock_latency_measurement(); 1440 disable_clock_latency_measurement();
1441
1442 cyg_test_dump_thread_stack_stats( "Startup, main stack", thread[0] );
1443 cyg_test_dump_interrupt_stack_stats( "Startup" );
1444 cyg_test_dump_idlethread_stack_stats( "Startup" );
1445 cyg_test_clear_interrupt_stack();
1446
1439 diag_printf("\neCos Kernel Timings\n"); 1447 diag_printf("\neCos Kernel Timings\n");
1440 diag_printf("Notes: all times are in microseconds (.000001) unless otherwise stated\n"); 1448 diag_printf("Notes: all times are in microseconds (.000001) unless otherwise stated\n");
1441 #ifdef STATS_WITHOUT_FIRST_SAMPLE 1449 #ifdef STATS_WITHOUT_FIRST_SAMPLE
1442 diag_printf(" second line of results have first sample removed\n"); 1450 diag_printf(" second line of results have first sample removed\n");
1443 #endif 1451 #endif
1527 if (actual_stack < min_stack) min_stack = actual_stack; 1535 if (actual_stack < min_stack) min_stack = actual_stack;
1528 if (actual_stack > max_stack) max_stack = actual_stack; 1536 if (actual_stack > max_stack) max_stack = actual_stack;
1529 total_stack += actual_stack; 1537 total_stack += actual_stack;
1530 } 1538 }
1531 for (j = 0; j < STACKSIZE; j++) { 1539 for (j = 0; j < STACKSIZE; j++) {
1532 if (stack[j]) break; 1540 if (((char *)stack[0])[j]) break;
1533 } 1541 }
1534 diag_printf("%5d %5d %5d (main stack: %5d) Thread stack used (%d total)\n", 1542 diag_printf("%5d %5d %5d (main stack: %5d) Thread stack used (%d total)\n",
1535 total_stack/NTEST_THREADS, min_stack, max_stack, 1543 total_stack/NTEST_THREADS, min_stack, max_stack,
1536 STACKSIZE - j, STACK_SIZE); 1544 STACKSIZE - j, STACK_SIZE);
1545
1546 cyg_test_dump_thread_stack_stats( "All done, main stack", thread[0] );
1547 cyg_test_dump_interrupt_stack_stats( "All done" );
1548 cyg_test_dump_idlethread_stack_stats( "All done" );
1549
1537 enable_clock_latency_measurement(); 1550 enable_clock_latency_measurement();
1538 1551
1539 ticks = cyg_current_time(); 1552 ticks = cyg_current_time();
1540 diag_printf("\nTiming complete - %d ms total\n\n", (int)((ticks*ns_per_system_clock)/1000)); 1553 diag_printf("\nTiming complete - %d ms total\n\n", (int)((ticks*ns_per_system_clock)/1000));
1541 1554