Home | History | Annotate | Download | only in main
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 2001-2012 Broadcom Corporation
      4  *
      5  *  Licensed under the Apache License, Version 2.0 (the "License");
      6  *  you may not use this file except in compliance with the License.
      7  *  You may obtain a copy of the License at:
      8  *
      9  *  http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  *
     17  ******************************************************************************/
     18 
     19 /******************************************************************************
     20  *
     21  *  Contains the LogMsg wrapper routines for BTE.  It routes calls the
     22  *  appropriate application's LogMsg equivalent.
     23  *
     24  ******************************************************************************/
     25 
     26 #include <stdio.h>
     27 #include <stdlib.h>
     28 #include <string.h>
     29 #include <stdarg.h>
     30 
     31 #include "gki.h"
     32 #include "bte.h"
     33 
     34 #include "bte_appl.h"
     35 
     36 #if MMI_INCLUDED == TRUE
     37 #include "mmi.h"
     38 #endif
     39 
     40 /* always enable trace framework */
     41 
     42 #include "btu.h"
     43 #include "l2c_api.h"
     44 #if (RFCOMM_INCLUDED==TRUE)
     45 #include "port_api.h"
     46 #endif
     47 #if (OBX_INCLUDED==TRUE)
     48 #include "obx_api.h"
     49 #endif
     50 #if (AVCT_INCLUDED==TRUE)
     51 #include "avct_api.h"
     52 #endif
     53 #if (AVDT_INCLUDED==TRUE)
     54 #include "avdt_api.h"
     55 #endif
     56 #if (AVRC_INCLUDED==TRUE)
     57 #include "avrc_api.h"
     58 #endif
     59 #if (AVDT_INCLUDED==TRUE)
     60 #include "avdt_api.h"
     61 #endif
     62 #if (A2D_INCLUDED==TRUE)
     63 #include "a2d_api.h"
     64 #endif
     65 #if (BIP_INCLUDED==TRUE)
     66 #include "bip_api.h"
     67 #endif
     68 #if (BNEP_INCLUDED==TRUE)
     69 #include "bnep_api.h"
     70 #endif
     71 #if (BPP_INCLUDED==TRUE)
     72 #include "bpp_api.h"
     73 #endif
     74 #include "btm_api.h"
     75 #if (DUN_INCLUDED==TRUE)
     76 #include "dun_api.h"
     77 #endif
     78 #if (GAP_INCLUDED==TRUE)
     79 #include "gap_api.h"
     80 #endif
     81 #if (GOEP_INCLUDED==TRUE)
     82 #include "goep_util.h"
     83 #endif
     84 #if (HCRP_INCLUDED==TRUE)
     85 #include "hcrp_api.h"
     86 #endif
     87 #if (PAN_INCLUDED==TRUE)
     88 #include "pan_api.h"
     89 #endif
     90 #include "sdp_api.h"
     91 
     92 #if (BLE_INCLUDED==TRUE)
     93 #include "gatt_api.h"
     94 #endif
     95 
     96     /* LayerIDs for BTA, currently everything maps onto appl_trace_level */
     97 #if (BTA_INCLUDED==TRUE)
     98 #include "bta_api.h"
     99 #endif
    100 
    101 
    102 #if defined(__CYGWIN__) || defined(__linux__)
    103 #undef RPC_INCLUDED
    104 #define RPC_INCLUDED TRUE
    105 
    106 #include <sys/time.h>
    107 #include <time.h>
    108 
    109 #if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
    110 const char * const bt_layer_tags[] = {
    111     "bt-btif",
    112     "bt-usb",
    113     "bt-serial",
    114     "bt-socket",
    115     "bt-rs232",
    116     "bt-lc",
    117     "bt-lm",
    118     "bt-hci",
    119     "bt-l2cap",
    120     "bt-rfcomm",
    121     "bt-sdp",
    122     "bt-tcs",
    123     "bt-obex",
    124     "bt-btm",
    125     "bt-gap",
    126     "bt-dun",
    127     "bt-goep",
    128     "bt-icp",
    129     "bt-hsp2",
    130     "bt-spp",
    131     "bt-ctp",
    132     "bt-bpp",
    133     "bt-hcrp",
    134     "bt-ftp",
    135     "bt-opp",
    136     "bt-btu",
    137     "bt-gki",
    138     "bt-bnep",
    139     "bt-pan",
    140     "bt-hfp",
    141     "bt-hid",
    142     "bt-bip",
    143     "bt-avp",
    144     "bt-a2d",
    145     "bt-sap",
    146     "bt-amp",
    147     "bt-mca",
    148     "bt-att",
    149     "bt-smp",
    150     "bt-nfc",
    151     "bt-nci",
    152     "bt-idep",
    153     "bt-ndep",
    154     "bt-llcp",
    155     "bt-rw",
    156     "bt-ce",
    157     "bt-snep",
    158     "bt-ndef",
    159     "bt-nfa",
    160 };
    161 
    162 #ifndef LINUX_NATIVE
    163 #include <cutils/log.h>
    164 #define LOGI0(t,s) __android_log_write(ANDROID_LOG_INFO, t, s)
    165 #define LOGD0(t,s) __android_log_write(ANDROID_LOG_DEBUG, t, s)
    166 #define LOGW0(t,s) __android_log_write(ANDROID_LOG_WARN, t, s)
    167 #define LOGE0(t,s) __android_log_write(ANDROID_LOG_ERROR, t, s)
    168 
    169 #else
    170 #undef ANDROID_USE_LOGCAT
    171 #endif
    172 
    173 #endif
    174 
    175 
    176 //#include "btl_cfg.h"
    177 #define BTL_GLOBAL_PROP_TRC_FLAG "TRC_BTAPP"
    178 #ifndef DEFAULT_CONF_TRACE_LEVEL
    179 #define DEFAULT_CONF_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
    180 #endif
    181 
    182 #ifndef BTE_LOG_BUF_SIZE
    183 #define BTE_LOG_BUF_SIZE  1024
    184 #endif
    185 #define BTE_LOG_MAX_SIZE  (BTE_LOG_BUF_SIZE - 12)
    186 
    187 
    188 //#define BTE_MAP_TRACE_LEVEL FALSE
    189 /* map by default BTE trace levels onto android trace levels */
    190 #ifndef BTE_MAP_TRACE_LEVEL
    191 #define BTE_MAP_TRACE_LEVEL TRUE
    192 #endif
    193 
    194 // #define BTE_ANDROID_INTERNAL_TIMESTAMP TRUE
    195 /* by default no internal timestamp. adb logcate -v time allows having timestamps */
    196 #ifndef BTE_ANDROID_INTERNAL_TIMESTAMP
    197 #define BTE_ANDROID_INTERNAL_TIMESTAMP FALSE
    198 #endif
    199 #if (BTE_ANDROID_INTERNAL_TIMESTAMP==TRUE)
    200 #define MSG_BUFFER_OFFSET strlen(buffer)
    201 #else
    202 #define MSG_BUFFER_OFFSET 0
    203 #endif
    204 
    205 //#define DBG_TRACE
    206 
    207 #if defined( DBG_TRACE )
    208 #define DBG_TRACE_API0( m ) BT_TRACE_0( TRACE_LAYER_HCI, TRACE_TYPE_API, m )
    209 #define DBG_TRACE_WARNING2( m, p0, p1 ) BT_TRACE_2( TRACE_LAYER_BTM, (TRACE_ORG_APPL|TRACE_TYPE_WARNING), m, p0, p1 )
    210 #else
    211 #define DBG_TRACE_API0( m )
    212 #define DBG_TRACE_WARNING2( m, p0, p1 )
    213 #endif
    214 #define DBG_TRACE_DEBUG2( m, p0, p1 ) BT_TRACE_2( TRACE_LAYER_BTM, (TRACE_ORG_APPL|TRACE_TYPE_DEBUG), m, p0, p1 )
    215 
    216 void
    217 LogMsg(UINT32 trace_set_mask, const char *fmt_str, ...)
    218 {
    219 	static char buffer[BTE_LOG_BUF_SIZE];
    220     int trace_layer = TRACE_GET_LAYER(trace_set_mask);
    221     if (trace_layer >= TRACE_LAYER_MAX_NUM)
    222         trace_layer = 0;
    223 
    224 	va_list ap;
    225 #if (BTE_ANDROID_INTERNAL_TIMESTAMP==TRUE)
    226 	struct timeval tv;
    227 	struct timezone tz;
    228 	struct tm *tm;
    229 	time_t t;
    230 
    231 	gettimeofday(&tv, &tz);
    232 	time(&t);
    233 	tm = localtime(&t);
    234 
    235     sprintf(buffer, "%02d:%02d:%02d.%03d ", tm->tm_hour, tm->tm_min, tm->tm_sec,
    236         tv.tv_usec / 1000);
    237 #endif
    238 	va_start(ap, fmt_str);
    239 	vsnprintf(&buffer[MSG_BUFFER_OFFSET], BTE_LOG_MAX_SIZE, fmt_str, ap);
    240 	va_end(ap);
    241 
    242 #if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
    243 #if (BTE_MAP_TRACE_LEVEL==TRUE)
    244     switch ( TRACE_GET_TYPE(trace_set_mask) )
    245     {
    246         case TRACE_TYPE_ERROR:
    247             LOGE0(bt_layer_tags[trace_layer], buffer);
    248             break;
    249         case TRACE_TYPE_WARNING:
    250             LOGW0(bt_layer_tags[trace_layer], buffer);
    251             break;
    252         case TRACE_TYPE_API:
    253         case TRACE_TYPE_EVENT:
    254             LOGI0(bt_layer_tags[trace_layer], buffer);
    255             break;
    256         case TRACE_TYPE_DEBUG:
    257             LOGD0(bt_layer_tags[trace_layer], buffer);
    258             break;
    259         default:
    260             LOGE0(bt_layer_tags[trace_layer], buffer);      /* we should never get this */
    261             break;
    262     }
    263 #else
    264     LOGI0(bt_layer_tags[trace_layer], buffer);
    265 #endif
    266 #else
    267 	write(2, buffer, strlen(buffer));
    268 	write(2, "\n", 1);
    269 #endif
    270 }
    271 
    272 void
    273 ScrLog(UINT32 trace_set_mask, const char *fmt_str, ...)
    274 {
    275 	static char buffer[BTE_LOG_BUF_SIZE];
    276 
    277 	va_list ap;
    278 	struct timeval tv;
    279 	struct timezone tz;
    280 	struct tm *tm;
    281 	time_t t;
    282     int trace_layer = TRACE_GET_LAYER(trace_set_mask);
    283     if (trace_layer >= TRACE_LAYER_MAX_NUM)
    284         trace_layer = 0;
    285 
    286 	gettimeofday(&tv, &tz);
    287 	time(&t);
    288 	tm = localtime(&t);
    289 
    290         sprintf(buffer, "%02d:%02d:%02d.%03ld ", tm->tm_hour, tm->tm_min, tm->tm_sec,
    291         tv.tv_usec / 1000);
    292 
    293 	va_start(ap, fmt_str);
    294 	vsnprintf(&buffer[strlen(buffer)], BTE_LOG_MAX_SIZE, fmt_str, ap);
    295 	va_end(ap);
    296 
    297 #if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE))
    298     LOGI0(bt_layer_tags[trace_layer], buffer);
    299 #else
    300 	write(2, buffer, strlen(buffer));
    301 	write(2, "\n", 1);
    302 #endif
    303 }
    304 
    305 /* this function should go into BTAPP_DM for example */
    306 BT_API UINT8 BTAPP_SetTraceLevel( UINT8 new_level )
    307 {
    308     if (new_level != 0xFF)
    309         appl_trace_level = new_level;
    310 
    311     return (appl_trace_level);
    312 }
    313 
    314 BTU_API UINT8 BTU_SetTraceLevel( UINT8 new_level )
    315 {
    316     if (new_level != 0xFF)
    317         btu_cb.trace_level = new_level;
    318 
    319     return (btu_cb.trace_level);
    320 }
    321 
    322 BOOLEAN trace_conf_enabled = FALSE;
    323 
    324 void bte_trace_conf(char *p_conf_name, char *p_conf_value)
    325 {
    326     tBTTRC_FUNC_MAP *p_f_map = (tBTTRC_FUNC_MAP *) &bttrc_set_level_map[0];
    327 
    328     while (p_f_map->trc_name != NULL)
    329     {
    330         if (strcmp(p_f_map->trc_name, (const char *)p_conf_name) == 0)
    331         {
    332             p_f_map->trace_level = (UINT8) atoi(p_conf_value);
    333             break;
    334         }
    335         p_f_map++;
    336     }
    337 }
    338 
    339 /********************************************************************************
    340  **
    341  **    Function Name:    BTA_SysSetTraceLevel
    342  **
    343  **    Purpose:          set or reads the different Trace Levels of layer IDs (see bt_trace.h,
    344  **                      BTTRC_ID_xxxx
    345  **
    346  **    Input Parameters: Array with trace layers to set to a given level or read. a layer ID of 0
    347  **                      defines the end of the list
    348  **                      WARNING: currently type should be 0-5! or FF for reading!!!!
    349  **
    350  **    Returns:
    351  **                      input array with trace levels for given layer id
    352  **
    353  *********************************************************************************/
    354 BT_API tBTTRC_LEVEL * BTA_SysSetTraceLevel(tBTTRC_LEVEL * p_levels)
    355 {
    356     const tBTTRC_FUNC_MAP *p_f_map;
    357     tBTTRC_LEVEL *p_l = p_levels;
    358 
    359     DBG_TRACE_API0( "BTA_SysSetTraceLevel()" );
    360 
    361     while (0 != p_l->layer_id)
    362     {
    363         p_f_map = &bttrc_set_level_map[0];
    364 
    365         while (0 != p_f_map->layer_id_start)
    366         {
    367             printf("BTA_SysSetTraceLevel - trace id in map start = %d end= %d,  paramter id = %d\r\n", p_f_map->layer_id_start, p_f_map->layer_id_end, p_l->layer_id );
    368             /* as p_f_map is ordered by increasing layer id, go to next map entry as long end id
    369              * is smaller */
    370             //if (p_f_map->layer_id_end < p_l->layer_id)
    371             //{
    372                 //p_f_map++;
    373             //}
    374             //else
    375             {
    376                 /* check if layer_id actually false into a range or if it is note existing in the  map */
    377                 if ((NULL != p_f_map->p_f) && (p_f_map->layer_id_start <= p_l->layer_id) && (p_f_map->layer_id_end >= p_l->layer_id) )
    378                 {
    379                     DBG_TRACE_DEBUG2( "BTA_SysSetTraceLevel( id:%d, level:%d ): setting/reading",
    380                             p_l->layer_id, p_l->type );
    381                     p_l->type = p_f_map->p_f(p_l->type);
    382                     break;
    383                 }
    384                 else
    385                 {
    386                     DBG_TRACE_WARNING2( "BTA_SysSetTraceLevel( id:%d, level:%d ): MISSING Set function OR ID in map!",
    387                             p_l->layer_id, p_l->type );
    388                 }
    389                 /* set/read next trace level by getting out ot map loop */
    390                 //p_l++;
    391                 //break;
    392             }
    393             p_f_map++;
    394         }
    395         //if (0 == p_f_map->layer_id_start)
    396         {
    397             DBG_TRACE_WARNING2( "BTA_SysSetTraceLevel( id:%d, level:%d ): ID NOT FOUND in map. Skip to next",
    398                     p_l->layer_id, p_l->type );
    399             p_l++;
    400         }
    401     }
    402 
    403     return p_levels;
    404 } /* BTA_SysSetTraceLevel() */
    405 
    406 /* make sure list is order by increasing layer id!!! */
    407 tBTTRC_FUNC_MAP bttrc_set_level_map[] = {
    408     {BTTRC_ID_STK_BTU, BTTRC_ID_STK_HCI, BTU_SetTraceLevel, "TRC_HCI", DEFAULT_CONF_TRACE_LEVEL},
    409     {BTTRC_ID_STK_L2CAP, BTTRC_ID_STK_L2CAP, L2CA_SetTraceLevel, "TRC_L2CAP", DEFAULT_CONF_TRACE_LEVEL},
    410 #if (RFCOMM_INCLUDED==TRUE)
    411     {BTTRC_ID_STK_RFCOMM, BTTRC_ID_STK_RFCOMM_DATA, PORT_SetTraceLevel, "TRC_RFCOMM", DEFAULT_CONF_TRACE_LEVEL},
    412 #endif
    413 #if (OBX_INCLUDED==TRUE)
    414     {BTTRC_ID_STK_OBEX, BTTRC_ID_STK_OBEX, OBX_SetTraceLevel, "TRC_OBEX", DEFAULT_CONF_TRACE_LEVEL},
    415 #endif
    416 #if (AVCT_INCLUDED==TRUE)
    417     //{BTTRC_ID_STK_AVCT, BTTRC_ID_STK_AVCT, NULL, "TRC_AVCT", DEFAULT_CONF_TRACE_LEVEL},
    418 #endif
    419 #if (AVDT_INCLUDED==TRUE)
    420     {BTTRC_ID_STK_AVDT, BTTRC_ID_STK_AVDT, AVDT_SetTraceLevel, "TRC_AVDT", DEFAULT_CONF_TRACE_LEVEL},
    421 #endif
    422 #if (AVRC_INCLUDED==TRUE)
    423     {BTTRC_ID_STK_AVRC, BTTRC_ID_STK_AVRC, AVRC_SetTraceLevel, "TRC_AVRC", DEFAULT_CONF_TRACE_LEVEL},
    424 #endif
    425 #if (AVDT_INCLUDED==TRUE)
    426     //{BTTRC_ID_AVDT_SCB, BTTRC_ID_AVDT_CCB, NULL, "TRC_AVDT_SCB", DEFAULT_CONF_TRACE_LEVEL},
    427 #endif
    428 #if (A2D_INCLUDED==TRUE)
    429     {BTTRC_ID_STK_A2D, BTTRC_ID_STK_A2D, A2D_SetTraceLevel, "TRC_A2D", DEFAULT_CONF_TRACE_LEVEL},
    430 #endif
    431 #if (BIP_INCLUDED==TRUE)
    432     {BTTRC_ID_STK_BIP, BTTRC_ID_STK_BIP, BIP_SetTraceLevel, "TRC_BIP", DEFAULT_CONF_TRACE_LEVEL},
    433 #endif
    434 #if (BNEP_INCLUDED==TRUE)
    435     {BTTRC_ID_STK_BNEP, BTTRC_ID_STK_BNEP, BNEP_SetTraceLevel, "TRC_BNEP", DEFAULT_CONF_TRACE_LEVEL},
    436 #endif
    437 #if (BPP_INCLUDED==TRUE)
    438     {BTTRC_ID_STK_BPP, BTTRC_ID_STK_BPP, BPP_SetTraceLevel, "TRC_BPP", DEFAULT_CONF_TRACE_LEVEL},
    439 #endif
    440     {BTTRC_ID_STK_BTM_ACL, BTTRC_ID_STK_BTM_SEC, BTM_SetTraceLevel, "TRC_BTM", DEFAULT_CONF_TRACE_LEVEL},
    441 #if (DUN_INCLUDED==TRUE)
    442     {BTTRC_ID_STK_DUN, BTTRC_ID_STK_DUN, DUN_SetTraceLevel, "TRC_DUN", DEFAULT_CONF_TRACE_LEVEL},
    443 #endif
    444 #if (GAP_INCLUDED==TRUE)
    445     {BTTRC_ID_STK_GAP, BTTRC_ID_STK_GAP, GAP_SetTraceLevel, "TRC_GAP", DEFAULT_CONF_TRACE_LEVEL},
    446 #endif
    447 #if (GOEP_INCLUDED==TRUE)
    448     {BTTRC_ID_STK_GOEP, BTTRC_ID_STK_GOEP, GOEP_SetTraceLevel, "TRC_GOEP", DEFAULT_CONF_TRACE_LEVEL},
    449 #endif
    450 #if (HCRP_INCLUDED==TRUE)
    451     {BTTRC_ID_STK_HCRP, BTTRC_ID_STK_HCRP, HCRP_SetTraceLevel, "TRC_HCRP", DEFAULT_CONF_TRACE_LEVEL},
    452 #endif
    453 #if (PAN_INCLUDED==TRUE)
    454     {BTTRC_ID_STK_PAN, BTTRC_ID_STK_PAN, PAN_SetTraceLevel, "TRC_PAN", DEFAULT_CONF_TRACE_LEVEL},
    455 #endif
    456 #if (SAP_SERVER_INCLUDED==TRUE)
    457     {BTTRC_ID_STK_SAP, BTTRC_ID_STK_SAP, NULL, "TRC_SAP", DEFAULT_CONF_TRACE_LEVEL},
    458 #endif
    459     {BTTRC_ID_STK_SDP, BTTRC_ID_STK_SDP, SDP_SetTraceLevel, "TRC_SDP", DEFAULT_CONF_TRACE_LEVEL},
    460 #if (BLE_INCLUDED==TRUE)
    461     {BTTRC_ID_STK_GATT, BTTRC_ID_STK_GATT, GATT_SetTraceLevel, "TRC_GATT", DEFAULT_CONF_TRACE_LEVEL},
    462 #endif
    463 #if (BLE_INCLUDED==TRUE)
    464     {BTTRC_ID_STK_SMP, BTTRC_ID_STK_SMP, SMP_SetTraceLevel, "TRC_SMP", DEFAULT_CONF_TRACE_LEVEL},
    465 #endif
    466 
    467 #if (BTA_INCLUDED==TRUE)
    468     /* LayerIDs for BTA, currently everything maps onto appl_trace_level.
    469      * BTL_GLOBAL_PROP_TRC_FLAG serves as flag in conf.
    470      */
    471     {BTTRC_ID_BTA_ACC, BTTRC_ID_BTAPP, BTAPP_SetTraceLevel, BTL_GLOBAL_PROP_TRC_FLAG, DEFAULT_CONF_TRACE_LEVEL},
    472 #endif
    473 
    474     {0, 0, NULL, NULL, DEFAULT_CONF_TRACE_LEVEL}
    475 };
    476 
    477 const UINT16 bttrc_map_size = sizeof(bttrc_set_level_map)/sizeof(tBTTRC_FUNC_MAP);
    478 #endif
    479 
    480 /********************************************************************************
    481  **
    482  **    Function Name:     BTE_InitTraceLevels
    483  **
    484  **    Purpose:           This function can be used to set the boot time reading it from the
    485  **                       platform.
    486  **                       WARNING: it is called under BTU context and it blocks the BTU task
    487  **                       till it returns (sync call)
    488  **
    489  **    Input Parameters:  None, platform to provide levels
    490  **    Returns:
    491  **                       Newly set levels, if any!
    492  **
    493  *********************************************************************************/
    494 BT_API void BTE_InitTraceLevels( void )
    495 {
    496     /* read and set trace levels by calling the different XXX_SetTraceLevel().
    497      */
    498 #if ( BT_USE_TRACES==TRUE )
    499     if (trace_conf_enabled == TRUE)
    500     {
    501         tBTTRC_FUNC_MAP *p_f_map = (tBTTRC_FUNC_MAP *) &bttrc_set_level_map[0];
    502 
    503         while (p_f_map->trc_name != NULL)
    504         {
    505             ALOGI("BTE_InitTraceLevels -- %s", p_f_map->trc_name);
    506 
    507             if (p_f_map->p_f)
    508                 p_f_map->p_f(p_f_map->trace_level);
    509 
    510             p_f_map++;
    511         }
    512     }
    513     else
    514     {
    515         ALOGI("[bttrc] using compile default trace settings");
    516     }
    517 #endif
    518 }
    519 
    520 
    521 /********************************************************************************
    522  **
    523  **    Function Name:   LogMsg_0
    524  **
    525  **    Purpose:  Encodes a trace message that has no parameter arguments
    526  **
    527  **    Input Parameters:  trace_set_mask: tester trace type.
    528  **                       fmt_str: displayable string.
    529  **    Returns:
    530  **                      Nothing.
    531  **
    532  *********************************************************************************/
    533 void LogMsg_0(UINT32 trace_set_mask, const char *fmt_str) {
    534     LogMsg(trace_set_mask, fmt_str);
    535 }
    536 
    537 /********************************************************************************
    538  **
    539  **    Function Name:   LogMsg_1
    540  **
    541  **    Purpose:  Encodes a trace message that has one parameter argument
    542  **
    543  **    Input Parameters:  trace_set_mask: tester trace type.
    544  **                       fmt_str: displayable string.
    545  **    Returns:
    546  **                      Nothing.
    547  **
    548  *********************************************************************************/
    549 void LogMsg_1(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1) {
    550 
    551     LogMsg(trace_set_mask, fmt_str, p1);
    552 }
    553 
    554 /********************************************************************************
    555  **
    556  **    Function Name:   LogMsg_2
    557  **
    558  **    Purpose:  Encodes a trace message that has two parameter arguments
    559  **
    560  **    Input Parameters:  trace_set_mask: tester trace type.
    561  **                       fmt_str: displayable string.
    562  **    Returns:
    563  **                      Nothing.
    564  **
    565  *********************************************************************************/
    566 void LogMsg_2(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2) {
    567     LogMsg(trace_set_mask, fmt_str, p1, p2);
    568 }
    569 
    570 /********************************************************************************
    571  **
    572  **    Function Name:   LogMsg_3
    573  **
    574  **    Purpose:  Encodes a trace message that has three parameter arguments
    575  **
    576  **    Input Parameters:  trace_set_mask: tester trace type.
    577  **                       fmt_str: displayable string.
    578  **    Returns:
    579  **                      Nothing.
    580  **
    581  *********************************************************************************/
    582 void LogMsg_3(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
    583         UINT32 p3) {
    584     LogMsg(trace_set_mask, fmt_str, p1, p2, p3);
    585 }
    586 
    587 /********************************************************************************
    588  **
    589  **    Function Name:   LogMsg_4
    590  **
    591  **    Purpose:  Encodes a trace message that has four parameter arguments
    592  **
    593  **    Input Parameters:  trace_set_mask: tester trace type.
    594  **                       fmt_str: displayable string.
    595  **    Returns:
    596  **                      Nothing.
    597  **
    598  *********************************************************************************/
    599 void LogMsg_4(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
    600         UINT32 p3, UINT32 p4) {
    601     LogMsg(trace_set_mask, fmt_str, p1, p2, p3, p4);
    602 }
    603 
    604 /********************************************************************************
    605  **
    606  **    Function Name:   LogMsg_5
    607  **
    608  **    Purpose:  Encodes a trace message that has five parameter arguments
    609  **
    610  **    Input Parameters:  trace_set_mask: tester trace type.
    611  **                       fmt_str: displayable string.
    612  **    Returns:
    613  **                      Nothing.
    614  **
    615  *********************************************************************************/
    616 void LogMsg_5(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
    617         UINT32 p3, UINT32 p4, UINT32 p5) {
    618     LogMsg(trace_set_mask, fmt_str, p1, p2, p3, p4, p5);
    619 }
    620 
    621 /********************************************************************************
    622  **
    623  **    Function Name:   LogMsg_6
    624  **
    625  **    Purpose:  Encodes a trace message that has six parameter arguments
    626  **
    627  **    Input Parameters:  trace_set_mask: tester trace type.
    628  **                       fmt_str: displayable string.
    629  **    Returns:
    630  **                      Nothing.
    631  **
    632  *********************************************************************************/
    633 void LogMsg_6(UINT32 trace_set_mask, const char *fmt_str, UINT32 p1, UINT32 p2,
    634         UINT32 p3, UINT32 p4, UINT32 p5, UINT32 p6) {
    635     LogMsg(trace_set_mask, fmt_str, p1, p2, p3, p4, p5, p6);
    636 }
    637