Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5485758ybp; Mon, 14 Oct 2019 23:43:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2FphrJLsMpgPx9exHHTWanbW2WSnTj/SaBpouNo15+YUTermkGtL/XPGSMXULTvgLY2uk X-Received: by 2002:aa7:d908:: with SMTP id a8mr32006544edr.49.1571121815701; Mon, 14 Oct 2019 23:43:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571121815; cv=none; d=google.com; s=arc-20160816; b=qH8I3e2z97PznriGoufcM22fjHkHtD9E796uzXROEKVBLDiR7odpF/fwYQeNugwbyJ UkEiFrf3pm9UelywQ5CfkHt0RiUt58mDOv+P43/rTArt8vRGfkGDS/aycoPk6jgZiCNA MJgZ2irQsZlJ6+xDRiCqX2zyHYg/OQyql8hjLgYWGhnZ40lKjBOKm87zVj50qhD26kgY RHEFfnX1JWp+o53QNBJ95xIklrPeLwQE+jOJY3nYBJ47uk6CakZxxqX0nVKjKDA1W1U5 yPT1W30WvsI3uicF69Y/Yf6pZ9+qC2GDLxRkZDCVeHw4uH78j2Bx4kP32vLGVcYmi6vN Bk6w== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=WouBlPLan7c/FrLFI3PQp+s8G+Pns8V5lsU/6k+6DUo=; b=o7w7rTUGLm/z7Qr6apS8WhLhr5dJpKbovE3QgjMxcwqMW2Wda45optwDy6YLQ8o8xf t9biCzi9fx4RXd/mbIeEjnoTubROSdAKfVWITcKy4Op2mnGYF/+SzRRv5GWo0XoLircG P6ypGE0x5il96u0SYA6HjBRO5klWPi1EP+sFSuAtyAsPlwrTyrqX4zDwiIi5QCl2Y8TQ vwgN7MHL076c2mEAnL02sQoy8ZFl/xHb87Rl79+jc+32dAeA2ZL8miY/oAoD7vtj+Ncw vqdrhqAJe7jJgfH4/AgID+MqxERlfFjYmWfWV9lvtfQ0/nOurx0CnqLn/jVGr2z74C1M 06Bw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o14si12152258ejc.433.2019.10.14.23.43.12; Mon, 14 Oct 2019 23:43:35 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726720AbfJOFgP (ORCPT + 99 others); Tue, 15 Oct 2019 01:36:15 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:41949 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728409AbfJOFbz (ORCPT ); Tue, 15 Oct 2019 01:31:55 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iKFQx-00009f-Bc; Tue, 15 Oct 2019 07:31:47 +0200 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 0C43A1C0450; Tue, 15 Oct 2019 07:31:41 +0200 (CEST) Date: Tue, 15 Oct 2019 05:31:40 -0000 From: "tip-bot2 for Jiri Olsa" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] libperf: Adopt perf_mmap__get() function from tools/perf Cc: Jiri Olsa , Alexander Shishkin , Michael Petlan , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20191007125344.14268-6-jolsa@kernel.org> References: <20191007125344.14268-6-jolsa@kernel.org> MIME-Version: 1.0 Message-ID: <157111750098.12254.6375534524352964789.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/core branch of tip: Commit-ID: e75710f063e29ae7715c57b45eb27c2d504b32ca Gitweb: https://git.kernel.org/tip/e75710f063e29ae7715c57b45eb27c2d504b32ca Author: Jiri Olsa AuthorDate: Mon, 07 Oct 2019 14:53:13 +02:00 Committer: Arnaldo Carvalho de Melo CommitterDate: Thu, 10 Oct 2019 09:53:27 -03:00 libperf: Adopt perf_mmap__get() function from tools/perf Move perf_mmap__get() from tools/perf to libperf in the internal header internal/mmap.h. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20191007125344.14268-6-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-record.c | 2 +- tools/perf/lib/include/internal/mmap.h | 1 + tools/perf/lib/mmap.c | 5 +++++ tools/perf/util/evlist.c | 2 +- tools/perf/util/mmap.c | 5 ----- tools/perf/util/mmap.h | 1 - 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index f05e8b7..025a12b 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -293,7 +293,7 @@ static int record__aio_pushfn(struct mmap *map, void *to, void *buf, size_t size * after started aio request completion or at record__aio_push() * if the request failed to start. */ - perf_mmap__get(map); + perf_mmap__get(&map->core); } aio->size += size; diff --git a/tools/perf/lib/include/internal/mmap.h b/tools/perf/lib/include/internal/mmap.h index 7067b70..2e68974 100644 --- a/tools/perf/lib/include/internal/mmap.h +++ b/tools/perf/lib/include/internal/mmap.h @@ -39,5 +39,6 @@ size_t perf_mmap__mmap_len(struct perf_mmap *map); void perf_mmap__init(struct perf_mmap *map, bool overwrite); int perf_mmap__mmap(struct perf_mmap *map, struct perf_mmap_param *mp, int fd, int cpu); +void perf_mmap__get(struct perf_mmap *map); #endif /* __LIBPERF_INTERNAL_MMAP_H */ diff --git a/tools/perf/lib/mmap.c b/tools/perf/lib/mmap.c index b216a7d..b765e05 100644 --- a/tools/perf/lib/mmap.c +++ b/tools/perf/lib/mmap.c @@ -31,3 +31,8 @@ int perf_mmap__mmap(struct perf_mmap *map, struct perf_mmap_param *mp, map->cpu = cpu; return 0; } + +void perf_mmap__get(struct perf_mmap *map) +{ + refcount_inc(&map->refcnt); +} diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index f9781de..dc5b360 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c @@ -701,7 +701,7 @@ static int evlist__mmap_per_evsel(struct evlist *evlist, int idx, if (ioctl(fd, PERF_EVENT_IOC_SET_OUTPUT, *output) != 0) return -1; - perf_mmap__get(&maps[idx]); + perf_mmap__get(&maps[idx].core); } revent = perf_evlist__should_poll(evlist, evsel) ? POLLIN : 0; diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index acef6e3..be691b5 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -110,11 +110,6 @@ static bool perf_mmap__empty(struct mmap *map) return perf_mmap__read_head(map) == map->core.prev && !map->auxtrace_mmap.base; } -void perf_mmap__get(struct mmap *map) -{ - refcount_inc(&map->core.refcnt); -} - void perf_mmap__put(struct mmap *map) { BUG_ON(map->core.base && refcount_read(&map->core.refcnt) == 0); diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h index a60e6ea..a73402e 100644 --- a/tools/perf/util/mmap.h +++ b/tools/perf/util/mmap.h @@ -45,7 +45,6 @@ struct mmap_params { int mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, int cpu); void perf_mmap__munmap(struct mmap *map); -void perf_mmap__get(struct mmap *map); void perf_mmap__put(struct mmap *map); void perf_mmap__consume(struct mmap *map);