From patchwork Wed Apr 21 12:04:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kiss X-Patchwork-Id: 12216027 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=-11.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 B4480C433ED for ; Wed, 21 Apr 2021 12:07:13 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 6C4AE6140C for ; Wed, 21 Apr 2021 12:07:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C4AE6140C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=MF4X4RfmObEILgzqMjcZB1d7fzkF4SOJoVuDN2Vxvo0=; b=EZgQFKZRQQRBHwsI4vF8+x/553 b9RIod6KNjN8SZvXTciQBgMoEhjXuTu87EoUORMDikDCqhs7q7KhH+PZ1UZpr6yRtN7hosOe7otjF X6rSpEUp+zWeBfrR84Q3dbW3zZ9h4sXMNEYMT0q1CTXdG6k4fKv9qbKYEeVnIWcbVPgZZb430Pd8d QOSgCQ4PXRD8vadNeowAmxbIXUlfBDcvT42Z22emKsyYfps6TdNzi1Chv6e67e1kdjhWtnJ9M4UzX A65pr7jZ+lGDlHGRf9wwmPoZNG+nWCCxNmGJ3TyqmIt9cKcSQUuK/G82LuFKqttd6w307ub4lOQtb HedRi8eA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZBbM-00ELns-8L; Wed, 21 Apr 2021 12:05:04 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZBbD-00ELmv-GL for linux-arm-kernel@desiato.infradead.org; Wed, 21 Apr 2021 12:04:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=YRKpXMYA2qUjwr7mnO4l0HLjK6sLIHGRyhGlRowDllA=; b=uDmsxQVTJBHXlWJGCKKd3ussV2 Qs94BYnRP8mIowUsqIGWOs1fvWTJ12LcfvKwwy3C9WjLO1Ow48k6WKf+05o4mOHxp2XAFjU2WWfyU srCe42XvllpvI1ECrkpNsIc9DylMYs05py9ThN4abNSnwsStNLL0rDS88omrrtRsqVw/qYcWJTfa6 xj1QievZnMWpv7ZGfZvs2l0kOgEBTRmVbzigaR0fnwUHrgJULgSENWHNv3bG6KkRKDx58+cTr4bJu sFbLSPu7bRiCRO+wvNmj6tGFSuoVky/qsrmBrFgeacKLlpBE8G3yHxyxNcV12CS2vVBuC3bvcQfGm 6ijAY2dQ==; Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZBb7-00CqzF-8S for linux-arm-kernel@lists.infradead.org; Wed, 21 Apr 2021 12:04:53 +0000 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 E429211D4; Wed, 21 Apr 2021 05:04:44 -0700 (PDT) Received: from e120529.arm.com (unknown [10.37.12.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 727603F694; Wed, 21 Apr 2021 05:04:43 -0700 (PDT) From: Daniel Kiss To: mathieu.poirier@linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org, leo.yan@linaro.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: denik@google.com, Daniel Kiss Subject: [PATCH 0/4] coresight: Add ETR-PERF polling. Date: Wed, 21 Apr 2021 14:04:09 +0200 Message-Id: <20210421120413.3110775-1-daniel.kiss@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-ARM-No-Footer: FoSSMail X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210421_050449_381301_F88BB04E X-CRM114-Status: GOOD ( 13.79 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series adds a feature to ETR-PERF that sync the ETR buffer to perf periodically. This is really handy when the system wide trace is used because in this case the perf won't sync during the trace. In a per-thread setup the traced program might not go to the kernel frequvently enought to collect trace. Polling helps in both usecases. Can be used with strobing. Tuning polling period is challanging, I'm working on an additional patch that adds some metrics to help tune the polling period. Daniel Kiss (4): coresight: tmc-etr: Advance buffer pointer in sync buffer. coresight: tmc-etr: Track perf handler. coresight: etm-perf: Export etm_event_cpu_path. coresight: Add ETR-PERF polling. .../testing/sysfs-bus-coresight-devices-tmc | 8 + drivers/hwtracing/coresight/Makefile | 2 +- .../hwtracing/coresight/coresight-etm-perf.c | 10 +- .../hwtracing/coresight/coresight-etm-perf.h | 1 + .../coresight/coresight-etr-perf-polling.c | 316 ++++++++++++++++++ .../coresight/coresight-etr-perf-polling.h | 42 +++ .../hwtracing/coresight/coresight-tmc-core.c | 2 + .../hwtracing/coresight/coresight-tmc-etr.c | 22 +- drivers/hwtracing/coresight/coresight-tmc.h | 2 + 9 files changed, 401 insertions(+), 4 deletions(-) create mode 100644 drivers/hwtracing/coresight/coresight-etr-perf-polling.c create mode 100644 drivers/hwtracing/coresight/coresight-etr-perf-polling.h