Changeset f980561 in rtems for cpukit/sapi
- Timestamp:
- 03/10/14 09:04:09 (10 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 53ad908
- Parents:
- 350f88dc
- git-author:
- Sebastian Huber <sebastian.huber@…> (03/10/14 09:04:09)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (03/14/14 07:46:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/sapi/src/profilingiterate.c
r350f88dc rf980561 18 18 19 19 #include <rtems/profiling.h> 20 #include <rtems/counter.h> 21 #include <rtems.h> 22 23 #include <string.h> 24 25 static void per_cpu_stats_iterate( 26 rtems_profiling_visitor visitor, 27 void *visitor_arg, 28 rtems_profiling_data *data 29 ) 30 { 31 #ifdef RTEMS_PROFILING 32 uint32_t n = rtems_smp_get_processor_count(); 33 uint32_t i; 34 35 memset(data, 0, sizeof(*data)); 36 data->header.type = RTEMS_PROFILING_PER_CPU; 37 for (i = 0; i < n; ++i) { 38 const Per_CPU_Control *per_cpu = _Per_CPU_Get_by_index(i); 39 const Per_CPU_Stats *stats = &per_cpu->Stats; 40 rtems_profiling_per_cpu *per_cpu_data = &data->per_cpu; 41 42 per_cpu_data->processor_index = i; 43 44 per_cpu_data->max_thread_dispatch_disabled_time = 45 rtems_counter_ticks_to_nanoseconds( 46 stats->max_thread_dispatch_disabled_time 47 ); 48 49 per_cpu_data->max_interrupt_time = 50 rtems_counter_ticks_to_nanoseconds(stats->max_interrupt_time); 51 52 per_cpu_data->max_interrupt_delay = 53 rtems_counter_ticks_to_nanoseconds(stats->max_interrupt_delay); 54 55 per_cpu_data->thread_dispatch_disabled_count = 56 stats->thread_dispatch_disabled_count; 57 58 per_cpu_data->total_thread_dispatch_disabled_time = 59 rtems_counter_ticks_to_nanoseconds( 60 stats->total_thread_dispatch_disabled_time 61 ); 62 63 per_cpu_data->interrupt_count = stats->interrupt_count; 64 65 per_cpu_data->total_interrupt_time = 66 rtems_counter_ticks_to_nanoseconds( 67 stats->total_interrupt_time 68 ); 69 70 (*visitor)(visitor_arg, data); 71 } 72 #else 73 (void) visitor; 74 (void) visitor_arg; 75 (void) data; 76 #endif 77 } 20 78 21 79 void rtems_profiling_iterate( … … 24 82 ) 25 83 { 84 rtems_profiling_data data; 85 86 per_cpu_stats_iterate(visitor, visitor_arg, &data); 26 87 }
Note: See TracChangeset
for help on using the changeset viewer.