Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1483236
| From | Suzuki K Poulose <Suzuki.Poulose@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] coresight: tmc: fix for trace collection bug in sysFS mode |
| Date | 2016-09-14 14:30 +0200 |
| Message-ID | <shhua-PJ-19@gated-at.bofh.it> (permalink) |
| References | <sgV0B-1M6-7@gated-at.bofh.it> <sgY8a-3Ow-3@gated-at.bofh.it> <shf90-7Hk-21@gated-at.bofh.it> <shhua-PJ-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 14/09/16 12:30, Venkatesh Vivekanandan wrote:
>
>
> On Wed, Sep 14, 2016 at 3:26 PM, Suzuki K Poulose <Suzuki.Poulose@arm.com <mailto:Suzuki.Poulose@arm.com>> wrote:
>
> On 13/09/16 16:41, Mathieu Poirier wrote:
>
> On 13 September 2016 at 06:20, Venkatesh Vivekanandan
> <venkatesh.vivekanandan@broadcom.com <mailto:venkatesh.vivekanandan@broadcom.com>> wrote:
>
> tmc_etb_dump_hw is never called in sysFS mode to collect trace from
> hardware, because drvdata->mode is set to CS_MODE_DISABLED at
> tmc_disable_etf/etr_sink
>
> static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata)
> {
> .
> .
> if (local_read(&drvdata->mode) == CS_MODE_SYSFS)
> tmc_etb_dump_hw(drvdata);
> .
> .
> }
>
> static void tmc_disable_etf_sink(struct coresight_device *csdev)
> {
> .
> .
> val = local_xchg(&drvdata->mode, CS_MODE_DISABLED);
> /* Disable the TMC only if it needs to */
> if (val != CS_MODE_DISABLED)
> tmc_etb_disable_hw(drvdata);
>
>
> You are correct.
>
> .
> .
> }
>
> I think we should :
>
> 1) First switch the drvdata->mode to a normal type from local_t. Using an
> atomic type for mode is completely unnecessary and comes with the overhead
> of barriers/synchronisation instructions, while all accesses, including read/write
> are performed under the drvdata->spinlock. I have a patch already for this, which
> I plan to send it soon.
>
> and
>
> 2) Do something like :
>
> void tmc_disable_etX_sink()
> {
> if (drvdata->mode != CS_MODE_DISABLED) {
> tmc_etX_disable_hw(drvdata);
> drvdata->mode = CS_MODE_DISABLED;
> }
> }
>
> You will fix this along with above changes?
Yes.
nit: Please fix your mail client. Do not use HTML formatted emails on mailing list
Cheers
Suzuki
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] coresight: tmc: fix for trace collection bug in sysFS mode Venkatesh Vivekanandan <venkatesh.vivekanandan@broadcom.com> - 2016-09-13 14:30 +0200
Re: [PATCH] coresight: tmc: fix for trace collection bug in sysFS mode Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-09-13 17:50 +0200
Re: [PATCH] coresight: tmc: fix for trace collection bug in sysFS mode Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-09-14 12:00 +0200
Re: [PATCH] coresight: tmc: fix for trace collection bug in sysFS mode Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-09-14 14:30 +0200
csiph-web