From patchwork Sun Jul 4 07:16:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 12357233 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=-18.2 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, 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 C2B96C07E95 for ; Sun, 4 Jul 2021 07:20:51 +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 8F1BA61879 for ; Sun, 4 Jul 2021 07:20:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F1BA61879 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:References:In-Reply-To: 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: List-Owner; bh=8dJxXdfY69U3P5PJDlyUhSv6J2vBrwEMNo9tFGlSye4=; b=CdtdrWzv9i35PH 1NvMArzemCHzjkkJ030YU3hmXJwG4AkiK8462HhhlMeGBvu9syz/BFEyb/hPuZzdz398b2zPm7Sou gEJcEhEVm9shGqcaaptGAYHJhTyE5WULzd6et+DvJ1X5VKuAZqmj4/h08QJRIC+8tjhvCWS0FkEMh wnuI9g1SzB5kLczydPQ9ooN4qqReY15gl5XtgdnRgjXA0xUFhuCxOZH4ms6YW8MxHSXqIMY+lMJOm F+UWGUx2rlIFcNz2/JSIJL3t2DGXEflpJsy3yM2TaCUneo7o6xC/Ga/5uPSNVVjp14A/rTT2c0NIn hBp0S19WhumnW93qpahg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzwOU-005rfV-6l; Sun, 04 Jul 2021 07:18:22 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lzwNa-005rPV-AO for linux-arm-kernel@lists.infradead.org; Sun, 04 Jul 2021 07:17:27 +0000 Received: by mail-pj1-x102a.google.com with SMTP id cx9-20020a17090afd89b0290170a3e085edso9420462pjb.0 for ; Sun, 04 Jul 2021 00:17:25 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=cqZ3/8qRJ0T11IxZy6/iUe0ZOS4dBLD3FIlV5usicsM=; b=E3UX6x54x8lZhJxaCXtRbUP78eBR4I+u4kodpswYImEgDSGt5OsPpK6aig1cAPUsXW kGOyxg1euP+NI63PmPk3bax3UXoPbvCL4fY+7Yrxtec2/mcYxFDBcvjEkew+Z0LgD2Ke 1JC8cnvg+TxOs/q06D+FZnf1x7Z0HSb+QFoHhPP1utkSIEuwI+Fttfbkc5fJ3KjWWpFT erb3my3THxDLnWwFHi/xusawcMjuE4iGWIRpqNkM2lAZ8uBd2vN1BUXxLjndkH1Cbiw6 8wvnZ5X4WiApZ9Zm99zqorutI1O6Yirntyp/q6zjhnGbgKqWsYQMKvdJKEMXLY7n91Am uBLg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cqZ3/8qRJ0T11IxZy6/iUe0ZOS4dBLD3FIlV5usicsM=; b=P8UEJBEIQ4sBb13Un9VQWOm/wuGANxy5KjlYfQh5GlRFEXGEzrLPYwvW/3aTF149fH /G5QaEzCC9D1F1IVNmz9sguQTuOHIqQgLNsu5O4jMPEiyJI7nkFlWLIQpa9v+61zZST3 eNmkEGgkciLXBfPP+c0QktEJoQEseum9AcihTS7lHKvRzLBtRFvuw++L7Anw537zFOlI 1scsFA6Id3aYbz3DEtKk1eDm0V5+nPw6m3+W7YkTbafVMJn/ZklZSrUuD/9Jp0lj/IQL rsYMvEw+S5taUSlPgNVyBrgz5lb1qy3AzHX2t1RYUjUoKjPZhKpEHQnVKcow50a975YO +JFQ== X-Gm-Message-State: AOAM532j3RPpetyEbUDWM48Dj81M0rGcuTTrUxxw+/SKsa//dEadVSWL rAahIJ1mZMmJRrZE0SKo6RORog== X-Google-Smtp-Source: ABdhPJxxP1J0v8GY7Te1DQbveJ8mV/KCKQeQTcGZB4JU9I32dUshft2tWw6YxwA1immL4jEh56ilbg== X-Received: by 2002:a17:90a:e415:: with SMTP id hv21mr8509138pjb.178.1625383045501; Sun, 04 Jul 2021 00:17:25 -0700 (PDT) Received: from localhost ([103.207.71.35]) by smtp.gmail.com with ESMTPSA id s20sm18870464pjn.23.2021.07.04.00.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jul 2021 00:17:24 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Peter Zijlstra , Adrian Hunter , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Thomas Gleixner , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Mathieu Poirier , Suzuki K Poulose , Mike Leach , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v3 06/10] perf auxtrace: Remove auxtrace_mmap__read_snapshot_head() Date: Sun, 4 Jul 2021 15:16:40 +0800 Message-Id: <20210704071644.107397-7-leo.yan@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210704071644.107397-1-leo.yan@linaro.org> References: <20210704071644.107397-1-leo.yan@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210704_001726_394208_1CF22E1C X-CRM114-Status: GOOD ( 15.84 ) 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 Since the function auxtrace_mmap__read_snapshot_head() is exactly same with auxtrace_mmap__read_head(), whether the session is in snapshot mode or not, it's unified to use function auxtrace_mmap__read_head() for reading AUX buffer head. And the function auxtrace_mmap__read_snapshot_head() is unused so this patch removes it. Signed-off-by: Leo Yan --- tools/perf/util/auxtrace.c | 5 ++--- tools/perf/util/auxtrace.h | 10 ---------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 9350eeb3a3fc..44bd04dbb6d6 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -1686,13 +1686,12 @@ static int __auxtrace_mmap__read(struct mmap *map, union perf_event ev; void *data1, *data2; + head = auxtrace_mmap__read_head(mm); + if (snapshot) { - head = auxtrace_mmap__read_snapshot_head(mm); if (auxtrace_record__find_snapshot(itr, mm->idx, mm, data, &head, &old)) return -1; - } else { - head = auxtrace_mmap__read_head(mm); } if (old == head) diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index f489ca159997..1a2f42980e3f 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -440,16 +440,6 @@ struct auxtrace_cache; #ifdef HAVE_AUXTRACE_SUPPORT -static inline u64 auxtrace_mmap__read_snapshot_head(struct auxtrace_mmap *mm) -{ - struct perf_event_mmap_page *pc = mm->userpg; - u64 head = READ_ONCE(pc->aux_head); - - /* Ensure all reads are done after we read the head */ - smp_rmb(); - return head; -} - static inline u64 auxtrace_mmap__read_head(struct auxtrace_mmap *mm) { struct perf_event_mmap_page *pc = mm->userpg;