void bsp_log_bin_ind(s32 str_id, void* ind_data, u32 ind_data_size)
{
    u32 pbuf = 0;
    u32 buflen = 0;
    bsp_om_head_s        *bsp_om_header  = NULL;
    log_ind_enter_cnt ++;

    if((NULL == ind_data) ||(0 == ind_data_size) || (ind_data_size > BSP_DIAG_IND_DATA_MAX_LEN))
    {
        return ;
    }

    if( TRUE != bsp_om_get_hso_conn_flag())
    {
        return ;
    }

    buflen = sizeof(bsp_socp_head_s)+sizeof(bsp_om_head_s)+ind_data_size ;

    /*获取buf*/
    if(bsp_om_buf_sem_take())
    {
        return;
    }
    pbuf = bsp_om_get_buf(BSP_OM_SOCP_BUF_TYPE,buflen);

    if(0 == pbuf)
    {
        bsp_om_buf_sem_give();
        return ;
    }

    /*打包SOCP头*/
    PACKET_BSP_SOCP_HEAD(pbuf);

    bsp_om_header = (bsp_om_head_s*)(pbuf + sizeof(bsp_socp_head_s));

    bsp_om_header->om_id            = (BSP_STRU_ID_28_31_GROUP_MSP << 28) | (BSP_STRU_ID_16_23_BSP_CMD_IND << 16) |(u16)str_id;

    memcpy((u8*)bsp_om_header +sizeof(bsp_om_head_s),ind_data,ind_data_size);

    if(BSP_OK != bsp_om_into_send_list(pbuf,buflen))
    {
        bsp_om_free_buf(pbuf,buflen);
    }

    bsp_om_buf_sem_give();
    log_ind_exit_cnt ++;
}
Exemplo n.º 2
0
void sysview_trace_packet(u8 *trace_buf,u32 buf_size,bsp_sysview_type_e data_type)
{
    bsp_om_head_s        *bsp_om_header  = NULL;
    BSP_SYS_VIEW_HEADER_STRU     *sysview_info_header = NULL;

    PACKET_BSP_SOCP_HEAD(trace_buf);;

    bsp_om_header = (bsp_om_head_s*)(trace_buf + sizeof(bsp_socp_head_s));
    sysview_info_header = (BSP_SYS_VIEW_HEADER_STRU *)(trace_buf + sizeof(bsp_socp_head_s) + sizeof(bsp_om_head_s));

    bsp_om_header->data_size        =buf_size - sizeof(bsp_socp_head_s)- sizeof(bsp_om_head_s);
    /*lint -save -e648*/
    if(BSP_SYSVIEW_TASK_INFO == data_type)
    {
        bsp_om_header->om_id            = (BSP_STRU_ID_28_31_GROUP_BSP << 28) | (BSP_STRU_ID_16_23_BSP_TASK << 16)|CMD_BSP_SYSVIEW_IND_ACORE;
        sysview_info_header->sn              = g_om_global_info.task_info_sn++;
    }
    else if(BSP_SYSVIEW_INT_LOCK_INFO== data_type)
    {
        bsp_om_header->om_id            = (BSP_STRU_ID_28_31_GROUP_BSP << 28) | (BSP_STRU_ID_16_23_BSP_INT_LOCK << 16)|CMD_BSP_SYSVIEW_IND_ACORE;
        sysview_info_header->sn              = g_om_global_info.int_lock_info_sn++;
    }
    else if(BSP_SYSVIEW_MEM_TRACE== data_type)
    {
        bsp_om_header->om_id            = (BSP_STRU_ID_28_31_GROUP_BSP << 28) | (BSP_STRU_ID_16_23_BSP_MEM<< 16)|CMD_BSP_SYSVIEW_IND_ACORE;
        sysview_info_header->sn              = g_om_global_info.mem_info_sn++;
    }
    else if(BSP_SYSVIEW_CPU_INFO== data_type)
    {
        bsp_om_header->om_id            = (BSP_STRU_ID_28_31_GROUP_BSP << 28) | (BSP_STRU_ID_16_23_BSP_CPU<< 16)|CMD_BSP_SYSVIEW_IND_ACORE;
        sysview_info_header->sn              = g_om_global_info.cpu_info_sn++;
    }
    else
    {
        /* 内部接口,由入参保证*/
    }
    /*lint -restore +e648*/
    return ;
}
void bsp_log_header_packet(bsp_module_e mod_id,bsp_log_level_e log_level,u8 *print_buf,u32 buf_size)
{

    bsp_om_head_s        *bsp_om_header  = NULL;
    bsp_trace_txt_s  *print_header   = NULL;

   /*打包SOCP头*/
    PACKET_BSP_SOCP_HEAD(print_buf);

    bsp_om_header = (bsp_om_head_s *)(print_buf + sizeof(bsp_socp_head_s));

    /*lint -save -e648*/
    bsp_om_header->om_id            = ((BSP_STRU_ID_28_31_GROUP_BSP << 28) | (BSP_STRU_ID_16_23_BSP_PRINT << 16));
    /*lint -restore +e648*/
    bsp_om_header->data_size        = buf_size - sizeof(bsp_socp_head_s)-sizeof(bsp_om_head_s);

    print_header = ( bsp_trace_txt_s  *)(print_buf + sizeof(bsp_socp_head_s) + sizeof(bsp_om_head_s));
    print_header->mod_id            = mod_id;
    print_header->level             = log_level;
    print_header->log_sn            = g_om_global_info.print_sn++;

    return ;

}