From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: yabinc@google.com, mathieu.poirier@linaro.org,
alexander.shishkin@linux.intel.com
Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] coresight: tmc-etr: Remove perf_data check.
Date: Fri, 9 Aug 2019 10:22:07 +0100 [thread overview]
Message-ID: <84df6071-ef7e-c3d6-6ffa-fcfcbab0c8e6@arm.com> (raw)
In-Reply-To: <20190808193122.76679-1-yabinc@google.com>
Hi Yabin,
Thank you for the analysis and the patch.
On 08/08/2019 20:31, Yabin Cui wrote:
> When tracing etm data of multiple threads on multiple cpus through
> perf interface, each cpu has a unique etr_perf_buffer while sharing
> the same etr device. There is no guarantee that the last cpu starts
> etm tracing also stops last. So the perf_data check is no longer valid.
>
> Signed-off-by: Yabin Cui <yabinc@google.com>
> ---
> drivers/hwtracing/coresight/coresight-tmc-etr.c | 9 ---------
> drivers/hwtracing/coresight/coresight-tmc.h | 2 --
> 2 files changed, 11 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c
> index 17006705287a..0418440e0141 100644
> --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c
> +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c
> @@ -1484,20 +1484,12 @@ tmc_update_etr_buffer(struct coresight_device *csdev,
> goto out;
> }
>
> - if (WARN_ON(drvdata->perf_data != etr_perf)) {
> - lost = true;
> - spin_unlock_irqrestore(&drvdata->spinlock, flags);
> - goto out;
> - }
> -
I think some sort of sanity check is a good idea to make sure we don't loose the
context. Even when different CPUs have different etr_perf buffer, the underlying
etr_buf should be the same. So, we should be able to simply convert the check
to, something like :
struct etr_perf_buffer *perf_buf = drvdata->perf_data;
...
if (WARN_ON(perf_buf->etr_buf != etr_perf->buf)) {
....
}
Does that solve the problem for you ?
Suzuki
next prev parent reply other threads:[~2019-08-09 9:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-08 19:31 Yabin Cui
2019-08-09 9:22 ` Suzuki K Poulose [this message]
2019-08-09 20:16 ` Yabin Cui
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=84df6071-ef7e-c3d6-6ffa-fcfcbab0c8e6@arm.com \
--to=suzuki.poulose@arm.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=yabinc@google.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
all inboxes | Powered by JetHome®