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