summaryrefslogtreecommitdiffstats
path: root/cpukit/libmisc/capture
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-05 08:16:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-09 08:06:46 +0200
commitf9219db2a95c8285d1be22092572b4236bfe6488 (patch)
treec168ac7fdf7458cea6d7146584b2adb38d47f6a1 /cpukit/libmisc/capture
parentrtems: Add rtems_scheduler_get_processor() (diff)
downloadrtems-f9219db2a95c8285d1be22092572b4236bfe6488.tar.bz2
rtems: Add rtems_scheduler_get_processor_maximum()
Add rtems_scheduler_get_processor_maximum() as a replacement for rtems_get_processor_count(). The rtems_get_processor_count() is a bit orphaned. Adopt it by the Scheduler Manager. The count is also misleading, since the processor set may have gaps and the actual count of online processors may be less than the value returned by rtems_get_processor_count(). Update #3732.
Diffstat (limited to 'cpukit/libmisc/capture')
-rw-r--r--cpukit/libmisc/capture/capture.c6
-rw-r--r--cpukit/libmisc/capture/capture_support.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/cpukit/libmisc/capture/capture.c b/cpukit/libmisc/capture/capture.c
index 6accd509e7..bba7d91396 100644
--- a/cpukit/libmisc/capture/capture.c
+++ b/cpukit/libmisc/capture/capture.c
@@ -599,7 +599,7 @@ rtems_capture_open (uint32_t size, rtems_capture_timestamp timestamp RTEMS_UNU
return RTEMS_RESOURCE_IN_USE;
}
- count = rtems_get_processor_count();
+ count = rtems_scheduler_get_processor_maximum();
if (capture_per_cpu == NULL) {
capture_per_cpu = calloc( count, sizeof( *capture_per_cpu ) );
}
@@ -686,7 +686,7 @@ rtems_capture_close (void)
}
capture_controls = NULL;
- for (cpu=0; cpu < rtems_get_processor_count(); cpu++) {
+ for (cpu=0; cpu < rtems_scheduler_get_processor_maximum(); cpu++) {
if (capture_records_on_cpu(cpu).buffer)
rtems_capture_buffer_destroy( &capture_records_on_cpu(cpu) );
@@ -788,7 +788,7 @@ rtems_capture_flush (bool prime)
else
capture_flags_global &= ~RTEMS_CAPTURE_OVERFLOW;
- for (cpu=0; cpu < rtems_get_processor_count(); cpu++) {
+ for (cpu=0; cpu < rtems_scheduler_get_processor_maximum(); cpu++) {
RTEMS_INTERRUPT_LOCK_REFERENCE( lock, &(capture_lock_on_cpu( cpu )) )
rtems_interrupt_lock_context lock_context_per_cpu;
diff --git a/cpukit/libmisc/capture/capture_support.c b/cpukit/libmisc/capture/capture_support.c
index 60006e7dd8..4af8822c79 100644
--- a/cpukit/libmisc/capture/capture_support.c
+++ b/cpukit/libmisc/capture/capture_support.c
@@ -268,7 +268,7 @@ rtems_capture_print_trace_records (int total, bool csv)
rtems_capture_time last_time = 0;
int i;
- cpus = rtems_get_processor_count ();
+ cpus = rtems_scheduler_get_processor_maximum ();
per_cpu = calloc (cpus, sizeof(*per_cpu));
if (per_cpu == NULL)