blob: c5d0318445d484e0b6853a0833b39f250ffc9a89 [file] [log] [blame]
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* kal_trace.h
*
* Project:
* --------
* Maui_Software
*
* Description:
* ------------
* This file provides typedefs and definiton for PS index trace.
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*------------------------------------------------------------------------------
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
*
*
* removed!
* removed!
*
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
* removed!
*
* removed!
* removed!
*
* removed!
* removed!
*------------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef _KAL_TRACE_H
#define _KAL_TRACE_H
#include "dhl_unified_trace.h"
#if defined(__DHL_MODULE__)
#else
#include <stdarg.h>
#ifndef GEN_FOR_PC
#include <stdio.h>
#endif
#include "kal_general_types.h"
#include "kal_public_defs.h"
#if defined(__MTK_TARGET__) && !defined(__GNUC__)
#pragma diag_suppress 870
#endif //#ifdef __MTK_TARGET__
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__TST_MODULE__) && defined(__EM_MODE__) /* for ilm_struct type definition */
#ifndef GEN_FOR_PC
struct ilm_struct;
extern void tst_EM_logger(struct ilm_struct *ilm_ptr);
#if defined(__DHL_MODULE__)
extern void dhl_EM_logger(struct ilm_struct *ilm_ptr);
#endif
#endif
#endif //#if defined(__TST_MODULE__) && defined(__EM_MODE__)
#if !defined(__DHL_MODULE__)
#define dhl_trace(...)
#define dhl_internal_trace(...)
#define dhl_brief_trace(...)
#define dhl_peer_trace(...)
#define dhl_raw_trace(...)
#define dhl_print(...)
#define dhl_print_string(...)
#define dhl_print_system_trace(...)
#define dhl_print_struct(...)
#define dhl_debug_print(...)
#define dhl_trace_impl(...)
#define dhl_internal_trace_impl(...)
#define dhl_print_impl(...)
#define dhl_EM_logger(...)
#endif //#if !defined(__DHL_MODULE__)
#define MAX_MSG_NBR_IN_MODULE 20
#define ADDITIONAL_BUFFER_FOR_MUX 45
#define DEFAULT_RS232_FRAME_SIZE 5 /* STX, LenHi, LenLo, Type, Checksum*/
#define SAP_LOCAL_PARA_FILTER 0x02
#define SAP_PEER_BUFF_FILTER 0x04
#define STX_OCTET 0x55
#define LOGGED_PRIMITIVE_TYPE 0x60
#define PS_TRACE_INDEX_TRACE_TYPE 0x61
#define PS_PROMPT_TRACE_TYPE 0x62
#define CONTROL_COMMAND_TYPE 0x63
#define INJECT_PRIMITIVE_TYPE 0x64
#define SYS_TRACE_TYPE 0x65
//Define Trace Macro for PS trace
#if defined(GEN_FOR_PC) && !defined(GEN_FOR_CPARSER)
#define BEGIN_TRACE_MAP(MOD) START_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE
#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) START_RANGE_MODULE_MSG MOD MAX_MSG_NBR_IN_MODULE MIN_VAL MAX_VAL
#define TRC_MSG(MSG,STR) MSG STR
#define TRC_MSG_NEWLINE(MSG,STR,NUM) MSG STR NUM
#define END_TRACE_MAP(MOD) END_MODULE_MSG
#define END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) MOD MIN_VAL MAX_VAL END_RANGE_MODULE_MSG
#else //Define Trace Macro for PS trace
#define BEGIN_TRACE_MAP(MOD) enum MOD##_MSG_ENUM{\
MOD##_empty_string=MOD<<MAX_MSG_NBR_IN_MODULE,
#define BEGIN_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) enum MOD##_##MIN_VAL##_MSG_ENUM{\
MOD##_##MIN_VAL##_empty_string = (MOD<<MAX_MSG_NBR_IN_MODULE) + MIN_VAL - 1,
#define TRC_MSG(MSG,STR) MSG##__enum,
#define TRC_MSG_NEWLINE(MSG,STR,NUM) MSG##__enum, MSG##_NEWLINE_EXPAND__enum = MSG##__enum+NUM,
#define END_TRACE_MAP(MOD) MOD##__end};
#define END_TRACE_MAP_WITH_RANGE(MOD, MIN_VAL, MAX_VAL) MOD##_##MIN_VAL##__end};
#endif //Define Trace Macro for PS trace
//Decide which path should enter
#ifdef __TST_MODULE__
#if !defined(__FUE__) && !defined(__UBL__)
#if !defined(MODULE_TRACE_OFF)
#define __TST_TRACE_ENABLED__
#elif defined(__TST_CRITICAL_TRACE_LEVEL__) //__PRIORITY_TRACING_ENABLED__ should be disabled in MoDIS
#define __TST_CRITICAL_TRACE_ENABLED__
#endif //!defined(MODULE_TRACE_OFF) &&
#endif
#endif //#ifdef __TST_MODULE__
#ifndef __TST_TRACE_ENABLED__
#if defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT) || defined(L1_SIM)
#define __TST_TRACE_EMPTY_FUNCTION__
#if defined(__TST_CRITICAL_TRACE_ENABLED__)
#undef __TST_CRITICAL_TRACE_ENABLED__
#endif //__TST_CRITICAL_TRACE_ENABLED__
#endif //#if defined(KAL_ON_OSCAR) || defined(MCD_DLL_EXPORT) || defined(L1_SIM)
#endif
#if !defined(__TST_CRITICAL_TRACE_ENABLED__) || defined(GEN_FOR_PC)
typedef enum
{
TRACE_FUNC,
TRACE_STATE,
TRACE_INFO,
TRACE_WARNING,
TRACE_ERROR,
TRACE_GROUP_1,
TRACE_GROUP_2,
TRACE_GROUP_3,
TRACE_GROUP_4,
TRACE_GROUP_5,
TRACE_GROUP_6,
TRACE_GROUP_7,
TRACE_GROUP_8,
TRACE_GROUP_9,
TRACE_GROUP_10,
TRACE_PEER
} trace_class_enum;
typedef enum
{
DHL_CUSTOM_MEM_PMIC,
DHL_CUSTOM_MEM_MAX
} DHL_CUSTOM_MEM_TYPE;
#else //__TST_CRITICAL_TRACE_ENABLED__
typedef unsigned char trace_class_enum;
#endif //__TST_CRITICAL_TRACE_ENABLED__
#if defined(__TST_TRACE_ENABLED__)
#define kal_print_string_trace kal_wap_trace //alias kal_print_string_trace as kal_wap_trace
//#define kal_critical_trace kal_trace
//#define kal_critical_brief_trace kal_brief_trace
//#define kal_critical_assert_trace kal_assert_trace
extern void kal_critical_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
extern void kal_critical_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
extern void kal_critical_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
/*******************************************************************************
* <GROUP Functions>
*
* FUNCTION
* kal_trace
* DESCRIPTION
* This function is used to output the pre-defined trace to PC.
* The engineers SHOULD define their own traces before using this function.
* If a trace is defined as ��Today is %d-$d-%d��, kal_trace simply sends the trace ID and the content of %d to PC.
* That will reduce the communication traffic. In the chapter 2, we will introduce how to ass a new trace.
*
*
* Property:
*�� ��Message Compression�� type API
*�� Cannot be invoked in LISR/HISR context.
*�� Can send up to 128 bytes parameters
*�� Suggested to use this API for most of the scenario.
*
* PARAMETERS
* trc_class: [IN] The trace class of this trace. Each module has 15 classes to category.
* msg_index: [IN] Message index. This part will be handled by tool.
* arg_type: [IN] This part will be handled by tool.
* ...: [IN] Parameters to log
* RETURNS
* NONE
* NOTE
*
******************************************************************************/
extern void kal_trace_for_3rd_party(trace_class_enum, kal_uint32, const kal_char *, va_list);
extern void kal_lib_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
extern void kal_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
extern void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...);
extern void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData);
extern void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...);
extern void kal_bootup_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
extern void kal_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
extern void kal_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
#define __TST_OPTIMIZATION_FOR_SPEED__ //Default enable in MOLY
#ifdef __TST_OPTIMIZATION_FOR_SPEED__ //Optimization, kal_brief_trace_macro definition
#if !defined(_MSC_VER)
//Target build
extern kal_bool tst_is_PsTrc_open_and_pstrace_flag; //For optimization, the AND flag of tst_is_PsTrc_open and tst_pstrace_flag
extern void kal_brief_trace_opt_helper(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...);
#define kal_brief_trace_macro(trc_class, msg_index,...) do{\
if(tst_is_PsTrc_open_and_pstrace_flag){\
kal_brief_trace_opt_helper(trc_class, msg_index, ##__VA_ARGS__);\
}\
}while(0)
#else
//PC build (MoDIS or MCDDLL)
extern void kal_trace_macro(trace_class_enum, kal_uint32, const kal_char *, ...);
#endif
#else //__TST_OPTIMIZATION_FOR_SPEED__
#if !defined(_MSC_VER)
//Target build
#define kal_brief_trace_macro(...) kal_brief_trace(__VA_ARGS__)
#else
//PC build (MoDIS or MCDDLL)
extern void kal_trace_macro(trace_class_enum, kal_uint32, const kal_char *, ...);
#endif
#endif //__TST_OPTIMIZATION_FOR_SPEED__
#else //__TST_TRACE_ENABLED__
#if defined(__TST_TRACE_EMPTY_FUNCTION__)
/*
* For non-target platform (PC simulator or MNT),
* we define trace-related functions as inline function to avoid compile error
* in VC++.
*/
static __inline void kal_critical_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
static __inline void kal_critical_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
static __inline void kal_critical_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
static __inline void kal_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
static __inline void kal_brief_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
static __inline void kal_trace_for_3rd_party(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, va_list argument_info)
{
return ;
}
static __inline void kal_lib_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
static __inline void kal_assert_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
static __inline void kal_wap_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
{
return ;
}
static __inline void kal_print_string_trace(module_type mod_id, trace_class_enum trc_class, const char *fmt, ...)
{
return ;
}
static __inline void kal_buffer_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *fmt, kal_uint32 buf_len, const kal_uint8 *pData)
{
return;
}
static __inline void kal_dev_trace(trace_class_enum trc_class, kal_uint32 msg_index, const char *arg_type, ...)
{
return;
}
static __inline void kal_bootup_trace(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
static __inline void kal_brief_trace_macro(trace_class_enum trc_class, kal_uint32 msg_index, const kal_char *arg_type, ...)
{
return ;
}
#elif defined(__TST_CRITICAL_TRACE_ENABLED__)
//Support partial tracing API enable
extern void kal_critical_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
extern void kal_critical_brief_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
extern void kal_critical_assert_trace(trace_class_enum, kal_uint32, const kal_char *, ...);
#define kal_trace(...)
#define kal_brief_trace(...)
#define kal_trace_for_3rd_party(...)
#define kal_lib_trace(...)
#define kal_assert_trace(...)
#define kal_wap_trace(...)
#define kal_print_string_trace(...)
#define kal_buffer_trace(...)
#define kal_dev_trace(...)
#define kal_bootup_trace(...)
#define kal_brief_trace_macro(...)
#if __TST_CRITICAL_TRACE_LEVEL__ > 0
#define TRACE_FUNC 0
#define TRACE_STATE 1
#define TRACE_INFO 2
#define TRACE_WARNING 3
#define TRACE_ERROR 4
#define TRACE_GROUP_1 5
#define TRACE_GROUP_2 6
#define TRACE_GROUP_3 7
#define TRACE_GROUP_4 8
#define TRACE_GROUP_5 9
#define TRACE_GROUP_6 10
#define TRACE_GROUP_7 11
#define TRACE_GROUP_8 12
#define TRACE_GROUP_9 13
#define TRACE_GROUP_10 14
#define TRACE_PEER 15
#undef kal_trace
#undef kal_brief_trace
#define _kal_trace(trace_class_enum, ...) kal_critical_trace_##trace_class_enum(trace_class_enum, __VA_ARGS__)
#define _kal_brief_trace(trace_class_enum, ...) kal_critical_brief_trace_##trace_class_enum(trace_class_enum, __VA_ARGS__)
#define kal_trace(trace_class_enum, ...) _kal_trace(trace_class_enum, __VA_ARGS__)
#define kal_brief_trace(trace_class_enum, ...) _kal_brief_trace(trace_class_enum, __VA_ARGS__)
#define kal_brief_trace_macro(trace_class_enum, ...) _kal_brief_trace(trace_class_enum, __VA_ARGS__)
//#define kal_assert_trace_(trace_class_enum, ...) kal_critical_assert_trace_##trace_class_enum(__VA_ARGS__)
//declare the empty defined
#define kal_critical_trace_0(...)
#define kal_critical_trace_1(...)
#define kal_critical_trace_2(...)
#define kal_critical_trace_3(...)
#define kal_critical_trace_5(...)
#define kal_critical_trace_6(...)
#define kal_critical_trace_7(...)
#define kal_critical_trace_8(...)
#define kal_critical_trace_9(...)
#define kal_critical_trace_10(...)
#define kal_critical_trace_11(...)
#define kal_critical_trace_12(...)
#define kal_critical_trace_13(...)
#define kal_critical_trace_14(...)
#define kal_critical_trace_15(...)
#define kal_critical_brief_trace_0(...)
#define kal_critical_brief_trace_1(...)
#define kal_critical_brief_trace_2(...)
#define kal_critical_brief_trace_3(...)
#define kal_critical_brief_trace_5(...)
#define kal_critical_brief_trace_6(...)
#define kal_critical_brief_trace_7(...)
#define kal_critical_brief_trace_8(...)
#define kal_critical_brief_trace_9(...)
#define kal_critical_brief_trace_10(...)
#define kal_critical_brief_trace_11(...)
#define kal_critical_brief_trace_12(...)
#define kal_critical_brief_trace_13(...)
#define kal_critical_brief_trace_14(...)
#define kal_critical_brief_trace_15(...)
//ignore the known issues, wrap logging APIs in other APIs
#define kal_critical_trace_trc_class(...)
#define kal_critical_brief_trace_trc_class(...)
//define ERROR --> 4
#define kal_critical_trace_4 kal_critical_trace
#define kal_critical_brief_trace_4 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 1
//define WARNING 3
#undef kal_critical_trace_3
#undef kal_critical_brief_trace_3
#define kal_critical_trace_3 kal_critical_trace
#define kal_critical_brief_trace_3 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 2
//define TRACE_STATE 1
#undef kal_critical_trace_1
#undef kal_critical_brief_trace_1
#define kal_critical_trace_1 kal_critical_trace
#define kal_critical_brief_trace_1 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 3
//define TRACE_INFO 2
#undef kal_critical_trace_2
#undef kal_critical_brief_trace_2
#define kal_critical_trace_2 kal_critical_trace
#define kal_critical_brief_trace_2 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 4
//#define TRACE_PEER 15
#undef kal_critical_trace_15
#undef kal_critical_brief_trace_15
#define kal_critical_trace_15 kal_critical_trace
#define kal_critical_brief_trace_15 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 5
//#define TRACE_GROUP_1 5
#undef kal_critical_trace_5
#undef kal_critical_brief_trace_5
#define kal_critical_trace_5 kal_critical_trace
#define kal_critical_brief_trace_5 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 6
//#define TRACE_GROUP_2 6
#undef kal_critical_trace_6
#undef kal_critical_brief_trace_6
#define kal_critical_trace_6 kal_critical_trace
#define kal_critical_brief_trace_6 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 7
//#define TRACE_GROUP_3 7
#undef kal_critical_trace_7
#undef kal_critical_brief_trace_7
#define kal_critical_trace_7 kal_critical_trace
#define kal_critical_brief_trace_7 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 8
//#define TRACE_GROUP_4 8
#undef kal_critical_trace_8
#undef kal_critical_brief_trace_8
#define kal_critical_trace_8 kal_critical_trace
#define kal_critical_brief_trace_8 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 9
//#define TRACE_GROUP_5 9
#undef kal_critical_trace_9
#undef kal_critical_brief_trace_9
#define kal_critical_trace_9 kal_critical_trace
#define kal_critical_brief_trace_9 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 10
//#define TRACE_GROUP_6 10
#undef kal_critical_trace_10
#undef kal_critical_brief_trace_10
#define kal_critical_trace_10 kal_critical_trace
#define kal_critical_brief_trace_10 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 11
//#define TRACE_GROUP_7 11
#undef kal_critical_trace_11
#undef kal_critical_brief_trace_11
#define kal_critical_trace_11 kal_critical_trace
#define kal_critical_brief_trace_11 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 12
//#define TRACE_GROUP_8 12
#undef kal_critical_trace_12
#undef kal_critical_brief_trace_12
#define kal_critical_trace_12 kal_critical_trace
#define kal_critical_brief_trace_12 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 13
//#define TRACE_GROUP_9 13
#undef kal_critical_trace_13
#undef kal_critical_brief_trace_13
#define kal_critical_trace_13 kal_critical_trace
#define kal_critical_brief_trace_13 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 14
//#define TRACE_GROUP_10 14
#undef kal_critical_trace_14
#undef kal_critical_brief_trace_14
#define kal_critical_trace_14 kal_critical_trace
#define kal_critical_brief_trace_14 kal_critical_brief_trace
#endif
#if __TST_CRITICAL_TRACE_LEVEL__ > 15
//#define TRACE_FUNC 0
#undef kal_critical_trace_0
#undef kal_critical_brief_trace_0
#define kal_critical_trace_0 kal_critical_trace
#define kal_critical_brief_trace_0 kal_critical_brief_trace
#endif
#else // #if defined(__TST_TRACE_EMPTY_FUNCTION__)
//Define empty functions for Target SW
#define kal_trace(...)
#define kal_brief_trace(...)
#define kal_trace_for_3rd_party(...)
#define kal_lib_trace(...)
#define kal_assert_trace(...)
#define kal_wap_trace(...)
#define kal_print_string_trace(...)
#define kal_buffer_trace(...)
#define kal_dev_trace(...)
#define kal_bootup_trace(...)
#define kal_critical_trace(...)
#define kal_critical_brief_trace(...)
#define kal_critical_assert_trace(...)
#define kal_brief_trace_macro(...)
#endif // #if defined(__TST_TRACE_EMPTY_FUNCTION__)
#endif //__TST_TRACE_ENABLED__
#define kal_sys_trace tst_sys_trace
#define kal_sys_init_trace tst_sys_init_trace
#define kal_sys_fatal_trace tst_sysfatal_trace
#ifdef __TST_MODULE__
/*******************************************************************************
* <GROUP Functions>
*
* FUNCTION
* kal_prompt_trace
* DESCRIPTION
* It's a printf-like function which outputs log to Catcher Tool.
* Property:
* The message is sent in plaintext
*�� Cannot be invoked in LISR context.
*�� Can send up to 128 bytes logs
*�� This API can only be used in customer side to reduce the impact of ROM size increase.
*�� Heavy resource consumption.
*�� a.Caller��s RO-DATA
*�� b. Logging Bandwidth
*
* PARAMETERS
* mod_id: [IN] Module id
* fmt: [IN] The format string. Please refer to print function of C standard library.
* RETURNS
* NONE
* NOTE
*
******************************************************************************/
extern void kal_prompt_trace(module_type mod_id, const kal_char *fmt, ...);
extern void tst_sys_init_trace(const kal_char *info);
extern void tst_sys_trace(kal_char *info);
extern void tst_sysfatal_trace(kal_char *info);
extern kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption);
#define kal_bootup_print tst_sys_init_trace
#else
#ifdef __TST_TRACE_EMPTY_FUNCTION__
static __inline void kal_prompt_trace(module_type mod_id, const kal_char *fmt, ...)
{
return ;
}
static __inline void tst_sys_init_trace(const kal_char *info)
{
return ;
}
static __inline void tst_sys_trace(kal_char *info)
{
return ;
}
static __inline void tst_sysfatal_trace(kal_char *info)
{
return ;
}
static __inline kal_int32 tst_trace_check_ps_filter_off(trace_class_enum trc_class, kal_uint32 *module_id, kal_uint32 supportOption)
{
return 0;
}
#else
#define kal_prompt_trace(...)
#define tst_sys_init_trace(...)
#define tst_sys_trace(...)
#define tst_sysfatal_trace(...)
#define tst_trace_check_ps_filter_off(...)
#endif
#endif //#ifdef __TST_MODULE__
typedef void (*TST_VC_CallBack)(const kal_uint8 *pData, kal_uint32 nLen);
typedef void (*TST_String_Inject_CB)(kal_uint32 index, kal_uint8 *pData);
/*
* tst_virtual_channel_id:
* regiester new virtual channel here and remake tst
*/
typedef enum
{
TVCI_GPS_LOGGING,
TVCI_DNT_L2COPRO_LOGGING,
TVCI_CATCHER_POLLING,
TVCI_GDB_COMM,
TVCI_AST_LOGGING,
TVCI_MINI_LOG,
TVCI_VM_LOGGING,
TVCI_BTT,
TVCI_LAST_ID
}
tst_virtual_channel_id;
#define MAX_VC_RESPONSE_LEN (1023)
kal_bool tst_vc_register_channel(tst_virtual_channel_id channel_id, TST_VC_CallBack fnCmd);
kal_bool tst_vc_response(tst_virtual_channel_id channel_id, const kal_uint8 *pData, kal_uint16 len);
#define TVCI_CREATE_FILE 0x24540001
#define TVCI_CLOSE_FILE 0x24540002
void tst_log_with_offset_single_gpd(sap_type desc_SAP, sap_type raw_data_sap, kal_uint32 msg_index, const char *arg_type, kal_uint32 offset, kal_uint32 *dl_gpd);
kal_bool tst_save_assert_bypass_trace(kal_char *info);
#ifdef __cplusplus
}
#endif
#endif /* __LTE_RAT__ */
#endif /* _KAL_TRACE_H */