-Moves ocsd_if_version.h into include/opencsd and adds to headers used
as part of installation.
-Fixes bug in snapshot reader library used by test programs to handle
'offset' parameter in [dump] sections correctly.
--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK
This patchset adds more information about the final instuction in the
Instruction Range generic packet.
i) A flag is set if the last instruction is conditional [last_instr_cond].
ii) for A32/T32 ISA, the instruction subtype will be set to 'Implied Return'
[OCSD_S_INSTR_V7_IMPLIED_RET] if it is one of the instructions:
mov pc,lr
bx r14
pop {...,pc}
ldr pc,[sp], #offset
These are used by the CPU return predictor and in general by compilers
when a return is required.
The patchset also removes the uint32_t casts in the version #define
OCSD_VER_NUM to enable correct use with pre-processor.
Mike Leach (3):
opencsd: Generic output packet - add additional instruction info
opencsd: docs: Update documents for new generic packet field
opencsd: Update README etc for version 0.10.0
README.md | 6 +++--
decoder/docs/doxygen_config.dox | 2 +-
decoder/docs/prog_guide/prog_guide_generic_pkts.md | 3 ++-
decoder/include/common/trc_gen_elem.h | 1 +
.../include/opencsd/etmv4/trc_pkt_decode_etmv4i.h | 2 ++
decoder/include/opencsd/ocsd_if_types.h | 1 +
decoder/include/opencsd/ocsd_if_version.h | 8 +++---
decoder/include/opencsd/trc_gen_elem_types.h | 1 +
decoder/source/etmv3/trc_pkt_decode_etmv3.cpp | 1 +
decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp | 29 ++++++++++------------
decoder/source/i_dec/trc_i_decode.cpp | 1 +
decoder/source/i_dec/trc_idec_arminst.cpp | 16 ++++++++++++
decoder/source/ocsd_dcd_tree.cpp | 1 -
decoder/source/ptm/trc_pkt_decode_ptm.cpp | 2 ++
decoder/source/trc_gen_elem.cpp | 5 +++-
15 files changed, 53 insertions(+), 26 deletions(-)
--
2.14.2
Hi Mathieu, Mike,
[ + CoreSight list ]
When reviewed Andi's patch 'tools, perf, script: Add --call-trace and
--call-ret-trace' [1], I found after applying this patch with
CoreSight, perf fails to output two fields: one is missing to output
the sample flags (e.g. 'call', 'return', 'jmp', etc) [2], another
missing is failed to output the symbols [3]. The cause for the issues
is CoreSight doesn't set sample flags and simply set it to zero [4].
If I understand correctly (Mathieu also mentioned to me at connect),
I think before you guys have awared for this. So want to check if you
have existed fixing for this in case I am doing duplicate works at
here? :) Or there have some discussion and known issues so cannot
enable sample flags before?
I did some investigation for these, CoreSight can set partial sample
flags for A64 branch instructions with packet infos:
- ocsd_generic_trace_elem::last_i_type can be used to check if the
instruction is immediate branch instruction or indirect branch
instruction;
- ocsd_generic_trace_elem::last_i_subtype can be used to distinguish
if it's link branch instruction (OCSD_S_INSTR_BR_LINK), if it's link
branch instruction then this means this branch insturction is for
function call;
if it's return branch instruction (OCSD_S_INSTR_V8_RET), then it's
return instruction;
Otherwise (OCSD_S_INSTR_NONE), it's a simple branch instruction
within the function.
But there still have several things are not clear for me:
- How can we distinguish the exception is for system call, or
interrupt. The reason is we can see Intel-pt set sample flags for
different values for different exception types:
PERF_IP_FLAG_INTERRUPT
PERF_IP_FLAG_SYSCALLRET
I think we might can use ocsd_generic_trace_elem::exception_number
to distinguish the different exception types, but I don't find any
doc to clear define for this value.
- I don't know if there have any info or hints in CoreSight packet can
be used to indicate the branch is conditional branch or not. For
Intel-pt, it can set the conditional branch instruction with flag:
PERF_IP_FLAG_CONDITIONAL.
- I understand it's low priority to support A32 and T32 instructions,
but just note here I also don't have no idea for this part.
Could you give some suggestion and guidance for this? Thanks in
advance.
Thanks,
Leo Yan
[1] https://lore.kernel.org/patchwork/patch/987916/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/too…
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/too…
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/too…