Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp796395ybe; Fri, 13 Sep 2019 06:31:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwws/ms3B5najeVH89fvOIvUx+MG9AZooLVceuaPotuHf3Ulrj6YKd2JdodBUPXidozdMIr X-Received: by 2002:a17:906:e0c2:: with SMTP id gl2mr3319272ejb.157.1568381507406; Fri, 13 Sep 2019 06:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568381507; cv=none; d=google.com; s=arc-20160816; b=RcfhtNt2C0afRRfooBaAvnUq2HqutFITWY8VGZSJ7DKmX/3JxNDBeX4Fpke1UEw6YN JqWOkArGaNgAyBZulE+srXAlQIszLQYjFgFIZScTsqRHY5olk/qoOs1y4NIBbiKbyOYN 9g/ayHyo5wRAmnzIAxaG2tfvx5H8ijQbDPxeoLbzAYNx3sMswf/JCk8kA1r2+/L7KlR9 9Z8Dk9H/ZuPfpYDtPcQqA0rvJ47z+yW2hOj/BuVwTWtKKNH7GdjJW1cDZL8BjGvygZ6x 1CcxCHV4nWSYVt2zZcqI44WD4nxO2HOa+CljTLcbh4xRP7YCehE0cu1Wxjl6z+sn8pTc NVpg== 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=MIoRlAPJuQ+6MSch29tlaiKEb/rhjDWE18YljacV/OI=; b=Mjp5cchrvyPCEsCiWpWDorjOj1jZxKnX+SZI0L1pAsIkGa5JxtBZnF7q+PGL/ohyg5 Gk+0lYrBhkSQdRGCj+6REPHY7OUkewMApBVUx/4X2JtMQNqffuoBqzWvzZ8WuiSbx5Hm OE7+xEBA4DkRWnjFVTcoFEF/F11v2oaPuvXv4ZJD0RHN4KQ75FNk3Gk6wtpV8TSV1n3K LbCjcbZ6lFSSAqdo17caKNxl2nl4rCZ9wLD7Kfp2INb/+5/k4Xjn4U0xfkcytfQr/K4b RQZIujlKpZTfIvr1YOs+CVJ+h/F1N7lny2j6veRT1aKh9fjHPd3lMb3eFXcm+pjnN56p 22jw== 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 y43si17646632edd.42.2019.09.13.06.31.18; Fri, 13 Sep 2019 06:31:47 -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 S2391197AbfIMNYi (ORCPT + 99 others); Fri, 13 Sep 2019 09:24:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35828 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391175AbfIMNYc (ORCPT ); Fri, 13 Sep 2019 09:24:32 -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 8C8BF307CB3F; Fri, 13 Sep 2019 13:24:31 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFADB5C219; Fri, 13 Sep 2019 13:24:29 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 13/73] libperf: Add cpu to struct perf_mmap Date: Fri, 13 Sep 2019 15:22:55 +0200 Message-Id: <20190913132355.21634-14-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.42]); Fri, 13 Sep 2019 13:24:31 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move cpu from tools/perf's mmap to libperf's perf_mmap struct. Link: http://lkml.kernel.org/n/tip-e98u3vvj1ch8rvrvg53gs8nk@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/include/internal/mmap.h | 1 + tools/perf/util/mmap.c | 8 ++++---- tools/perf/util/mmap.h | 1 - tools/perf/util/python.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/lib/include/internal/mmap.h b/tools/perf/lib/include/internal/mmap.h index 2cbe2c463c0a..153348724bf3 100644 --- a/tools/perf/lib/include/internal/mmap.h +++ b/tools/perf/lib/include/internal/mmap.h @@ -16,6 +16,7 @@ struct perf_mmap { void *base; int mask; int fd; + int cpu; }; #endif /* __LIBPERF_INTERNAL_MMAP_H */ diff --git a/tools/perf/util/mmap.c b/tools/perf/util/mmap.c index 40bf124cb658..dc8320891344 100644 --- a/tools/perf/util/mmap.c +++ b/tools/perf/util/mmap.c @@ -256,7 +256,7 @@ static int perf_mmap__aio_mmap(struct mmap *map, struct mmap_params *mp) pr_debug2("failed to allocate data buffer area, error %m"); return -1; } - ret = perf_mmap__aio_bind(map, i, map->cpu, mp->affinity); + ret = perf_mmap__aio_bind(map, i, map->core.cpu, mp->affinity); if (ret == -1) return -1; /* @@ -347,9 +347,9 @@ static void perf_mmap__setup_affinity_mask(struct mmap *map, struct mmap_params { CPU_ZERO(&map->affinity_mask); if (mp->affinity == PERF_AFFINITY_NODE && cpu__max_node() > 1) - build_node_mask(cpu__get_node(map->cpu), &map->affinity_mask); + build_node_mask(cpu__get_node(map->core.cpu), &map->affinity_mask); else if (mp->affinity == PERF_AFFINITY_CPU) - CPU_SET(map->cpu, &map->affinity_mask); + CPU_SET(map->core.cpu, &map->affinity_mask); } int perf_mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, int cpu) @@ -379,7 +379,7 @@ int perf_mmap__mmap(struct mmap *map, struct mmap_params *mp, int fd, int cpu) return -1; } map->core.fd = fd; - map->cpu = cpu; + map->core.cpu = cpu; perf_mmap__setup_affinity_mask(map, mp); diff --git a/tools/perf/util/mmap.h b/tools/perf/util/mmap.h index 6eb7a4c6b14a..bab46642e639 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 cpu; refcount_t refcnt; u64 prev; u64 start; diff --git a/tools/perf/util/python.c b/tools/perf/util/python.c index 7e28f7e18d41..96100ed73dbe 100644 --- a/tools/perf/util/python.c +++ b/tools/perf/util/python.c @@ -991,7 +991,7 @@ static struct mmap *get_md(struct evlist *evlist, int cpu) for (i = 0; i < evlist->nr_mmaps; i++) { struct mmap *md = &evlist->mmap[i]; - if (md->cpu == cpu) + if (md->core.cpu == cpu) return md; } -- 2.21.0