Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:13

0001 /**
0002  * @file
0003  *
0004  * @brief Capture Implementation file
0005  *
0006  * This file contains an interface between the capture engine and
0007  * capture user extension methods.
0008  */
0009 
0010 /*
0011   ------------------------------------------------------------------------
0012 
0013   Copyright 2002, 2016 Chris Johns <chrisj@rtems.org>.
0014   All rights reserved.
0015 
0016   COPYRIGHT (c) 1989-2014.
0017   On-Line Applications Research Corporation (OAR).
0018 
0019   The license and distribution terms for this file may be
0020   found in the file LICENSE in this distribution.
0021 
0022   This software with is provided ``as is'' and with NO WARRANTY.
0023 
0024   ------------------------------------------------------------------------
0025 
0026   RTEMS Performance Monitoring and Measurement Framework.
0027   This is the Capture Engine component.
0028 
0029 */
0030 
0031 #ifndef __CAPTUREIMPL_H_
0032 #define __CAPTUREIMPL_H_
0033 
0034 #include "capture.h"
0035 
0036 /**@{*/
0037 #ifdef __cplusplus
0038 extern "C" {
0039 #endif
0040 
0041 /**
0042  * @brief Capture set extension index.
0043  *
0044  * This function is used to set the extension index
0045  * for the capture engine.
0046  *
0047  * @param[in] index specifies the extension index to be
0048  * used for capture engine data.
0049  */
0050 void rtems_capture_set_extension_index(int index);
0051 
0052 /**
0053  * @brief Capture get extension index.
0054  *
0055  * This function rturns the extension index for the
0056  * capture engine.
0057  *
0058  * @retval This method returns the extension index.
0059  */
0060 int  rtems_capture_get_extension_index(void);
0061 
0062 /**
0063  * @brief Capture get flags.
0064  *
0065  * This function gets the current flag settings
0066  * for the capture engine.
0067  *
0068  * @retval This method returns the global capture
0069  * flags.
0070  *
0071  */
0072 uint32_t rtems_capture_get_flags(void);
0073 
0074 /**
0075  * @brief Capture set flags.
0076  *
0077  * This function sets a flag in the capture engine
0078  *
0079  * @param[in] mask specifies the flag to set
0080  */
0081 void rtems_capture_set_flags(uint32_t mask);
0082 
0083 /**
0084  * @brief Capture user extension open.
0085  *
0086  * This function creates the capture user extensions.
0087  *
0088  *
0089  * @retval This method returns RTEMS_SUCCESSFUL upon successful
0090  * creation of the user extensions.
0091  */
0092 rtems_status_code rtems_capture_user_extension_open(void);
0093 
0094 /**
0095  * @brief Capture user extension close.
0096  *
0097  * This function closes the capture user extensions.
0098  *
0099  * @retval This method returns RTEMS_SUCCESSFUL upon a successful
0100  * delete of the user extensions.
0101  */
0102 rtems_status_code rtems_capture_user_extension_close(void);
0103 
0104 /**
0105  * @brief Capture check trigger.
0106  *
0107  * This function checks if we have triggered or if this event is a
0108  * cause of a trigger.
0109  *
0110  * @param[in] ft specifies specifices the capture from task
0111  * @param[in] tt specifies specifices the capture to task
0112  * @param[in] events specifies the events
0113  *
0114  * @retval This method returns true if we have triggered or
0115  * if the event is a cause of a trigger.
0116  */
0117 bool rtems_capture_trigger_fired (rtems_tcb* ft,
0118                                   rtems_tcb* tt,
0119                                   uint32_t   events);
0120 
0121 /**
0122  * @brief Capture print trace records.
0123  *
0124  * This function reads, prints and releases up to
0125  * total trace records in either a csv format or an
0126  * ascii table format.
0127  *
0128  * @param[in] total specifies the number of records to print
0129  * @param[in] csv specifies a comma seperated value format
0130  */
0131 void rtems_capture_print_trace_records ( int total, bool csv );
0132 
0133 /**
0134  * @brief Capture print timestamp.
0135  *
0136  * This function prints uptime in a timestamp format.
0137  *
0138  * @param[in] uptime specifies the timestamp to print
0139  */
0140 void rtems_capture_print_timestamp (uint64_t uptime);
0141 
0142 /**
0143  * @brief Capture print record task.
0144  *
0145  * This function  prints a capture record task.  This
0146  * record contains information to identify a task.  It
0147  * is refrenced in other records by the task id.
0148  *
0149  * @param[in] cpu specifies the cpu the cpu the record was logged on.
0150  * @param[in] rec specifies the task record.
0151  */
0152 void rtems_capture_print_record_task(int                              cpu,
0153                                      const rtems_capture_record*      rec,
0154                                      const rtems_capture_task_record* task_rec);
0155 
0156 /**
0157  * @brief Capture print capture record.
0158  *
0159  * This function prints a user extension
0160  * capture record.
0161  *
0162  * @param[in] cpu specifies the cpu the cpu the record was logged on.
0163  * @param[in] rec specifies the record.
0164  * @param[in] diff specifies the time between this and the last capture record.
0165  * @param[in] name specifies the name of the task, NULL if none.
0166  * @param[in] task_count number of tasks to search for.
0167  */
0168 void rtems_capture_print_record_capture(int                         cpu,
0169                                         const rtems_capture_record* rec,
0170                                         uint64_t                    diff,
0171                                         const rtems_name*           name);
0172 
0173 /**
0174  * @brief Capture print watch list
0175  *
0176  * This function  prints a capture watch list
0177  */
0178 void rtems_capture_print_watch_list (void);
0179 
0180 #ifdef __cplusplus
0181 }
0182 #endif
0183 /**@}*/
0184 
0185 #endif