From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33640C4338F for ; Mon, 26 Jul 2021 12:34:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 162CF60F44 for ; Mon, 26 Jul 2021 12:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234091AbhGZLyX (ORCPT ); Mon, 26 Jul 2021 07:54:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233742AbhGZLyW (ORCPT ); Mon, 26 Jul 2021 07:54:22 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CED47C061757 for ; Mon, 26 Jul 2021 05:34:49 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id j2so10846453wrx.9 for ; Mon, 26 Jul 2021 05:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jkiNXr4VlGX4jk1tmCfMW3KOCcfI9fRgyo5pODgk9Cg=; b=YV+moxv21xffSZngcjywGcDBc0RHjAvLwt4Gg1M2CTkE4RHXMPAkQ9i1bZnm5+kiyq 8E51pQzWUvqZ4kunC231U1MeUi/uQdLakPGOVGjluquYZoRKQRt334D8wt7okjFUnIRh MbOFMCujsbRL5JBaP+ml/YVvxgkI3JCJYVcPrHvxFed7SbpinrN1X0rXgU8ZQXu3Kx93 6e1sAoY5tU4Z9BaEO7tFIZ6AVNUscd5M1alaeZrrFb7gupsqpFuasduWnhlVkq7rzC3J wyn8AN4L1Oqo/alQOzOwyFDQFqHtSFswqwdYoWkBStnfmK+BUUI39fxHDnXgtC+VJFEY 6zsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jkiNXr4VlGX4jk1tmCfMW3KOCcfI9fRgyo5pODgk9Cg=; b=eCYLpbhf0LpWsn/tcwHrfpoVxVCAXeIsGgYIGdcNCdGHfGxWL+7B1Ys+FAV0kqxXFs /N9ShTxdOXXVVFJbFyMmJrJaTc4A4rTwDQ0q2NjDKoXrDTT0JrNg6gUuamuPBbuaT3KL c4jcXG8NcQnAo6GlLnYEKtVKdrrL0PteQorJiBYLBt9p/uA3w5a0ZkZgXHUWtRfPIeUH 9PuE57svJ4NPklYrEXe1iIPmNRydKjKaQQq4e+7gzy/4JLQ6lMfcsRsF/FAolPxaRUDZ tWp5Odl/C29nXSM3wG4i0OFzYMpL/OoUO0Epl+TLsDNGeo8Hc/lhjWVVc7rWciCFF7FW yesw== X-Gm-Message-State: AOAM5326vlbmMe0EmOWmESGzqpbluFepUOO90n3L7dODPI6gtBzq/U/x G09EVQCwHlykEYlbwOd3pOPbE4x088h9L7eC/+uKGg== X-Google-Smtp-Source: ABdhPJwfx8y+zdl0tsH5FUzDhfgm/mIf+WMkCovlWrXD/lgKM6h61pm3Iy+9uPIJUCnfHF/yPZ8bgWtuaa+nAhm2ook= X-Received: by 2002:adf:f6cc:: with SMTP id y12mr16153497wrp.178.1627302888459; Mon, 26 Jul 2021 05:34:48 -0700 (PDT) MIME-Version: 1.0 References: <20210723124611.3828908-1-suzuki.poulose@arm.com> <20210723124611.3828908-8-suzuki.poulose@arm.com> In-Reply-To: <20210723124611.3828908-8-suzuki.poulose@arm.com> From: Mike Leach Date: Mon, 26 Jul 2021 13:34:37 +0100 Message-ID: Subject: Re: [PATCH v2 07/10] coresight: trbe: Do not truncate buffer on IRQ To: Suzuki K Poulose Cc: Coresight ML , linux-arm-kernel , Linux Kernel Mailing List , tamas.zsoldos@arm.com, Al Grant , Leo Yan , Mathieu Poirier , Anshuman Khandual , jinlmao@qti.qualcomm.com, James Clark Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Suzuki, On Fri, 23 Jul 2021 at 13:46, Suzuki K Poulose wrote: > > The TRBE driver marks the AUX buffer as TRUNCATED when we get an IRQ > on FILL event. This has rather unwanted side-effect of the event > being disabled when there may be more space in the ring buffer. > > So, instead of TRUNCATE we need a different flag to indicate > that the trace may have lost a few bytes (i.e from the point of > generating the FILL event until the IRQ is consumed). Anyways, the > userspace must use the size from RECORD_AUX headers to restrict > the "trace" decoding. > > Using PARTIAL flag causes the perf tool to generate the > following warning: > > Warning: > AUX data had gaps in it XX times out of YY! > > Are you running a KVM guest in the background? > > which is pointlessly scary for a user. The other remaining options > are : > - COLLISION - Use by SPE to indicate samples collided > - Add a new flag - Specifically for CoreSight, doesn't sound > so good, if we can re-use something. > What is the user visible behaviour when using COLLISION? The TRUNCATE warning is at least accurate - even if the KVM thing is something of a red herring. It is easier to explain a "scary" warning, than try to debug someones problems if perf is silent or misleading when using the COLLISION flag. Regards Mike > Given that we don't already use the "COLLISION" flag, the above > behavior can be notified using this flag for CoreSight. > > Cc: Mathieu Poirier > Cc: James Clark > Cc: Mike Leach > Cc: Anshuman Khandual > Cc: Leo Yan > Signed-off-by: Suzuki K Poulose > --- > drivers/hwtracing/coresight/coresight-trbe.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c > index 503bea0137ae..d50f142e86d1 100644 > --- a/drivers/hwtracing/coresight/coresight-trbe.c > +++ b/drivers/hwtracing/coresight/coresight-trbe.c > @@ -615,7 +615,7 @@ static unsigned long arm_trbe_update_buffer(struct coresight_device *csdev, > * for correct size. Also, mark the buffer truncated. > */ > write = get_trbe_limit_pointer(); > - perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); > + perf_aux_output_flag(handle, PERF_AUX_FLAG_COLLISION); > } > > offset = write - base; > @@ -708,7 +708,7 @@ static void trbe_handle_overflow(struct perf_output_handle *handle) > * collection upon the WRAP event, without stopping the source. > */ > perf_aux_output_flag(handle, PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW | > - PERF_AUX_FLAG_TRUNCATED); > + PERF_AUX_FLAG_COLLISION); > perf_aux_output_end(handle, size); > event_data = perf_aux_output_begin(handle, event); > if (!event_data) { > -- > 2.24.1 > -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3638AC4338F for ; Mon, 26 Jul 2021 12:36:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ECA4260D07 for ; Mon, 26 Jul 2021 12:36:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ECA4260D07 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OfrOAD6oV3pdOzFSDEcyrdSVWQEfeOYnQpADUOmnytw=; b=i1Aqcz+nmUep8g ByktScehTlRTQPAmhSkab1Iqb84DpMdZbI46K7JY4KfU266uC7JZrm35MPSTzMQOF2AuOjkvKFfo3 vWjtu9otHFkoJlS1xiVJkB7CSuWwPJrnYQ5ccGLUhU1+K6kM9Cuz/m/wtycv79YwUd+DhzKaaocpj HIr+A9oCgaVfFCpw8uk0PZbWjA3t74Ub9nQWuqLePwmwfec5/i9JxTSwgfqiATz/zPasvRRu1aZvm 1VsTOKxlK7SAL2y+KffyCB2A6UMwrxTU04lxt/O4uy6Q15BKzz5Gq3WOlGoGHR7OAIFxzriYTfXhu 5zauZ9iLQ6ShnkKau3hg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7zou-00BAxY-6E; Mon, 26 Jul 2021 12:34:56 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m7zoo-00BAux-UD for linux-arm-kernel@lists.infradead.org; Mon, 26 Jul 2021 12:34:52 +0000 Received: by mail-wr1-x42f.google.com with SMTP id e2so10881309wrq.6 for ; Mon, 26 Jul 2021 05:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jkiNXr4VlGX4jk1tmCfMW3KOCcfI9fRgyo5pODgk9Cg=; b=YV+moxv21xffSZngcjywGcDBc0RHjAvLwt4Gg1M2CTkE4RHXMPAkQ9i1bZnm5+kiyq 8E51pQzWUvqZ4kunC231U1MeUi/uQdLakPGOVGjluquYZoRKQRt334D8wt7okjFUnIRh MbOFMCujsbRL5JBaP+ml/YVvxgkI3JCJYVcPrHvxFed7SbpinrN1X0rXgU8ZQXu3Kx93 6e1sAoY5tU4Z9BaEO7tFIZ6AVNUscd5M1alaeZrrFb7gupsqpFuasduWnhlVkq7rzC3J wyn8AN4L1Oqo/alQOzOwyFDQFqHtSFswqwdYoWkBStnfmK+BUUI39fxHDnXgtC+VJFEY 6zsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jkiNXr4VlGX4jk1tmCfMW3KOCcfI9fRgyo5pODgk9Cg=; b=ESTvp7TQADOE8YbQObThNFh9kZZ7hFEZcc9H/wBIWRLzQpcoUIqs7wU0K+ld1Gag7F QKD7AvVwWOPI3uSJDzUVcZLxG5abO+bXNyXyyt3CiaZwHqUbXfFoa+16wg5MYdVoXJC5 hT7F9EBR27JI5B5iknWx1wOZ3cnl8LISZYDSc4+anZuAJNdRJaPN/O33NksAuvUlKy43 x9YJod77K5Jcd2U79QP5pwSopsJYjOnnUyVgtrF2yTw59Jv+0u/vyVF2DIXIM5Mc5maX 4Gt8yGmVMiqbZfPgc10jcatZKRLzvoiCdNOOGaV+Jbnoj6hdCet6R0vo7isa1AX4PbZB XBqg== X-Gm-Message-State: AOAM5303sr64ZFPh//muENifbSH4j5F7TvqbVm2USgmjD9ubtvzEIU9k trM2jKUGvoLzi+eBJUZjl4HtJ8egQ2bLkInZdOKlIA== X-Google-Smtp-Source: ABdhPJwfx8y+zdl0tsH5FUzDhfgm/mIf+WMkCovlWrXD/lgKM6h61pm3Iy+9uPIJUCnfHF/yPZ8bgWtuaa+nAhm2ook= X-Received: by 2002:adf:f6cc:: with SMTP id y12mr16153497wrp.178.1627302888459; Mon, 26 Jul 2021 05:34:48 -0700 (PDT) MIME-Version: 1.0 References: <20210723124611.3828908-1-suzuki.poulose@arm.com> <20210723124611.3828908-8-suzuki.poulose@arm.com> In-Reply-To: <20210723124611.3828908-8-suzuki.poulose@arm.com> From: Mike Leach Date: Mon, 26 Jul 2021 13:34:37 +0100 Message-ID: Subject: Re: [PATCH v2 07/10] coresight: trbe: Do not truncate buffer on IRQ To: Suzuki K Poulose Cc: Coresight ML , linux-arm-kernel , Linux Kernel Mailing List , tamas.zsoldos@arm.com, Al Grant , Leo Yan , Mathieu Poirier , Anshuman Khandual , jinlmao@qti.qualcomm.com, James Clark X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210726_053451_022100_3C0CA27D X-CRM114-Status: GOOD ( 31.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Suzuki, On Fri, 23 Jul 2021 at 13:46, Suzuki K Poulose wrote: > > The TRBE driver marks the AUX buffer as TRUNCATED when we get an IRQ > on FILL event. This has rather unwanted side-effect of the event > being disabled when there may be more space in the ring buffer. > > So, instead of TRUNCATE we need a different flag to indicate > that the trace may have lost a few bytes (i.e from the point of > generating the FILL event until the IRQ is consumed). Anyways, the > userspace must use the size from RECORD_AUX headers to restrict > the "trace" decoding. > > Using PARTIAL flag causes the perf tool to generate the > following warning: > > Warning: > AUX data had gaps in it XX times out of YY! > > Are you running a KVM guest in the background? > > which is pointlessly scary for a user. The other remaining options > are : > - COLLISION - Use by SPE to indicate samples collided > - Add a new flag - Specifically for CoreSight, doesn't sound > so good, if we can re-use something. > What is the user visible behaviour when using COLLISION? The TRUNCATE warning is at least accurate - even if the KVM thing is something of a red herring. It is easier to explain a "scary" warning, than try to debug someones problems if perf is silent or misleading when using the COLLISION flag. Regards Mike > Given that we don't already use the "COLLISION" flag, the above > behavior can be notified using this flag for CoreSight. > > Cc: Mathieu Poirier > Cc: James Clark > Cc: Mike Leach > Cc: Anshuman Khandual > Cc: Leo Yan > Signed-off-by: Suzuki K Poulose > --- > drivers/hwtracing/coresight/coresight-trbe.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c > index 503bea0137ae..d50f142e86d1 100644 > --- a/drivers/hwtracing/coresight/coresight-trbe.c > +++ b/drivers/hwtracing/coresight/coresight-trbe.c > @@ -615,7 +615,7 @@ static unsigned long arm_trbe_update_buffer(struct coresight_device *csdev, > * for correct size. Also, mark the buffer truncated. > */ > write = get_trbe_limit_pointer(); > - perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); > + perf_aux_output_flag(handle, PERF_AUX_FLAG_COLLISION); > } > > offset = write - base; > @@ -708,7 +708,7 @@ static void trbe_handle_overflow(struct perf_output_handle *handle) > * collection upon the WRAP event, without stopping the source. > */ > perf_aux_output_flag(handle, PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW | > - PERF_AUX_FLAG_TRUNCATED); > + PERF_AUX_FLAG_COLLISION); > perf_aux_output_end(handle, size); > event_data = perf_aux_output_begin(handle, event); > if (!event_data) { > -- > 2.24.1 > -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel