Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1162034ybe; Fri, 13 Sep 2019 12:02:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkk/rpjPPNlejBNoOnIXO1j3+lXXH8/7bL61iMsZKhtRbBNuJIEC2oiGclOnfEHUGH4rOR X-Received: by 2002:a50:b6aa:: with SMTP id d39mr12572850ede.16.1568401343877; Fri, 13 Sep 2019 12:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568401343; cv=none; d=google.com; s=arc-20160816; b=cFoxT1BruYAV/gXi9v9pWvlYNj3GYw8rugSoa8S4PLpdpQ9cCLOSgxOsdV51k1OVmx H+q6ID6pvEc7D/fqCJQ2Y4IABmETx0uIQHPtV8vLIBCN+q9naUftJ0+pdGz7jmNsHSzC r0twBGP0SH5vE9287ldHHVdhETcewMLTHrs6ZC0g4K7O4yq1qkn9K7uDANPVnhKA9NfA m0j4VnnLSjmwMsksALk0HycJ+rosSfdomtlTsD5T/baOtIrPwwous9cY3tAyAWn6roQU /MD5Af1j6Ju5iXNf0FI5uRivTLfFpgpIDAlNOZaxU4BRIVmP3lEXh3xkvrmOaohYx6PU JyfA== 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=Kk0K8J5pctP+Ah9k6waqPayQNn1B6hTBvtAxOrXNVcY=; b=hlimxTOZR2yWyW6vNHh/H+axXZPQP25d5qb6VD9XAQ4ksCZ0r6lON/keFqE6zhYn4G 54MGs5et9OhV4qKBU5iSXCFUO1cVLkxrrVz0wceXqaMkfuOHGA632QqNwR0HD0hDIX7h m2N/dM36HQmJXgkNQpxNHF6mACYZVf3FTZU1gXTR96TbeaMLttVv/Z8tWI13L44Za47+ N1EZ/Ks4U3OFAS3NB0nHC111E0OgGFqUMY1H+0Dq6+6BYogflQOxx9ucoQsn8mrppPEb elgLnoQSK4XG8KLuZe6xAxjQQQjE8qt1RHUtZWbhsruASyZPjbRzVhf/Yi7+Nfvjc0S2 BM9A== 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 q15si15172787eja.36.2019.09.13.12.01.59; Fri, 13 Sep 2019 12:02:23 -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 S2391471AbfIMNZ4 (ORCPT + 99 others); Fri, 13 Sep 2019 09:25:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51504 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390602AbfIMNZz (ORCPT ); Fri, 13 Sep 2019 09:25:55 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A8E43023080; Fri, 13 Sep 2019 13:25:55 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 74A1B5C1D4; Fri, 13 Sep 2019 13:25:53 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 47/73] perf tools: Use perf_mmap way to detect aux mmap Date: Fri, 13 Sep 2019 15:23:29 +0200 Message-Id: <20190913132355.21634-48-jolsa@kernel.org> In-Reply-To: <20190913132355.21634-1-jolsa@kernel.org> References: <20190913132355.21634-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Fri, 13 Sep 2019 13:25:55 +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 into 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. Link: http://lkml.kernel.org/n/tip-nmj5fchj8wdglxj7d1voxj66@git.kernel.org Signed-off-by: Jiri Olsa --- 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 b904a7a57fdf..4b1d1ae79042 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -106,7 +106,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