From patchwork Thu Jul 1 09:35:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12353797 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=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,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 D7BE5C11F64 for ; Thu, 1 Jul 2021 09:37:38 +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 A2F6F6144F for ; Thu, 1 Jul 2021 09:37:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2F6F6144F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org 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=bombadil.20210309; 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=ClkLMje1+eECgjjBOR84AqODMXg+0zLFAC9rQeWmIUc=; b=D9C2g9zouMrlzH dBmpEsUwrv7plAT+E1TADJ2rXVpEyQ4VkCcdTCZ2WTfL3G1VMA0dWSc2UDyhQgKl0qRYoG2HiieyO XcbsAqGkkmrfJKQIoAifzaeZEUoWLRyog2+KC+Y/UpvGO6D2lXPd4PnSZYwPWC7tmj31cqVzog0Of zwBGJ0sZ/eHIvCmDccSxqcknEDIES7LZ13YzgK1iS6RQe99e3xcCRfUhsJsmLsbZxgr2sbOczJUET t1HRBovasiPeec8bglBi9AJaGr1UOV2UI3dVSC4UEoPdn07wDqOvTxmct87PR4aL3Z8sdC2imUF7J k5r+BGaeWICZRiD1Z2jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyt6u-00GjaU-5l; Thu, 01 Jul 2021 09:35:52 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyt6q-00GjYx-3N for linux-arm-kernel@lists.infradead.org; Thu, 01 Jul 2021 09:35:49 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 22-20020a17090a0c16b0290164a5354ad0so6586146pjs.2 for ; Thu, 01 Jul 2021 02:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RO+W36IfmCoOF5xjf8ZackNVFoRy6NygyQXZ/WJRofM=; b=amvEoN9eeC+VEBTD1Zaf1gJDs8BfXOLUFzr2bPmh3NDlpAr7wa6izhXSlUg6ufPnPw xpVRznI1jPWm2KBvbsXd7Q7OCmjgO2kQMEDYydzfgeaqkgAtuj7wrZX6yYvE1C2+9Rmh 9RuBcA30NcqbRWxeMrLMNgbsyj0U0du6rXT/GeMiiaSKmQpIk/c2/67CV5a227JD6bvp GNYEUUVNDqWr0b+d2E+FkjIjugfw9nDMeSay++s5zJw1Jr//gl/LBJxWfxQqyhaN0Aff GE/aMQfkKNuP1jEmO7fjQBdU2nmgjp2yOMxRwvsfClV6zH1EwrHpsdLbZTeC4m/xXMT1 RQng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RO+W36IfmCoOF5xjf8ZackNVFoRy6NygyQXZ/WJRofM=; b=tnBeIMqM84csZzsT+AiQJYB9nVQAZLfJUClpWau8gkOLwx4q4XT7hkXg4EquhNm4VW ALiAem3UbPwmVFZDq+8Bfd1+uzD26pouHw5sjtLimzeZ1aHfgGd9jDLxyToqie7oMHx4 fI0rC30p9tp/7Uz3P7r1qmZf8c6n0yz/OdZOtEHz2EPgz+Q16+gMszxr4+lyFKGqCZ0H A4eMYe8ftrmXlGn2T2wc/zSz6hSZyzA3eY9+tQL8iHZyzdqRxlaTtRXMzy+fEZZARIDb 0ZxJAsZkXDv8eDWG4dajHUH2EHTo0I39ftPM1porXndOcH2NEpglFG/BbtUtN3vH+1M/ ROMg== X-Gm-Message-State: AOAM532U5j/8D2qyp/zZtDyem91En5F+glg99towlGvHJBM9mhjaoS9n XdxINUubqzTJxbWV3ko2pPdmXg== X-Google-Smtp-Source: ABdhPJyE/KA0+duFfM8NqupreWeG8QVd2YC27MOUmBwTeRg6FRzcSGd2EMTkjhDusy27JhzUdVXQpw== X-Received: by 2002:a17:902:7446:b029:128:ec77:b41e with SMTP id e6-20020a1709027446b0290128ec77b41emr14929267plt.80.1625132146445; Thu, 01 Jul 2021 02:35:46 -0700 (PDT) Received: from localhost ([202.131.71.237]) by smtp.gmail.com with ESMTPSA id q21sm9005717pjg.43.2021.07.01.02.35.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 02:35:45 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Mathieu Poirier , Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , John Garry , Will Deacon , Peter Zijlstra , Ingo Molnar , Mark Rutland , Jiri Olsa , Namhyung Kim , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Daniel Kiss , Denis Nikitin Cc: Leo Yan Subject: [PATCH v2 0/3] coresight: Fix for snapshot mode Date: Thu, 1 Jul 2021 17:35:34 +0800 Message-Id: <20210701093537.90759-1-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210701_023548_241882_C3E44606 X-CRM114-Status: GOOD ( 16.25 ) 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 patch series is to correct the pointer usages for the snapshot mode. Patch 01 is to polish code, it removes the redundant header maintained in tmc-etr driver and directly uses pointer perf_output_handle::head. Patch 02 removes the callback cs_etm_find_snapshot() which wrongly calculates the buffer headers; we can simply use the perf's common function __auxtrace_mmap__read() for headers calculation. Patch 03 is to update comments in CoreSight drivers to reflect the changes introduced by patch 02. This patch can be cleanly applied on the mainline kernel with: commit dbe69e433722 ("Merge tag 'net-next-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next") And it has been tested on Arm64 Juno board. Changes from v1: - Dropped the patch "coresight: etm-perf: Correct buffer syncing for snapshot", after a long discussion, the patch doesn't really resolve any issues for snapshot mode. And another reason for unlike this patch is now the CoreSight and Intel-PT have the consistent behaviour (Suzuki/James/Mathieu); - Added the patch 03 to updates drivers' comments (James); - Added Suzuki's review tag for patch 01; - Added James' review and testing tags for patch 02. Leo Yan (3): coresight: tmc-etr: Use perf_output_handle::head for AUX ring buffer perf cs-etm: Remove callback cs_etm_find_snapshot() coresight: Update comments for removing cs_etm_find_snapshot() drivers/hwtracing/coresight/coresight-etb10.c | 2 +- .../hwtracing/coresight/coresight-tmc-etf.c | 2 +- .../hwtracing/coresight/coresight-tmc-etr.c | 12 +- tools/perf/arch/arm/util/cs-etm.c | 133 ------------------ 4 files changed, 6 insertions(+), 143 deletions(-)