On Mon, Mar 18, 2019 at 02:48:55PM -0600, Mathieu Poirier wrote:
{ @@ -236,9 +324,24 @@ static int etm4_parse_event_config(struct etmv4_drvdata *drvdata, /* TRM: Must program this for cycacc to work */ config->ccctlr = ETM_CYC_THRESHOLD_DEFAULT; }
if (attr->config & BIT(ETM_OPT_TS))
if (attr->config & BIT(ETM_OPT_TS)) {
/*
* Configure timestamps to be emitted at regular intervals in
* order to correlate instructions executed on different CPUs
* (CPU-wide trace scenarios).
*/
ret = etm4_config_timestamp_event(drvdata);
Use this method, I can see now it only allocates counter but there have no flow to release counter; so after run for several times with perf command, will it fail to allocate any counter and resource selector?
Very well spotted. I will fix this.
Turns out function etm4_parse_event_config() already clears out specifics from the previous session and starts with a clean slate.
You are right, sorry for noise.
Thanks, Leo Yan
[1]. https://elixir.bootlin.com/linux/v5.1-rc1/source/drivers/hwtracing/coresight...