Hi Rob,
On Mon, Jan 14, 2019 at 04:50:39PM +0000, Robert Walker wrote:
On 13/01/2019 07:14, Leo Yan wrote:
[...]
diff --git a/tools/perf/util/cs-etm.h b/tools/perf/util/cs-etm.h index 5d70d10f3907..9d0abfa261bb 100644 --- a/tools/perf/util/cs-etm.h +++ b/tools/perf/util/cs-etm.h @@ -53,6 +53,47 @@ enum { CS_ETMV4_PRIV_MAX, }; +/* ETMv3 exception number */ +enum {
- CS_ETMV3_EXC_NONE,
- CS_ETMV3_EXC_DEBUG_HALT,
- CS_ETMV3_EXC_SMC,
- CS_ETMV3_EXC_HYP,
- CS_ETMV3_EXC_ASYNC_DATA_ABORT,
- CS_ETMV3_EXC_JAZELLE_THUMBEE,
- CS_ETMV3_EXC_RESERVED1,
- CS_ETMV3_EXC_RESERVED2,
- CS_ETMV3_EXC_PE_RESET,
- CS_ETMV3_EXC_UNDEFINED_INSTR,
- CS_ETMV3_EXC_SVC,
- CS_ETMV3_EXC_PREFETCH_ABORT,
- CS_ETMV3_EXC_DATA_FAULT,
- CS_ETMV3_EXC_GENERIC,
- CS_ETMV3_EXC_IRQ,
- CS_ETMV3_EXC_FIQ,
+};
+/* ETMv4 exception number */ +enum {
- CS_ETMV4_EXC_RESET,
- CS_ETMV4_EXC_DEBUG_HALT,
- CS_ETMV4_EXC_CALL,
- CS_ETMV4_EXC_TRAP,
- CS_ETMV4_EXC_SYSTEM_ERROR,
- CS_ETMV4_EXC_RESERVED1,
- CS_ETMV4_EXC_INST_DEBUG,
- CS_ETMV4_EXC_DATA_DEBUG,
- CS_ETMV4_EXC_RESERVED2,
- CS_ETMV4_EXC_RESERVED3,
- CS_ETMV4_EXC_ALIGNMENT,
- CS_ETMV4_EXC_INST_FAULT,
- CS_ETMV4_EXC_DATA_FAULT,
- CS_ETMV4_EXC_RESERVED4,
- CS_ETMV4_EXC_IRQ,
- CS_ETMV4_EXC_FIQ,
- CS_ETMV4_EXC_END = 31,
+};
I assume the values in these enums match the values produced by the ETM hardware? If so, it would be good to have a comment saying so, possibly with a link to the document, and maybe also assign fixed values to each. This will guard against anyone changing the behaviour by re-ordering / editing these.
Yes, in "ARM Embedded Trace Macrocell Architecture Specification", section 'Packets associated with exceptions' it defines related numbers. Will add comments for this.
Will change to use fixed values, it looks better to me also.
- /* RB tree for quick conversion between traceID and metadata pointers */ struct intlist *traceid_list;
Apart from the comment above, looks good to me.
Reviewed-by: Robert Walker robert.walker@arm.com
(or whatever tag is appropriate here)
Thanks a lot for reviewing.