Hi,
Thank you for your answers.
1) I updated to the acme's "perf/core" branch, and it's still not solved. I still don't get any events for my recorded traces, except if
i record "uname -r".
2) I'm trying to integrate directly with OpenCSD, and decode my own traces. I took the "perf.data" file from the HOWTO.md,
which contains a valid trace according to the HOWTO, and extracted the trace itself from the perf file. I have a raw trace file
without any perf related data and structures. I'm trying to open my own decoder, and decode instructions, after taking examples
from "tools/perf/util/cs-etm-decoder/cs-etm-decoder.c", "tools/perf/util/cs-etm.c". There is no documentation on how to use OpenCSD
as a library, nothing(full, not partial like the docs in the repo) that i found at least.
This is a very short example of what i do(same order that they appear in the code) to create a dcd tree, and create a decoder, ignore the error
validation right now, they are there, i'm making sure this message is short as possible:
/* Open a decoder tree */
flags |= OCSD_DFRMTR_FRAME_MEM_ALIGN;
flags |= OCSD_DFRMTR_RESET_ON_4X_FSYNC;
decoder_tree = ocsd_create_dcd_tree(OCSD_TRC_SRC_FRAME_FORMATTED,
OCSD_DFRMTR_RESET_ON_4X_FSYNC);
/* Create a __full__ decoder */
config.arch_ver = ARCH_V8;
config.core_prof = profile_CortexA;
config.reg_traceidr = 18; /* specific hard coded trace id to be indentical to perf, just to check if it works */
ocsd_err = ocsd_dt_create_decoder(decoder_tree, OCSD_BUILTIN_DCD_ETMV4I,
OCSD_CREATE_FLG_FULL_DECODER, &config, &csid);
/* Register my element callback */
ocsd_err = ocsd_dt_set_gen_elem_outfn(decoder_tree,
decoder_callback, NULL);
Now i mmap() my trace file.. and do the following:
/* Reset the decoder */
val = ocsd_dt_process_data(dcd_tree, OCSD_OP_RESET, 0, 0, NULL, NULL);
if (OCSD_DATA_RESP_IS_FATAL(val)) {
return -1;
}
From here now, i call ocsd_dt_process_data() to fully decode the trace, just like the code in cs_etm_decoder__process_data_block() in "tools/perf/util/cs-etm-decoder/cs-etm-decoder.c:518".
The problem is, the resetting of the decoder fails fatally in the "OCSD_DATA_RESP_IS_FATAL" macro with the error: "OCSD_RESP_FATAL_NOT_INIT". Not sure what i did wrong, as i followed
the exact code like in perf.
Any suggestions?
Thank you!
Cheers,
Mike.