Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp791940ybe; Fri, 13 Sep 2019 06:27:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5w6P4XrffKX0jStJ+mHfIkYmY1ymEbzfihYLhvy/t5Rls/+ee2//brq1+B5OvW0cNIjSv X-Received: by 2002:a17:906:244c:: with SMTP id a12mr38618684ejb.288.1568381271009; Fri, 13 Sep 2019 06:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568381271; cv=none; d=google.com; s=arc-20160816; b=BTPonuF3QXWKGJ79UW1sTP5Ponc7qYJYihR+SZVglKKsOnrIidKXDU7l6+M8TsG5hh wzXzRMv1ZalamXCWqZzuFbFGBWN73F0lZEyLkaMkx5acjN9aHCTHHhCEw7aJXKD2AWa7 ZM4eSfkpzhwXiqb5CuVrRWrycsA/CgVsIZuIsMxqPMulRog3vzH6AOXRisIuKqEBOhln vHoAmURRkVFmy3jWahrWTO95sj/tqq0lRfGyBXKq+OyXzcyKrfXoQo1GgEhPHFzLLgSw jwdloybG7Mtrn/3uMST0Lu/5B82Oe9F69aH2r4juYIGbl5KXbLV749FI/hLttUOp+tuK mcEg== 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=Kdzx8fVSEcfMM8gitdPNlg5XSe9SwQLpttdKrY5amdU=; b=TH6RLC9NCQwsbaEJR96TTZ/BYX1bVlGYYUwygH/q/bbMXRZbDabp5EHnBRa4XD60Du tkrWlMAL0jacQPN8u/vp+hcq9P3ZqejD/a0S8sGeMc+vQ9wFvFW040Qvw9QDL1Um7+vO nGaMCKP2uflCLPNQzngK3/QscUnV01iN+3K0qEVVjHTCyNCeBA0wSk/02R7sPuNLqYXm +xG0jNP1CpQYgftzuWSN8YgbZFzX4yxF0PKFInOrYnh5RpZ6gsVD0g7cQO0ZejG2u/VB Ru2f5a5pL295/doekT/vqMUqcYUOy5QIVG/CUjGGI+dRgLq08GVI5oR3y+o0qso4YiUK gwQw== 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 z35si18081885edb.146.2019.09.13.06.27.26; Fri, 13 Sep 2019 06:27:50 -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 S2390815AbfIMNYf (ORCPT + 99 others); Fri, 13 Sep 2019 09:24:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39502 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391166AbfIMNYa (ORCPT ); Fri, 13 Sep 2019 09:24:30 -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 95C8D307CDEA; Fri, 13 Sep 2019 13:24:29 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC0105C1D4; Fri, 13 Sep 2019 13:24:27 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 12/73] libperf: Add fd to struct perf_mmap Date: Fri, 13 Sep 2019 15:22:54 +0200 Message-Id: <20190913132355.21634-13-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.49]); Fri, 13 Sep 2019 13:24:29 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move fd from tools/perf's mmap to libperf's perf_mmap struct. Link: http://lkml.kernel.org/n/tip-y7digcgafmpu8seq13mt64aw@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/include/internal/mmap.h | 1 + tools/perf/util/evlist.c | 4 ++-- tools/perf/util/mmap.c | 4 ++-- tools/perf/util/mmap.h | 1 - 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/lib/include/internal/mmap.h b/tools/perf/lib/include/internal/mmap.h index a6a464097f14..2cbe2c463c0a 100644 --- a/tools/perf/lib/include/internal/mmap.h +++ b/tools/perf/lib/include/internal/mmap.h @@ -15,6 +15,7 @@ struct perf_mmap { void *base; int mask; + int fd; }; #endif /* __LIBPERF_INTERNAL_MMAP_H */ diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index ac738b90a71f..57b117532ade 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -651,7 +651,7 @@ static int perf_evlist__set_paused(struct evlist *evlist, bool value) return 0; for (i = 0; i < evlist->nr_mmaps; i++) { - int fd = evlist->overwrite_mmap[i].fd; + int fd = evlist->overwrite_mmap[i].core.fd; int err; if (fd < 0) @@ -707,7 +707,7 @@ static struct mmap *evlist__alloc_mmap(struct evlist *evlist, return NULL; for (i = 0; i < evlist->nr_mmaps; i++) { - map[i].fd = -1; + map[i].core.fd = -1; map[i].overwrite = overwrite; /* * When the perf_mmap() call is made we grab one refcount, plus diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index 702e8e0b90ea..40bf124cb658 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -320,7 +320,7 @@ void perf_mmap__munmap(struct mmap *map) if (map->core.base != NULL) { munmap(map->core.base, perf_mmap__mmap_len(map)); map->core.base = NULL; - map->fd = -1; + map->core.fd = -1; refcount_set(&map->refcnt, 0); } auxtrace_mmap__munmap(&map->auxtrace_mmap); @@ -378,7 +378,7 @@ int perf_mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, int cpu) map->core.base = NULL; return -1; } - map->fd = fd; + map->core.fd = fd; map->cpu = cpu; perf_mmap__setup_affinity_mask(map, mp); diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h index a6e60596f889..6eb7a4c6b14a 100644 --- a/tools/perf/util/mmap.h +++ b/tools/perf/util/mmap.h @@ -22,7 +22,6 @@ struct aiocb; */ struct mmap { struct perf_mmap core; - int fd; int cpu; refcount_t refcnt; u64 prev; -- 2.21.0