ping?
On Thu, Sep 3, 2020 at 12:25 PM Yabin Cui yabinc@google.com wrote:
Hi Mike,
I am from the Android toolchain team. We are interested in using the ETM strobe feature in Android kernels. We noticed your patch "coresight: etmv4: Adds initial complex config with ETM4 strobe feature." in https://lists.linaro.org/pipermail/coresight/2020-June/004097.html. We tested it on Pixel devices with Qualcomm chips. It works pretty well. And I have a few questions:
- The param setting of window and period seems doesn't take effect. Not
sure if it is a bug or something I misunderstand.
The only place I found moving feat->params to feat->regs is in cs_cfg_reset_feat(). But that function will also reset feat->params to default values in feat_desc->params. So if I write a value to /sys/.../window, it goes to feat->params, but can't change value in feat->regs. I tried a work-around by changing cs_cfg_param_store():
static ssize_t cs_cfg_param_store(struct device *dev, {*
... spin_lock(param->feat->dev_spinlock);*
if (!kstrtoull(buf, 0, &val)) {*
param->current_value = val; for (i = 0;
i < feat->nr_regs; i++) { reg_desc = &feat_desc->regs[i];*
flags = reg_desc->flags;*
reg = &feat->regs[i];*
if (flags & CS_CFG_REG_VAL_PARAM) {*
if (param ==
&feat->params[reg_desc->value.val32]) {*
coresight_cfg_init_reg_param(reg, flags, param); }*
}*
}*
}*
spin_unlock(param->feat->dev_spinlock);*
- }*
- Is my understanding below correct?
If I set the window param to 1000 and the period param to 10000, then etm will trace the last 1000 cpu cycles of every 10^7 cpu cycles? And since the strobe window/period counters are saved when disabling etm, the counting should continue from the saved value the next time I enable etm. And I should still get etm data even if the traced thread is scheduled off cpu before reaching 10^7 cpu cycles each time.
- I want to +1 Mathieu's suggestion:
*Perf sessions need to be able to choose which feature they want to use rather than defaulting to a system wide configuration.*
We use perf sessions to trace ETM data in Android. It's better if we can configure ETM strobe params in the perf interface (like from perf_event_attr or ioctl). And It's better for each perf session to count separately.
- The last update on the patch is Jun 24. And it seems the patch hasn't been landed in any branch yet. So what's the future plan?
We need to wait until it lands to some upstream branches to cherry pick it to Android kernels. So I want to know when it will be ready.
Thanks,
Yabin