Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4258384ybp; Mon, 7 Oct 2019 05:54:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmebEZ795atl0sUSSgIDnIWsPsl/QAAzoVRgshzn8NFvpMyzH3OoguJAKcWn4UIfXjO90x X-Received: by 2002:a05:6402:65a:: with SMTP id u26mr28798178edx.86.1570452894872; Mon, 07 Oct 2019 05:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570452894; cv=none; d=google.com; s=arc-20160816; b=cocF7FuYH2NUEgdp2hNcHne737itIRIvNibhoixbWQLcWRgEn4EMmIEz84SRqKRs7i d4NTnFhyEZXeBuV+peId+AY4vl5fk2ndhSZNy27AUaaHwpfenRL0z40mBhD5ufNh5HRc L31ZQp+ummQnHbJhXxgLjRIjgfVLOqHkfZDoEtTp7Wfb3moxy7F7fulWrYj5QBzLUCzY Fv8Hc0emtq3sg+DRXIMSq5vmZVRe1xz3Ty6L2AaTbfIXURVx3Z023nUmpyP8ZR+2RO6k 3ZU6U4+K3K/bsnXwTJlOjJrBXA5r9pIvfnjdJ+BUhJCZWOM0A4URODInhVk7nhpfDWUK Jazg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ABHaRWRcHC+T9mc0xX97vePEsp8UsS4DpVXR4OOYBPo=; b=UQlFWM3J+/3PB6BWuLwNWkOBfm0pJNiiYulQIBvkq7OGnZR0kSVNvdR4dtYYd3wVgd Ku8gzQeAMMEYh5F9RxIxsmDf2YMMc1ZPmv74wdN1gA5ohyDNw1JCNEMGAa1SxW7jV4yC BJ9U5AKTcYZp2F3ixYD6whJBsPm3oJ7TurpcPugOgiFgM/n/mSYLI+MGhOiPWYjTw7Ov /hWagZuvfRsUKmWg6NciPXhyHgcjxOYEBhbaVyW7/sxqm/MXk0B+dTndK6Cx0QMHkvfU X6haQ4JHBPIuuP9Tn0ow2c38Y0x5pkFJxJrKU8u1jTEvmxBU+ViwEn8+/rrJP3ttIRQj 7wlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b16si8593503edb.341.2019.10.07.05.54.31; Mon, 07 Oct 2019 05:54:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728130AbfJGMyG (ORCPT + 99 others); Mon, 7 Oct 2019 08:54:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42374 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728087AbfJGMyE (ORCPT ); Mon, 7 Oct 2019 08:54:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C025520FE; Mon, 7 Oct 2019 12:54:03 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2810A5D9CC; Mon, 7 Oct 2019 12:54:02 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Alexander Shishkin , Michael Petlan , Namhyung Kim , Peter Zijlstra , lkml , Ingo Molnar Subject: [PATCH 08/36] perf tools: Use perf_mmap way to detect aux mmap Date: Mon, 7 Oct 2019 14:53:16 +0200 Message-Id: <20191007125344.14268-9-jolsa@kernel.org> In-Reply-To: <20191007125344.14268-1-jolsa@kernel.org> References: <20191007125344.14268-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.71]); Mon, 07 Oct 2019 12:54:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We will move this code to libperf shortly, so we need to free it of 'struct auxtrace_mmap' usage, because it won't be available in libperf (for now). The perf_event_mmap_page::aux_size is set when the aux mmap is mapped, so the check is equivalent. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20190913132355.21634-48-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/mmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index 9f150d50cea5..f246dd403507 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -107,7 +107,9 @@ union perf_event *perf_mmap__read_event(struct mmap *map) static bool perf_mmap__empty(struct mmap *map) { - return perf_mmap__read_head(map) == map->core.prev && !map->auxtrace_mmap.base; + struct perf_event_mmap_page *pc = map->core.base; + + return perf_mmap__read_head(map) == map->core.prev && !pc->aux_size; } void perf_mmap__consume(struct mmap *map) -- 2.21.0