summaryrefslogtreecommitdiff
path: root/cpukit/libmisc/capture/capture_user_extension.c
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-08-30 16:46:25 +1000
committerChris Johns <chrisj@rtems.org>2016-09-01 11:11:22 +1000
commit6da06c559f17f33177f59c0f83164bb2d20c8b9f (patch)
tree9f4b23a8f6e5215489ffbb8219c85fd11aa08e6c /cpukit/libmisc/capture/capture_user_extension.c
parentcaf2cbd81331b3368db97006a922556c59b09061 (diff)
libmisc/capture: Fix the capture engine on SMP.
This patches some issues with the capture engine: 1. Check is the engine is open in ctrace commands. 2. Check all record open and appends for overflow. 3. Fix the record open to take the size of user data and not the record header. 4. Use packed structs for data being written to the per cpu buffers. 5. Remove direct struct access to the capture buffers to avoid misaligned accesses. 6. Add support to extract records, no struct access to the capture buffers. 7. Update ctrace to extract records from the capture buffers. 8. Add support to ctrace to always print the task name if it has one. 9. Add support to manage names or the lack of a name. 10. Range of minor fixes. 11. Fix a long standing bug in ctset's handling of args. Closes #2780.
Diffstat (limited to 'cpukit/libmisc/capture/capture_user_extension.c')
-rw-r--r--cpukit/libmisc/capture/capture_user_extension.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/cpukit/libmisc/capture/capture_user_extension.c b/cpukit/libmisc/capture/capture_user_extension.c
index 37372cbe1e..6e42fd7c87 100644
--- a/cpukit/libmisc/capture/capture_user_extension.c
+++ b/cpukit/libmisc/capture/capture_user_extension.c
@@ -1,9 +1,7 @@
/*
------------------------------------------------------------------------
- Copyright Objective Design Systems Pty Ltd, 2002
- All rights reserved Objective Design Systems Pty Ltd, 2002
- Chris Johns (ccj@acm.org)
+ Copyright 2002, 2016 Chris Johns <chrisj@rtems.org>. All rights reserved.
COPYRIGHT (c) 1989-2014.
On-Line Applications Research Corporation (OAR).
@@ -37,7 +35,7 @@
/*
* RTEMS Capture User Extension Data.
*/
-static rtems_id capture_id;
+static rtems_id capture_id;
static bool
rtems_capture_create_task (rtems_tcb* current_task,
@@ -80,23 +78,18 @@ static const rtems_extensions_table capture_extensions = {
.thread_terminate = rtems_capture_terminated_task
};
-static inline void rtems_capture_record (
- rtems_tcb* tcb,
- uint32_t events
-)
+static inline void rtems_capture_record (rtems_tcb* tcb, uint32_t events)
{
- rtems_capture_record_t* rec;
- void* ptr;
- size_t size = sizeof(*rec);
+ rtems_capture_record_lock_context rec_context;
- if (rtems_capture_filter( tcb, events) )
+ if (rtems_capture_filter (tcb, events))
return;
if (!rtems_capture_task_recorded (tcb))
rtems_capture_record_task (tcb);
- rtems_capture_begin_add_record (tcb, events, size, &ptr);
- rtems_capture_end_add_record ( ptr );
+ rtems_capture_record_open (tcb, events, 0, &rec_context);
+ rtems_capture_record_close (&rec_context);
}
@@ -115,7 +108,7 @@ rtems_status_code rtems_capture_user_extension_open(void)
capture_id = 0;
else {
index = rtems_object_id_get_index (capture_id);
- rtems_capture_set_extension_index( index );
+ rtems_capture_set_extension_index (index);
}
return sc;