From: Jie Gan <jie.gan@oss.qualcomm.com>
To: Yeoreum Yun <yeoreum.yun@arm.com>,
coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: suzuki.poulose@arm.com, mike.leach@arm.com,
james.clark@linaro.org, alexander.shishkin@linux.intel.com,
leo.yan@arm.com
Subject: Re: [PATCH v3 1/5] coresight: etm4x: introduce struct etm4_caps
Date: Mon, 13 Apr 2026 10:58:35 +0800 [thread overview]
Message-ID: <6ed0ee60-caa2-4a76-9e01-5d2b8c9af701@oss.qualcomm.com> (raw)
In-Reply-To: <20260412175506.412301-2-yeoreum.yun@arm.com>
Hi Yeoreum,
On 4/13/2026 1:55 AM, Yeoreum Yun wrote:
> introduce struct etm4_caps to describe ETMv4 capabilities
> and move capabilities information into it.
>
> Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
> ---
> .../coresight/coresight-etm4x-core.c | 234 +++++++++---------
> .../coresight/coresight-etm4x-sysfs.c | 190 ++++++++------
> drivers/hwtracing/coresight/coresight-etm4x.h | 175 ++++++-------
> 3 files changed, 327 insertions(+), 272 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c
> index d565a73f0042..6443f3717b37 100644
> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c
> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c
<...>
> +/**
> + * struct etmv4_caps - specifics ETM capabilities
> + * @nr_pe: The number of processing entity available for tracing.
> + * @nr_pe_cmp: The number of processing entity comparator inputs that are
> + * available for tracing.
> + * @nr_addr_cmp:Number of pairs of address comparators available
> + * as found in ETMIDR4 0-3.
> + * @nr_cntr: Number of counters as found in ETMIDR5 bit 28-30.
> + * @nr_ext_inp: Number of external input.
> + * @numcidc: Number of contextID comparators.
@numextinsel:
> + * @numvmidc: Number of VMID comparators.
> + * @nrseqstate: The number of sequencer states that are implemented.
> + * @nr_event: Indicates how many events the trace unit support.
> + * @nr_resource:The number of resource selection pairs available for tracing.
> + * @nr_ss_cmp: Number of single-shot comparator controls that are available.
> + * @trcid_size: Indicates the trace ID width.
> + * @ts_size: Global timestamp size field.
> + * @ctxid_size: Size of the context ID field to consider.
> + * @vmid_size: Size of the VM ID comparator to consider.
> + * @ccsize: Indicates the size of the cycle counter in bits.
> + * @ccitmin: minimum value that can be programmed in
> + * @s_ex_level: In secure state, indicates whether instruction tracing is
> + * supported for the corresponding Exception level.
> + * @ns_ex_level:In non-secure state, indicates whether instruction tracing is
> + * supported for the corresponding Exception level.
> + * @q_support: Q element support characteristics.
> + * @os_lock_model: OSLock model.
> + * @instrp0: Tracing of load and store instructions
> + * as P0 elements is supported.
> + * @q_filt: Q element filtering support, if Q elements are supported.
> + * @trcbb: Indicates if the trace unit supports branch broadcast tracing.
> + * @trccond: If the trace unit supports conditional
> + * instruction tracing.
> + * @retstack: Indicates if the implementation supports a return stack.
> + * @trccci: Indicates if the trace unit supports cycle counting
> + * for instruction.
> + * @trc_error: Whether a trace unit can trace a system
> + * error exception.
> + * @syncpr: Indicates if an implementation has a fixed
> + * synchronization period.
> + * @stallctl: If functionality that prevents trace unit buffer overflows
> + * is available.
> + * @sysstall: Does the system support stall control of the PE?
> + * @nooverflow: Indicate if overflow prevention is supported.
> + * @atbtrig: If the implementation can support ATB triggers
> + * @lpoverride: If the implementation can support low-power state over.
> + * @skip_power_up: Indicates if an implementation can skip powering up
> + * the trace unit.
> + */
> +struct etmv4_caps {
> + u8 nr_pe;
> + u8 nr_pe_cmp;
> + u8 nr_addr_cmp;
> + u8 nr_cntr;
> + u8 nr_ext_inp;
> + u8 numcidc;
> + u8 numextinsel;
missed kernel_doc.
Thanks,
Jie
> + u8 numvmidc;
> + u8 nrseqstate;
> + u8 nr_event;
> + u8 nr_resource;
> + u8 nr_ss_cmp;
> + u8 trcid_size;
> + u8 ts_size;
> + u8 ctxid_size;
> + u8 vmid_size;
> + u8 ccsize;
> + u16 ccitmin;
> + u8 s_ex_level;
> + u8 ns_ex_level;
> + u8 q_support;
> + u8 os_lock_model;
> + bool instrp0 : 1;
> + bool q_filt : 1;
> + bool trcbb : 1;
> + bool trccond : 1;
> + bool retstack : 1;
> + bool trccci : 1;
> + bool trc_error : 1;
> + bool syncpr : 1;
> + bool stallctl : 1;
> + bool sysstall : 1;
> + bool nooverflow : 1;
> + bool atbtrig : 1;
> + bool lpoverride : 1;
> + bool skip_power_up : 1;
> +};
> +
> /**
> * struct etmv4_config - configuration information related to an ETMv4
> * @mode: Controls various modes supported by this ETM.
> @@ -819,8 +907,8 @@ enum etm_impdef_type {
> * @cfg: Controls the tracing options.
> * @eventctrl0: Controls the tracing of arbitrary events.
> * @eventctrl1: Controls the behavior of the events that @event_ctrl0 selects.
> - * @stallctl: If functionality that prevents trace unit buffer overflows
> - * is available.
> + * @stall_ctrl: Enables trace unit functionality that prevents trace
> + * unit buffer overflows.
> * @ts_ctrl: Controls the insertion of global timestamps in the
> * trace streams.
> * @syncfreq: Controls how often trace synchronization requests occur.
> @@ -971,61 +1059,17 @@ struct etmv4_save_state {
> * @mode: This tracer's mode, i.e sysFS, Perf or disabled.
> * @cpu: The cpu this component is affined to.
> * @arch: ETM architecture version.
> - * @nr_pe: The number of processing entity available for tracing.
> - * @nr_pe_cmp: The number of processing entity comparator inputs that are
> - * available for tracing.
> - * @nr_addr_cmp:Number of pairs of address comparators available
> - * as found in ETMIDR4 0-3.
> - * @nr_cntr: Number of counters as found in ETMIDR5 bit 28-30.
> - * @nr_ext_inp: Number of external input.
> - * @numcidc: Number of contextID comparators.
> - * @numvmidc: Number of VMID comparators.
> - * @nrseqstate: The number of sequencer states that are implemented.
> - * @nr_event: Indicates how many events the trace unit support.
> - * @nr_resource:The number of resource selection pairs available for tracing.
> - * @nr_ss_cmp: Number of single-shot comparator controls that are available.
> + * @caps: ETM capabilities.
> * @trcid: value of the current ID for this component.
> - * @trcid_size: Indicates the trace ID width.
> - * @ts_size: Global timestamp size field.
> - * @ctxid_size: Size of the context ID field to consider.
> - * @vmid_size: Size of the VM ID comparator to consider.
> - * @ccsize: Indicates the size of the cycle counter in bits.
> - * @ccitmin: minimum value that can be programmed in
> - * @s_ex_level: In secure state, indicates whether instruction tracing is
> - * supported for the corresponding Exception level.
> - * @ns_ex_level:In non-secure state, indicates whether instruction tracing is
> - * supported for the corresponding Exception level.
> * @sticky_enable: true if ETM base configuration has been done.
> * @boot_enable:True if we should start tracing at boot time.
> * @os_unlock: True if access to management registers is allowed.
> - * @instrp0: Tracing of load and store instructions
> - * as P0 elements is supported.
> - * @q_filt: Q element filtering support, if Q elements are supported.
> - * @trcbb: Indicates if the trace unit supports branch broadcast tracing.
> - * @trccond: If the trace unit supports conditional
> - * instruction tracing.
> - * @retstack: Indicates if the implementation supports a return stack.
> - * @trccci: Indicates if the trace unit supports cycle counting
> - * for instruction.
> - * @q_support: Q element support characteristics.
> - * @trc_error: Whether a trace unit can trace a system
> - * error exception.
> - * @syncpr: Indicates if an implementation has a fixed
> - * synchronization period.
> - * @stall_ctrl: Enables trace unit functionality that prevents trace
> - * unit buffer overflows.
> - * @sysstall: Does the system support stall control of the PE?
> - * @nooverflow: Indicate if overflow prevention is supported.
> - * @atbtrig: If the implementation can support ATB triggers
> - * @lpoverride: If the implementation can support low-power state over.
> * @trfcr: If the CPU supports FEAT_TRF, value of the TRFCR_ELx that
> * allows tracing at all ELs. We don't want to compute this
> * at runtime, due to the additional setting of TRFCR_CX when
> * in EL2. Otherwise, 0.
> * @config: structure holding configuration parameters.
> * @save_state: State to be preserved across power loss
> - * @skip_power_up: Indicates if an implementation can skip powering up
> - * the trace unit.
> * @paused: Indicates if the trace unit is paused.
> * @arch_features: Bitmap of arch features of etmv4 devices.
> */
> @@ -1037,46 +1081,11 @@ struct etmv4_drvdata {
> raw_spinlock_t spinlock;
> int cpu;
> u8 arch;
> - u8 nr_pe;
> - u8 nr_pe_cmp;
> - u8 nr_addr_cmp;
> - u8 nr_cntr;
> - u8 nr_ext_inp;
> - u8 numcidc;
> - u8 numextinsel;
> - u8 numvmidc;
> - u8 nrseqstate;
> - u8 nr_event;
> - u8 nr_resource;
> - u8 nr_ss_cmp;
> + struct etmv4_caps caps;
> u8 trcid;
> - u8 trcid_size;
> - u8 ts_size;
> - u8 ctxid_size;
> - u8 vmid_size;
> - u8 ccsize;
> - u16 ccitmin;
> - u8 s_ex_level;
> - u8 ns_ex_level;
> - u8 q_support;
> - u8 os_lock_model;
> bool sticky_enable : 1;
> bool boot_enable : 1;
> bool os_unlock : 1;
> - bool instrp0 : 1;
> - bool q_filt : 1;
> - bool trcbb : 1;
> - bool trccond : 1;
> - bool retstack : 1;
> - bool trccci : 1;
> - bool trc_error : 1;
> - bool syncpr : 1;
> - bool stallctl : 1;
> - bool sysstall : 1;
> - bool nooverflow : 1;
> - bool atbtrig : 1;
> - bool lpoverride : 1;
> - bool skip_power_up : 1;
> bool paused : 1;
> u64 trfcr;
> struct etmv4_config config;
next prev parent reply other threads:[~2026-04-13 2:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-12 17:55 [PATCH v3 0/5] fix inconsistencies with sysfs configuration in etmX Yeoreum Yun
2026-04-12 17:55 ` [PATCH v3 1/5] coresight: etm4x: introduce struct etm4_caps Yeoreum Yun
2026-04-13 2:58 ` Jie Gan [this message]
2026-04-13 10:03 ` Yeoreum Yun
2026-04-12 17:55 ` [PATCH v3 2/5] coresight: etm4x: exclude ss_status from drvdata->config Yeoreum Yun
2026-04-13 2:59 ` Jie Gan
2026-04-13 10:04 ` Yeoreum Yun
2026-04-12 17:55 ` [PATCH v3 3/5] coresight: etm4x: fix inconsistencies with sysfs configration Yeoreum Yun
2026-04-13 2:37 ` Jie Gan
2026-04-13 7:06 ` Yeoreum Yun
2026-04-12 17:55 ` [PATCH v3 4/5] coresight: etm3x: introduce struct etm_caps Yeoreum Yun
2026-04-12 17:55 ` [PATCH v3 5/5] coresight: etm3x: fix inconsistencies with sysfs configration Yeoreum Yun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ed0ee60-caa2-4a76-9e01-5d2b8c9af701@oss.qualcomm.com \
--to=jie.gan@oss.qualcomm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=coresight@lists.linaro.org \
--cc=james.clark@linaro.org \
--cc=leo.yan@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.leach@arm.com \
--cc=suzuki.poulose@arm.com \
--cc=yeoreum.yun@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox