| | 3073 | | trc_process_trace_event( ID, name, entry_exit, index ) | | | 3074 | | TRC_ID ID; | | | 3075 | | char *name; | | | 3076 | | int entry_exit; | | | 3077 | | int index; | | | 3078 | | { | | | 3079 | | TRC_DATADESC DD; | | | 3080 | | | | | 3081 | | TRC_TEVDESC TD; | | | 3082 | | | | | 3083 | | TRC_TEVREC TR; | | | | | ... | | | 3094 | | short read_short; | | | 3095 | | long read_long; | | | 3096 | | int read_int; | | | 3097 | | | | | 3098 | | char c; | | | 3099 | | | | | 3100 | | int i, j; | | | 3101 | | int flag; | | | 3102 | | int num; | | | 3103 | | | | | 3104 | | if ( !(ID->handle_event) ) | | | 3105 | | { | | | 3106 | | trc_find_event_end( ID ); | | | 3107 | | | | | 3108 | | return( TRC_TRUE );
| | | 3109 | | } | | | 3110 | | | | | 3111 | | TD = (TRC_TEVDESC) trc_lookup_trie( TRC_EVENT_TRIE, name ); | | | 3112 | | | | | 3113 | | while ( TD != NULL &&
| | | 3114 | | ( TD->entry_exit != entry_exit || TD->index != index ) ) | | | 3115 | | { | | | 3116 | | TD = TD->next; | | | 3117 | | } | | | 3118 | | | | | 3119 | | if ( TD == NULL )
| | | 3120 | | { | | | 3121 | | printf( "Error: Event \"%s\" Descriptor Not Found\n", name ); | | | 3122 | | | | | 3123 | | trc_find_event_end( ID ); | | | 3124 | | | | | 3125 | | return( TRC_FALSE );
| | | 3126 | | } | | | 3127 | | | | | 3128 | | if ( !trc_find_event_str( ID, "{" ) ) | | | 3129 | | return( TRC_FALSE );
| | | 3130 | | | | | 3131 | | | | | 3132 | | | | | 3133 | | DD = TD->ddesc; | | | 3134 | | | | | 3135 | | TR = (TRC_TEVREC) NULL;
| | | 3136 | | | | | 3137 | | while ( DD != NULL )
| | | 3138 | | { | | | 3139 | | if ( TR == NULL )
| | | 3140 | | trptr = TR = trc_create_tevrec(); | | | 3141 | | | | | 3142 | | else | | | 3143 | | trptr = trptr->next = trc_create_tevrec(); | | | 3144 | | | | | 3145 | | trptr->ddesc = DD; | | | 3146 | | | | | 3147 | | if ( DD->array == TEV_DATA_ARRAY )
| | | 3148 | | { | | | 3149 | | if ( !trc_find_event_str( ID, "[" ) ) | | | 3150 | | return( TRC_FALSE );
| | | 3151 | | | | | 3152 | | flag = fscanf( ID->trace_in, "%d", &num ); | | | 3153 | | | | | 3154 | | if ( flag != 1 ) | | | 3155 | | { | | | 3156 | | printf( "Error Parsing Event Record\n" ); | | | 3157 | | | | | | | ... | | | 3159 | | | | | 3160 | | return( TRC_FALSE );
| | | 3161 | | } | | | 3162 | | | | | 3163 | | if ( !trc_find_event_str( ID, "{" ) ) | | | 3164 | | return( TRC_FALSE );
| | | 3165 | | | | | 3166 | | | | | 3167 | | } | | | 3168 | | | | | 3169 | | else | | | 3170 | | num = 1; | | | 3171 | | |
| | 3173 | | | | referenced by trptr->value | 3174 | | if ( trptr->value == NULL )
| | | 3175 | | { | | | 3176 | | printf( "Error Allocating Value dt=%d num=%d\n", | | | 3177 | | DD->dt, num ); | | | 3178 | | | | | 3179 | | return( TRC_FALSE );
| | | 3180 | | } | | | 3181 | | | | | 3182 | | trptr->num = num; | | | 3183 | | | | | 3184 | | switch ( DD->dt ) | | | 3185 | | { | | | 3186 | | case TEV_DATA_NULL: break;
| | | 3187 | | | | | 3188 | | case TEV_DATA_BYTE:
| | | 3189 | | { | | | 3190 | | if ( DD->array == TEV_DATA_ARRAY )
| | | 3191 | | { | | | 3192 | | if ( !trc_find_event_str( ID, "\"" ) ) | | | 3193 | | return( TRC_FALSE );
| | | 3194 | | | | | | | ... | | | 3334 | | if ( i < num - 1 ) | | | 3335 | | { | | | 3336 | | if ( !trc_find_event_str( ID, "," ) ) | | | 3337 | | return( TRC_FALSE );
| | | 3338 | | } | | | 3339 | | } | | | 3340 | | | | | 3341 | | break; | | | 3342 | | } | | | 3343 | | | | | 3344 | | case TEV_DATA_LONG:
| | | 3345 | | { | | | 3346 | | for ( i=0 ; i < num ; i++ ) | | | 3347 | | { | | | 3348 | | flag = fscanf( ID->trace_in, "%ld", &read_long ); | | | 3349 | | | | | 3350 | | if ( flag != 1 ) | | | 3351 | | { | | | 3352 | | printf( "Error Parsing Event Record\n" ); | | | 3353 | | | | | 3354 | | trc_find_event_end( ID ); | | | 3355 | | | | | 3356 | | return( TRC_FALSE );
| | | 3357 | | } | | | 3358 | | | | | 3359 | | TRC_ARR_VALUE_OF( trptr->value, long, i ) =
| | | 3360 | | read_long; | | | 3361 | | | | | 3362 | | if ( i < num - 1 ) | | | 3363 | | { | | | 3364 | | if ( !trc_find_event_str( ID, "," ) ) | | | 3365 | | return( TRC_FALSE );
| | | 3366 | | } | | | | | ... | | | 3534 | | } | | | 3535 | | | | | 3536 | | DD = DD->next; | | | 3537 | | } | | | 3538 | | | | | 3539 | | (ID->handle_event)( ID, TD, TR ); | | | 3540 | | | | | 3541 | | trc_free_tevrec( &TR ); | | | 3542 | | | | | 3543 | | return( TRC_TRUE );
| | | 3544 | | } |
|