From: Mathieu Poirier Date: Tue, 3 May 2016 19:26:08 +0000 (-0600) Subject: perf tools: new naming convention for openCSD X-Git-Tag: firefly_0821_release~176^2~4^2~41^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cda8131df1fae7efc2d56967b2cc45ddf52c85b9;p=firefly-linux-kernel-4.4.55.git perf tools: new naming convention for openCSD The naming convention for the openCSD API and header files was changed so that using it was easier. Headers went from "rctdl_xyz.h" to "opencsd_xyz.h" while internal symbol from "rctdl_" to "ocsd_". Signed-off-by: Mathieu Poirier --- diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c index 2fef19922fdd..2cc7ccd3c22a 100644 --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c @@ -21,8 +21,8 @@ #include "cs-etm-decoder.h" #include "../util.h" -#include "c_api/rctdl_c_api.h" -#include "rctdl_if_types.h" +#include "c_api/opencsd_c_api.h" +#include "ocsd_if_types.h" #include "etmv4/trc_pkt_types_etmv4.h" #define MAX_BUFFER 1024 @@ -35,7 +35,7 @@ struct cs_etm_decoder dcd_tree_handle_t dcd_tree; void (*packet_printer)(const char *); cs_etm_mem_cb_type mem_access; - rctdl_datapath_resp_t prev_return; + ocsd_datapath_resp_t prev_return; size_t prev_processed; bool trace_on; bool discontinuity; @@ -47,8 +47,8 @@ struct cs_etm_decoder }; static uint32_t cs_etm_decoder__mem_access(const void *context, - const rctdl_vaddr_t address, - const rctdl_mem_space_acc_t mem_space, + const ocsd_vaddr_t address, + const ocsd_mem_space_acc_t mem_space, const uint32_t req_size, uint8_t *buffer) { @@ -59,7 +59,7 @@ static uint32_t cs_etm_decoder__mem_access(const void *context, } static int cs_etm_decoder__gen_etmv4_config(struct cs_etm_trace_params *params, - rctdl_etmv4_cfg *config) + ocsd_etmv4_cfg *config) { config->reg_configr = params->reg_configr; config->reg_traceidr = params->reg_traceidr; @@ -100,7 +100,9 @@ int cs_etm_decoder__flush(struct cs_etm_decoder *decoder) return cs_etm_decoder__flush_packet(decoder); } -static int cs_etm_decoder__buffer_packet(struct cs_etm_decoder *decoder, const rctdl_generic_trace_elem *elem, enum cs_etm_sample_type sample_type) +static int cs_etm_decoder__buffer_packet(struct cs_etm_decoder *decoder, + const ocsd_generic_trace_elem *elem, + enum cs_etm_sample_type sample_type) { int err = 0; uint32_t et = 0; @@ -149,48 +151,48 @@ static int cs_etm_decoder__mark_exception_return(struct cs_etm_decoder *decoder) return err; } -static rctdl_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer( +static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer( const void *context, - const rctdl_trc_index_t indx, + const ocsd_trc_index_t indx, const uint8_t trace_chan_id, - const rctdl_generic_trace_elem *elem) + const ocsd_generic_trace_elem *elem) { - rctdl_datapath_resp_t resp = RCTDL_RESP_CONT; + ocsd_datapath_resp_t resp = OCSD_RESP_CONT; struct cs_etm_decoder *decoder = (struct cs_etm_decoder *) context; (void) indx; (void) trace_chan_id; switch (elem->elem_type) { - case RCTDL_GEN_TRC_ELEM_UNKNOWN: + case OCSD_GEN_TRC_ELEM_UNKNOWN: break; - case RCTDL_GEN_TRC_ELEM_NO_SYNC: + case OCSD_GEN_TRC_ELEM_NO_SYNC: decoder->trace_on = false; break; - case RCTDL_GEN_TRC_ELEM_TRACE_ON: + case OCSD_GEN_TRC_ELEM_TRACE_ON: decoder->trace_on = true; break; - //case RCTDL_GEN_TRC_ELEM_TRACE_OVERFLOW: + //case OCSD_GEN_TRC_ELEM_TRACE_OVERFLOW: //decoder->trace_on = false; //decoder->discontinuity = true; //break; - case RCTDL_GEN_TRC_ELEM_INSTR_RANGE: + case OCSD_GEN_TRC_ELEM_INSTR_RANGE: cs_etm_decoder__buffer_packet(decoder,elem, CS_ETM_RANGE); - resp = RCTDL_RESP_WAIT; + resp = OCSD_RESP_WAIT; break; - case RCTDL_GEN_TRC_ELEM_EXCEPTION: + case OCSD_GEN_TRC_ELEM_EXCEPTION: cs_etm_decoder__mark_exception(decoder); break; - case RCTDL_GEN_TRC_ELEM_EXCEPTION_RET: + case OCSD_GEN_TRC_ELEM_EXCEPTION_RET: cs_etm_decoder__mark_exception_return(decoder); break; - case RCTDL_GEN_TRC_ELEM_PE_CONTEXT: - case RCTDL_GEN_TRC_ELEM_EO_TRACE: - case RCTDL_GEN_TRC_ELEM_ADDR_NACC: - case RCTDL_GEN_TRC_ELEM_TIMESTAMP: - case RCTDL_GEN_TRC_ELEM_CYCLE_COUNT: - //case RCTDL_GEN_TRC_ELEM_TS_WITH_CC: - case RCTDL_GEN_TRC_ELEM_EVENT: + case OCSD_GEN_TRC_ELEM_PE_CONTEXT: + case OCSD_GEN_TRC_ELEM_EO_TRACE: + case OCSD_GEN_TRC_ELEM_ADDR_NACC: + case OCSD_GEN_TRC_ELEM_TIMESTAMP: + case OCSD_GEN_TRC_ELEM_CYCLE_COUNT: + //case OCSD_GEN_TRC_ELEM_TS_WITH_CC: + case OCSD_GEN_TRC_ELEM_EVENT: default: break; } @@ -200,14 +202,14 @@ static rctdl_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer( return resp; } -static rctdl_datapath_resp_t cs_etm_decoder__etmv4i_packet_printer( +static ocsd_datapath_resp_t cs_etm_decoder__etmv4i_packet_printer( const void *context, - const rctdl_datapath_op_t op, - const rctdl_trc_index_t indx, - const rctdl_etmv4_i_pkt *pkt) + const ocsd_datapath_op_t op, + const ocsd_trc_index_t indx, + const ocsd_etmv4_i_pkt *pkt) { const size_t PACKET_STR_LEN = 1024; - rctdl_datapath_resp_t ret = RCTDL_RESP_CONT; + ocsd_datapath_resp_t ret = OCSD_RESP_CONT; char packet_str[PACKET_STR_LEN]; size_t offset; struct cs_etm_decoder *decoder = (struct cs_etm_decoder *) context; @@ -216,18 +218,18 @@ static rctdl_datapath_resp_t cs_etm_decoder__etmv4i_packet_printer( offset = strlen(packet_str); switch(op) { - case RCTDL_OP_DATA: - if (rctdl_pkt_str(RCTDL_PROTOCOL_ETMV4I, + case OCSD_OP_DATA: + if (ocsd_pkt_str(OCSD_PROTOCOL_ETMV4I, (void *)pkt, packet_str+offset, - PACKET_STR_LEN-offset) != RCTDL_OK) - ret = RCTDL_RESP_FATAL_INVALID_PARAM; + PACKET_STR_LEN-offset) != OCSD_OK) + ret = OCSD_RESP_FATAL_INVALID_PARAM; break; - case RCTDL_OP_EOT: + case OCSD_OP_EOT: sprintf(packet_str,"**** END OF TRACE ****\n"); break; - case RCTDL_OP_FLUSH: - case RCTDL_OP_RESET: + case OCSD_OP_FLUSH: + case OCSD_OP_RESET: default: break; } @@ -241,7 +243,7 @@ static int cs_etm_decoder__create_etmv4i_packet_printer(struct cs_etm_decoder_pa struct cs_etm_decoder *decoder) { - rctdl_etmv4_cfg trace_config; + ocsd_etmv4_cfg trace_config; int ret = 0; if (d_params->packet_printer == NULL) @@ -254,7 +256,7 @@ static int cs_etm_decoder__create_etmv4i_packet_printer(struct cs_etm_decoder_pa decoder->packet_printer = d_params->packet_printer; - ret = rctdl_dt_create_etmv4i_pkt_proc(decoder->dcd_tree, + ret = ocsd_dt_create_etmv4i_pkt_proc(decoder->dcd_tree, &trace_config, cs_etm_decoder__etmv4i_packet_printer, decoder); @@ -265,7 +267,7 @@ static int cs_etm_decoder__create_etmv4i_packet_printer(struct cs_etm_decoder_pa static int cs_etm_decoder__create_etmv4i_packet_decoder(struct cs_etm_decoder_params *d_params, struct cs_etm_trace_params *t_params, struct cs_etm_decoder *decoder) { - rctdl_etmv4_cfg trace_config; + ocsd_etmv4_cfg trace_config; int ret = 0; decoder->packet_printer = d_params->packet_printer; @@ -274,12 +276,12 @@ static int cs_etm_decoder__create_etmv4i_packet_decoder(struct cs_etm_decoder_pa if (ret != 0) return -1; - ret = rctdl_dt_create_etmv4i_decoder(decoder->dcd_tree,&trace_config); + ret = ocsd_dt_create_etmv4i_decoder(decoder->dcd_tree,&trace_config); - if (ret != RCTDL_OK) + if (ret != OCSD_OK) return -1; - ret = rctdl_dt_set_gen_elem_outfn(decoder->dcd_tree, + ret = ocsd_dt_set_gen_elem_outfn(decoder->dcd_tree, cs_etm_decoder__gen_trace_elem_printer, decoder); return ret; } @@ -289,10 +291,10 @@ int cs_etm_decoder__add_mem_access_cb(struct cs_etm_decoder *decoder, uint64_t a int err; decoder->mem_access = cb_func; - err = rctdl_dt_add_callback_mem_acc(decoder->dcd_tree, + err = ocsd_dt_add_callback_mem_acc(decoder->dcd_tree, address, address+len-1, - RCTDL_MEM_SPACE_ANY, + OCSD_MEM_SPACE_ANY, cs_etm_decoder__mem_access, decoder); return err; @@ -314,10 +316,10 @@ int cs_etm_decoder__add_bin_file(struct cs_etm_decoder *decoder, uint64_t offset region.file_offset = offset; region.start_address = address; region.region_size = len; - err = rctdl_dt_add_binfile_region_mem_acc(decoder->dcd_tree, + err = ocsd_dt_add_binfile_region_mem_acc(decoder->dcd_tree, ®ion, 1, - RCTDL_MEM_SPACE_ANY, + OCSD_MEM_SPACE_ANY, fname); return err; @@ -330,7 +332,7 @@ const struct cs_etm_state *cs_etm_decoder__process_data_block(struct cs_etm_deco size_t *consumed) { int ret = 0; - rctdl_datapath_resp_t dp_ret = decoder->prev_return; + ocsd_datapath_resp_t dp_ret = decoder->prev_return; size_t processed = 0; if (decoder->packet_count > 0) { @@ -341,19 +343,19 @@ const struct cs_etm_state *cs_etm_decoder__process_data_block(struct cs_etm_deco while ((processed < len) && (0 == ret)) { - if (RCTDL_DATA_RESP_IS_CONT(dp_ret)) { + if (OCSD_DATA_RESP_IS_CONT(dp_ret)) { uint32_t count; - dp_ret = rctdl_dt_process_data(decoder->dcd_tree, - RCTDL_OP_DATA, + dp_ret = ocsd_dt_process_data(decoder->dcd_tree, + OCSD_OP_DATA, indx+processed, len - processed, &buf[processed], &count); processed += count; - } else if (RCTDL_DATA_RESP_IS_WAIT(dp_ret)) { - dp_ret = rctdl_dt_process_data(decoder->dcd_tree, - RCTDL_OP_FLUSH, + } else if (OCSD_DATA_RESP_IS_WAIT(dp_ret)) { + dp_ret = ocsd_dt_process_data(decoder->dcd_tree, + OCSD_OP_FLUSH, 0, 0, NULL, @@ -363,12 +365,12 @@ const struct cs_etm_state *cs_etm_decoder__process_data_block(struct cs_etm_deco ret = -1; } } - if (RCTDL_DATA_RESP_IS_WAIT(dp_ret)) { - if (RCTDL_DATA_RESP_IS_CONT(decoder->prev_return)) { + if (OCSD_DATA_RESP_IS_WAIT(dp_ret)) { + if (OCSD_DATA_RESP_IS_CONT(decoder->prev_return)) { decoder->prev_processed = processed; } processed = 0; - } else if (RCTDL_DATA_RESP_IS_WAIT(decoder->prev_return)) { + } else if (OCSD_DATA_RESP_IS_WAIT(decoder->prev_return)) { processed = decoder->prev_processed; decoder->prev_processed = 0; } @@ -413,7 +415,7 @@ static void cs_etm_decoder__clear_buffer(struct cs_etm_decoder *decoder) struct cs_etm_decoder *cs_etm_decoder__new(uint32_t num_cpu, struct cs_etm_decoder_params *d_params, struct cs_etm_trace_params t_params[]) { struct cs_etm_decoder *decoder; - rctdl_dcd_tree_src_t format; + ocsd_dcd_tree_src_t format; uint32_t flags; int ret; size_t i; @@ -429,17 +431,17 @@ struct cs_etm_decoder *cs_etm_decoder__new(uint32_t num_cpu, struct cs_etm_decod } decoder->state.data = d_params->data; - decoder->prev_return = RCTDL_RESP_CONT; + decoder->prev_return = OCSD_RESP_CONT; cs_etm_decoder__clear_buffer(decoder); - format = (d_params->formatted ? RCTDL_TRC_SRC_FRAME_FORMATTED : - RCTDL_TRC_SRC_SINGLE); + format = (d_params->formatted ? OCSD_TRC_SRC_FRAME_FORMATTED : + OCSD_TRC_SRC_SINGLE); flags = 0; - flags |= (d_params->fsyncs ? RCTDL_DFRMTR_HAS_FSYNCS : 0); - flags |= (d_params->hsyncs ? RCTDL_DFRMTR_HAS_HSYNCS : 0); - flags |= (d_params->frame_aligned ? RCTDL_DFRMTR_FRAME_MEM_ALIGN : 0); + flags |= (d_params->fsyncs ? OCSD_DFRMTR_HAS_FSYNCS : 0); + flags |= (d_params->hsyncs ? OCSD_DFRMTR_HAS_HSYNCS : 0); + flags |= (d_params->frame_aligned ? OCSD_DFRMTR_FRAME_MEM_ALIGN : 0); /* Create decode tree for the data source */ - decoder->dcd_tree = rctdl_create_dcd_tree(format,flags); + decoder->dcd_tree = ocsd_create_dcd_tree(format,flags); if (decoder->dcd_tree == 0) { goto err_free_decoder; @@ -470,7 +472,7 @@ struct cs_etm_decoder *cs_etm_decoder__new(uint32_t num_cpu, struct cs_etm_decod return decoder; err_free_decoder_tree: - rctdl_destroy_dcd_tree(decoder->dcd_tree); + ocsd_destroy_dcd_tree(decoder->dcd_tree); err_free_decoder: free(decoder); return NULL; @@ -481,7 +483,7 @@ void cs_etm_decoder__free(struct cs_etm_decoder *decoder) { if (decoder == NULL) return; - rctdl_destroy_dcd_tree(decoder->dcd_tree); + ocsd_destroy_dcd_tree(decoder->dcd_tree); decoder->dcd_tree = NULL; free(decoder);