📄 types.h
字号:
/* Copyright (C) 2004,2005,2006 Bull S.A. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *//* types definition used by PTT */#ifndef TYPES_H#define TYPES_H#include <sys/types.h>#include <hp-timing.h>/* Maximum number of arguments for a trace point */#define PTT_MAXARG 6#define PTT_MAXEVT 3typedef u_int32_t PTT_WORD;typedef unsigned long long ptt_timestamp_t; typedef PTT_WORD ptt_checksum_t; /* shared buffer which is used to read and write trace data * - current_level: trace level * - reserved: index to reserve space for writting in the array * - written: index to mark that trace point data has been written in the * array * - size_buff: buffer size * - stat_enable: stat flag * - beg_read: index where the reader process starts to read * - PAUSE: flag to block and unblock writter processes * - array: array of WORD where trace data are collected (size fixed at * runtime) */ struct ptt_buffer { int current_level; /* must be the first element of the struct */ volatile unsigned int reserved; volatile unsigned int written; volatile unsigned int beg_read; volatile int PAUSE; unsigned int size_buff; int stat_enable;#ifdef PTT_TRACE_INFO hp_timing_t stat_time; hp_timing_t hp_timing_overhead; unsigned int stat_nb_trace; unsigned int stat_nb_wait; unsigned int stat_nb_pause; unsigned int stat_async;#endif /* PTT_TRACE_INFO */ volatile PTT_WORD array[0];};/* types of arguments used to describe trace points: * - integer: PTT_INT * - pointer: PTT_PTR * - unsigned integer: PTT_UINT * - unsigned long long: PTT_ULL */typedef enum { PTT_INT, PTT_PTR, PTT_UINT, PTT_ULL } ptt_arg_t;/* events */typedef enum { EVT_NULL, EVT_START_USER_FUNC, EVT_END_USER_FUNC, EVT_BARRIER_LOCK_FREE, EVT_BARRIER_LOCK_REQUIRE, EVT_BARRIER_LOCK_TAKEN, EVT_BARRIER_LEFT_DEC, EVT_BARRIER_LEFT_INC, EVT_BARRIER_INIT, EVT_BARRIER_DESTROY, EVT_BARRIER_DESTROY_IN, EVT_BARRIER_DESTROY_OUT, EVT_BARRIER_INIT_IN, EVT_BARRIER_INIT_OUT, EVT_BARRIER_WAIT_IN, EVT_BARRIER_WAIT_OUT, EVT_COND_LOCK_FREE, EVT_COND_LOCK_REQUIRE, EVT_COND_LOCK_TAKEN, EVT_COND_TOTAL_SEQ_SET, EVT_COND_TOTAL_SEQ_INC, EVT_COND_BROAD_SEQ_INC, EVT_COND_MUTEX_FREE, EVT_COND_MUTEX_REQUIRE, EVT_COND_MUTEX_TAKEN, EVT_COND_INIT, EVT_COND_DESTROY, EVT_COND_DESTROY_IN, EVT_COND_DESTROY_OUT, EVT_COND_INIT_IN, EVT_COND_INIT_OUT, EVT_COND_BROAD_IN, EVT_COND_BROAD_OUT, EVT_COND_SIGNAL_IN, EVT_COND_SIGNAL_OUT, EVT_COND_WAIT_IN, EVT_COND_WAIT_OUT, EVT_MUTEX_STATE_FREE, EVT_MUTEX_STATE_REQUIRE, EVT_MUTEX_STATE_TAKEN, EVT_MUTEX_COUNT_DEC, EVT_MUTEX_COUNT_INC, EVT_MUTEX_OWNER_CHANGE, EVT_MUTEX_INIT, EVT_MUTEX_DESTROY, EVT_MUTEX_DESTROY_IN, EVT_MUTEX_DESTROY_OUT, EVT_MUTEX_INIT_IN, EVT_MUTEX_INIT_OUT, EVT_MUTEX_LOCK_IN, EVT_MUTEX_LOCK_OUT, EVT_MUTEX_UNLOCK_IN, EVT_MUTEX_UNLOCK_OUT, EVT_THREAD_JOIN, EVT_THREAD_DETACH, EVT_THREAD_STATE_DEAD, EVT_THREAD_STATE_WAIT, EVT_THREAD_STATE_WAKE, EVT_THREAD_INIT, EVT_THREAD_CREATE_IN, EVT_THREAD_CREATE_OUT, EVT_THREAD_JOIN_IN, EVT_THREAD_JOIN_OUT, EVT_THREAD_SET_PD, EVT_THREAD_CANCEL_IN, EVT_THREAD_CANCEL_OUT, EVT_THREAD_CANCEL_PROG, EVT_THREAD_STATE_CANCEL, EVT_THREAD_STATE_WAIT_MUTEX, EVT_THREAD_STATE_WAKE_MUTEX, EVT_THREAD_STATE_WAIT_BARRIER, EVT_THREAD_STATE_WAKE_BARRIER, EVT_THREAD_STATE_WAIT_COND, EVT_THREAD_STATE_WAKE_COND, EVT_THREAD_STATE_WAIT_SEM, EVT_THREAD_STATE_WAKE_SEM, EVT_PROG_FORK, EVT_SEM_COUNT_DEC, EVT_SEM_COUNT_INC, EVT_SEM_INIT, EVT_SEM_INIT_IN, EVT_SEM_INIT_OUT, EVT_SEM_DESTROY, EVT_SEM_DESTROY_IN, EVT_SEM_DESTROY_OUT, EVT_SEM_POST_IN, EVT_SEM_POST_OUT, EVT_SEM_WAIT_IN, EVT_SEM_TRYWAIT_OUT, EVT_SEM_TRYWAIT_IN, EVT_SEM_WAIT_OUT, EVT_SEM_OPEN_IN, EVT_SEM_OPEN_OUT, EVT_SEM_OPEN_CREATE, EVT_SEM_CLOSE_IN, EVT_SEM_CLOSE_OUT, EVT_SEM_MAPPINGSLOCK_FREE, EVT_SEM_MAPPINGSLOCK_REQUIRE, EVT_SEM_MAPPINGSLOCK_TAKEN, EVT_SEM_REFCOUNT_DEC, EVT_SEM_REFCOUNT_INC, EVT_SEM_UNLINK_IN, EVT_SEM_UNLINK_OUT, EVT_LAST} ptt_event_t;/* Event data structure : * - name: name of the event * - nbargs: number of arguments taken by the event * - arg_type: array containing the type of each argument * - descr: description of the event */typedef struct { const char* name; int nargs; ptt_arg_t arg_type[PTT_MAXARG]; const char* descr[PTT_MAXARG+1]; int flags;} ptt_event_data_t;/* trace points */typedef enum { TR_NULL, TR_INIT, TR_FINI, TR_BARRIER_1, TR_BARRIER_2, TR_BARRIER_3, TR_BARRIER_4, TR_BARRIER_5, TR_BARRIER_6, TR_BARRIER_7, TR_BARRIER_8, TR_BARRIER_9, TR_BARRIER_10, TR_BARRIER_11, TR_BARRIER_12, TR_BARRIER_13, TR_BARRIER_14, TR_BARRIER_15, TR_COND_1, TR_COND_2, TR_COND_3, TR_COND_4, TR_COND_5, TR_COND_6, TR_COND_7, TR_COND_8, TR_COND_9, TR_COND_10, TR_COND_11, TR_COND_12, TR_COND_13, TR_COND_14, TR_COND_15, TR_COND_16, TR_COND_17, TR_COND_18, TR_COND_19, TR_COND_20, TR_COND_21, TR_COND_22, TR_COND_23, TR_COND_24, TR_MUTEX_1, TR_MUTEX_2, TR_MUTEX_3, TR_MUTEX_4, TR_MUTEX_5, TR_MUTEX_6, TR_MUTEX_7, TR_MUTEX_8, TR_MUTEX_9, TR_MUTEX_10, TR_MUTEX_11, TR_MUTEX_12, TR_MUTEX_13, TR_MUTEX_14, TR_MUTEX_15, TR_MUTEX_16, TR_MUTEX_17, TR_MUTEX_18, TR_THREAD_1, TR_THREAD_2, TR_THREAD_3, TR_THREAD_4, TR_THREAD_5, TR_THREAD_6, TR_THREAD_7, TR_THREAD_8, TR_THREAD_9, TR_THREAD_10, TR_THREAD_11, TR_THREAD_12, TR_THREAD_13, TR_THREAD_14, TR_THREAD_15, TR_FORK, TR_SEM_1, TR_SEM_2, TR_SEM_3, TR_SEM_4, TR_SEM_5, TR_SEM_6, TR_SEM_7, TR_SEM_8, TR_SEM_9, TR_SEM_10, TR_SEM_11, TR_SEM_12, TR_SEM_13, TR_SEM_14, TR_SEM_15, TR_SEM_16, TR_SEM_17, TR_SEM_18, TR_SEM_19, TR_SEM_20, TR_SEM_21, TR_SEM_22, TR_SEM_23, TR_SEM_24, TR_SEM_25, TR_SEM_26, TR_SEM_27, TR_SEM_28, TR_LAST} ptt_point_t;/* trace point structure : * - nevts: number of events in the trace point * - event: events contained in the trace point */typedef struct { int nevts; ptt_event_t event[PTT_MAXEVT];} ptt_point_data_t;/* trace point structure : * - type: type of each argument of each event in the trace point * - ntypes: number of arguments needed to describe the trace point * - size: size of the trace point in the shared buffer */typedef struct { ptt_arg_t type[PTT_MAXARG]; int ntypes; PTT_WORD size;} ptt_point_compiled_data_t;/* header structure */typedef struct { int byte_order; struct { int major; int minor; } version; int freq_khz; ptt_timestamp_t timestamp; time_t start_time; int file_number; char architecture[32];} ptt_header_t;#endif /* TYPES_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -