Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1126450ybe; Fri, 13 Sep 2019 11:26:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8ZH6s8pL0Nx6XBkkK0WZIErGQqxp1G8bXRXipDJtCe2txQimmxWArzq7coUpaJ/3la32w X-Received: by 2002:a50:a5f8:: with SMTP id b53mr49198909edc.39.1568399175852; Fri, 13 Sep 2019 11:26:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568399175; cv=none; d=google.com; s=arc-20160816; b=kHTWpi44BZxlYAeLQ4/R6dyfVNFgz8gQwL4BM0ckjAdW4wfjs7DVWbCcPcYMO4u3oa 33e+Xv0NfFHMG8z09z0jxsEtEH98+twpO1zXmrLjYUSCYhCyghXPAl7Pn3cjyFqJLOH9 3GvB4fS9mFOilsQuBTnUxffGZvQ2CA931MWyNr3qoKsdFPv2tc9rZ2OnHQ3/AVzmABI4 FR96bpiUL2Dc2EPdlZKyh5QGIyY0c+h0Q3QoPezGvx0rfA0qcSEmR52VinMte6jHZAZT eSbC0jm8JmpxNLl41VGbDkUXTHp7kD7SUjxyE8Wj/fS232QqkdcC7o+WoBBGuCOTSS68 upHg== 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=VTw3Lvi11gFZZdBW8F+GkhWR1h5Typr4DunpTOyyxf8=; b=Apf/Q92Ga9p/SbZnd51+Dvvuw6eBYwSWadnw9gX3sMJWSGw3q8vumeG/p+25zKC4aG GRty/Dn188UYf1fliuGyL3x6qq1Hd2CdeLM0J3TPTIWF42DxvZCo3dsDx8ytizjIAmVe zuDyiGIamORxKY/NL/iHQTz6Qbbb9h8yll+fWyv5ylE3AT9n2pP5wYxZoOvs/GE8t2dF itw/UO10/067uwHi28oEFbMKG9r/kYmYZAz2oRYIXY/MeRr5ohw+S0oWaIYwtUl/jt5A 9rDyIIyUbMEpMN5SxtNDw2BYoFhz9ZUYagrbE+c88i5QlmeLboyVLmA7hEO8GKgBwEM4 Bw+A== 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 n22si11108729edq.33.2019.09.13.11.25.52; Fri, 13 Sep 2019 11:26:15 -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 S2391216AbfIMNYp (ORCPT + 99 others); Fri, 13 Sep 2019 09:24:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56940 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391207AbfIMNYo (ORCPT ); Fri, 13 Sep 2019 09:24:44 -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 5699B30860C8; Fri, 13 Sep 2019 13:24:43 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id B18305C1D4; Fri, 13 Sep 2019 13:24:41 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 18/73] libperf: Add flush to struct perf_mmap Date: Fri, 13 Sep 2019 15:23:00 +0200 Message-Id: <20190913132355.21634-19-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.44]); Fri, 13 Sep 2019 13:24:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move flush from tools/perf's mmap to libperf's perf_mmap struct. Link: http://lkml.kernel.org/n/tip-yvdiy0gkiubey7hut8q3klfu@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/builtin-record.c | 10 +++++----- tools/perf/lib/include/internal/mmap.h | 1 + tools/perf/util/mmap.c | 4 ++-- tools/perf/util/mmap.h | 1 - 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 6c0349dcb20c..400ce2f3fa99 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -959,13 +959,13 @@ static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist, if (map->core.base) { record__adjust_affinity(rec, map); if (synch) { - flush = map->flush; - map->flush = 1; + flush = map->core.flush; + map->core.flush = 1; } if (!record__aio_enabled(rec)) { if (perf_mmap__push(map, rec, record__pushfn) < 0) { if (synch) - map->flush = flush; + map->core.flush = flush; rc = -1; goto out; } @@ -973,13 +973,13 @@ static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist, if (record__aio_push(rec, map, &off) < 0) { record__aio_set_pos(trace_fd, off); if (synch) - map->flush = flush; + map->core.flush = flush; rc = -1; goto out; } } if (synch) - map->flush = flush; + map->core.flush = flush; } if (map->auxtrace_mmap.base && !rec->opts.auxtrace_snapshot_mode && diff --git a/tools/perf/lib/include/internal/mmap.h b/tools/perf/lib/include/internal/mmap.h index 3a404ec06214..a147b25c4b88 100644 --- a/tools/perf/lib/include/internal/mmap.h +++ b/tools/perf/lib/include/internal/mmap.h @@ -25,6 +25,7 @@ struct perf_mmap { u64 start; u64 end; bool overwrite; + u64 flush; char event_copy[PERF_SAMPLE_MAX_SIZE] __aligned(8); }; diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index 4b8ec8dd79c5..4cc3b54b2f73 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -383,7 +383,7 @@ int perf_mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, int cpu) perf_mmap__setup_affinity_mask(map, mp); - map->flush = mp->flush; + map->core.flush = mp->flush; map->comp_level = mp->comp_level; @@ -450,7 +450,7 @@ static int __perf_mmap__read_init(struct mmap *md) md->core.start = md->core.overwrite ? head : old; md->core.end = md->core.overwrite ? old : head; - if ((md->core.end - md->core.start) < md->flush) + if ((md->core.end - md->core.start) < md->core.flush) return -EAGAIN; size = md->core.end - md->core.start; diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h index bdbbf48ee906..e335c341d073 100644 --- a/tools/perf/util/mmap.h +++ b/tools/perf/util/mmap.h @@ -32,7 +32,6 @@ struct mmap { } aio; #endif cpu_set_t affinity_mask; - u64 flush; void *data; int comp_level; }; -- 2.21.0