Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5660806pxu; Wed, 23 Dec 2020 02:07:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUtnmNLqsCEc8ZdrFk7eF6pEtqITPBX3mn2ckogGv675IrLZZxOy59RY7zxf5DT0oq3zX2 X-Received: by 2002:a17:906:410e:: with SMTP id j14mr23500760ejk.253.1608718046792; Wed, 23 Dec 2020 02:07:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608718046; cv=none; d=google.com; s=arc-20160816; b=jD/YoonS4QV5az4TQJJjBOv6McKqynW8bsBaQURqwyMoOcSgEZ+fLUCjiQ/4F2foT6 ZG/oXFb1o3iNOoiBxbfDrW7wOvasU5kwULFl4oBZHAXiMNmdSQFr3LByWoYaEwe6OvDV cY7f7cVz84b4XhDisIuzlySr7DKuUzYuEpbyBSksrl9arLldhzTFZSmBLz8O7IJP9kLr Y0pIWgslOcHUCbwyQveh6ynYsWFv7ocd5XyyYNC3U0H/pKSMU2YlQbV0gj1lWe+uRPIM aVJdtOWxb/wqGwgelVOG6Kj7seS9aJi4FEHJAK/FOHLp/aDh7IbkMkkcBAgw1p59uvUN sTvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=LghTYwd1FOU/IpraMv1SVEgcT/YQ/HZ/mPOJe4+pS7w=; b=xcA19Jw3gXZPVSpDxEdLfVdTemLelPzPLgYJaMYNHrDB3aIfhxq+TUszHRx/RzTT93 4MI18kPxGqf9sqZ6oeuxlCckhWM2lGJePcFljwUlt3LBBRR5LuIlNNu5o6c0rCKOsuPl KXAU4nl4kvRvbPTQOqJdhaYOfyYJE7G+caHORakgeEYbx1EdhWkt8h6LhC9riiwMEbDo 5vOJ3E4Ve+xzP8jBUNulUXulDtLK8b4PrUmEoFHqxGFZCg6BkwU7jsvbH7rKNNh16Rx8 BwIO8nb7jrQsaM6P8DX/61KuQH8DHM/BgvKhAqUYkjJMLqUE7g2VbxXkpcFhn6IyPcNb lePA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t10si8556182edt.208.2020.12.23.02.07.03; Wed, 23 Dec 2020 02:07:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728501AbgLWKFT (ORCPT + 99 others); Wed, 23 Dec 2020 05:05:19 -0500 Received: from foss.arm.com ([217.140.110.172]:48058 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728489AbgLWKFS (ORCPT ); Wed, 23 Dec 2020 05:05:18 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0D5E91480; Wed, 23 Dec 2020 02:04:11 -0800 (PST) Received: from p8cg001049571a15.blr.arm.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 48AB83F718; Wed, 23 Dec 2020 02:04:08 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Cc: linux-kernel@vger.kernel.org, Anshuman Khandual , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Linu Cherian Subject: [PATCH 09/11] coresight: etm-perf: Truncate the perf record if handle has no space Date: Wed, 23 Dec 2020 15:33:41 +0530 Message-Id: <1608717823-18387-10-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1608717823-18387-1-git-send-email-anshuman.khandual@arm.com> References: <1608717823-18387-1-git-send-email-anshuman.khandual@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While starting off the etm event, just abort and truncate the perf record if the perf handle as no space left. This avoids configuring both source and sink devices in case the data cannot be consumed in perf. Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki K Poulose Signed-off-by: Anshuman Khandual --- drivers/hwtracing/coresight/coresight-etm-perf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index eb9e7e9..e776a07 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -347,6 +347,9 @@ static void etm_event_start(struct perf_event *event, int flags) if (!event_data) goto fail; + if (!handle->size) + goto fail_end_stop; + /* * Check if this ETM is allowed to trace, as decided * at etm_setup_aux(). This could be due to an unreachable -- 2.7.4