Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3428586rdh; Mon, 27 Nov 2023 14:12:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IHN3lqXJvrCnrxO4wjy8z9M8M8Idw5pDTA2siZJdH1qqZ7NChCDVLAn3w5XiARok4gRp4UV X-Received: by 2002:a05:6a20:da91:b0:187:7761:6155 with SMTP id iy17-20020a056a20da9100b0018777616155mr19473155pzb.55.1701123147159; Mon, 27 Nov 2023 14:12:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701123147; cv=none; d=google.com; s=arc-20160816; b=bKtXpu1isJThfWfwIXVhC9ghGet6VqhEhz2n24tu4EHbnxZoN1ooPR4Sx0ArEj50ku gXnBxRvLYoe8nYHz0GBu4i7gZlUTvNGqlvC5d9NiwYgMJD7lEEqqgeSMGi2lGobI00F+ szyZucvqa2hZqjkgSV16b7yXbA+FP4Oo/YqLmJ64NqrKEg999SlA45YJzFKol0PiNFvO wcKc4LhXOvKWpjjIwlHmrjK+4z73FhP69Vax9eL9+qO/MWVCGiqI81q2SZ5/MNBEu6hb UKwf/P13XIjhWPchaHwL3M3qgMp2RqSWsbmSrq9BUZNKbvzVmDDN7268eSXYfdFfHYV9 bGNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=ac/6qiU0CE391qQluGr8+N93c3qEfm8YU+gNySdqzik=; fh=Io7x3OacpefNRRNKoYAzVE0aWTDwD7FRzyCdD1e3AN4=; b=OzNqICyo21UxGXQaf0HwgufcoG/lXzbmF7gaE4L7DUNdhr3OrMoPJuM3K4Uj3o/sS/ zv+a3KW98mAQ4QJ8BqLDlGtDXfa9fhdWX8giW7x/hx/fBLZFqSGxNEIdE5Db5LAjlpw/ QoibXlm0sZU9sARNckfmAfw+5UYapw2++o/7+8TMGl4krPvtk+MsP22xCibbxbcmg9nT BSERWDFadZLvfxr/PAvIHeG8pQdD0Lgb05UjHHOixojjIh0R3GPzt/GjbFGjinM49mYo 8JrFrZZ+RZr45PgrM5CVuM5+IWk++abxuSJ66eCmyzSohagtGDFC3t2ZI7/RcwuVlEqt FQ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ErWAzoVP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id jc19-20020a056a006c9300b006cbf0148335si9850841pfb.344.2023.11.27.14.12.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 14:12:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ErWAzoVP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8A7F9824E7BB; Mon, 27 Nov 2023 14:12:20 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233672AbjK0WL5 (ORCPT + 99 others); Mon, 27 Nov 2023 17:11:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234232AbjK0WLK (ORCPT ); Mon, 27 Nov 2023 17:11:10 -0500 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DADE126A9 for ; Mon, 27 Nov 2023 14:10:19 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5d032ab478fso22187397b3.0 for ; Mon, 27 Nov 2023 14:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701123019; x=1701727819; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=ac/6qiU0CE391qQluGr8+N93c3qEfm8YU+gNySdqzik=; b=ErWAzoVPnxhfE/+Z0Z8PJqkWEZp4g33EG283ml20WLX1eLobk99N90+qC4bcNfDOUd oQFCk1EUMQdMP0UTxmdrA1tk9O8AgpjA+HT6NTC1fjZLxA85zBkGRKBHdp3QQ6vqQdF+ LrzWutE9nG+88FZ2ReQLSrVpPy2DFXRfE7658E9fe8pUvIr8eThJZeofHy3bQptS/ArC SyEKWIZQ6Gc/xMWFn9fxoakiQKJCUTo+vhvAjfaeLalwGQRdhxObBWb7qOqcl36PWy95 FIbJJMzXZIji71S2IwxUnUnwc1mkL12ZDaTYyTXriaNlo9Vf5Fq7c0lopW39j/PUrkBm veyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701123019; x=1701727819; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ac/6qiU0CE391qQluGr8+N93c3qEfm8YU+gNySdqzik=; b=bnEGfDjA48qeTHm6C9TgKwgSqhW3M3aCrsy4KLPPjaYMw5J69MV297PtphDwkOa6cu /vBevrTvoO2HMr2zaZOrKTNURGUmh1DECjuKro2OQE3/XTMMf+C9PznPdDN7APO5Fu5x fvSWROHK3HwJibQwg8SbXd7lp1imkc7DCNqpAOSI49nq/R7FanANXHpmwUIweEIX6FBk NTriiVRhjmZNoo3gGDemCkkIyd2THQ/4L2Q+l0knbMfg8DX1La+eTYKVqiLXTOoASTIb +fTgG+5LNc8O69yHIM/q38OxGpKaj+yglVlavnzDGEog/77Gdd8Ypvapw/ynFMxOCL6F /UaA== X-Gm-Message-State: AOJu0YxPSAieSlPGLQVwjvpDbYHMWdwXW9oWI9SZ7Ymh16Qt7QH9BtwZ JkGaROYliaH6inZJu0cwTqVWRzg/PXkJ X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:829:6e77:9093:f39b]) (user=irogers job=sendgmr) by 2002:a05:690c:811:b0:5ca:f8cb:181d with SMTP id bx17-20020a05690c081100b005caf8cb181dmr425176ywb.3.1701123019001; Mon, 27 Nov 2023 14:10:19 -0800 (PST) Date: Mon, 27 Nov 2023 14:08:36 -0800 In-Reply-To: <20231127220902.1315692-1-irogers@google.com> Message-Id: <20231127220902.1315692-25-irogers@google.com> Mime-Version: 1.0 References: <20231127220902.1315692-1-irogers@google.com> X-Mailer: git-send-email 2.43.0.rc1.413.gea7ed67945-goog Subject: [PATCH v5 24/50] perf maps: Fix up overlaps during fixup_end From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Nick Terrell , Kan Liang , Andi Kleen , Kajol Jain , Athira Rajeev , Huacai Chen , Masami Hiramatsu , Vincent Whitchurch , "Steinar H. Gunderson" , Liam Howlett , Miguel Ojeda , Colin Ian King , Dmitrii Dolgov <9erthalion6@gmail.com>, Yang Jihong , Ming Wang , James Clark , K Prateek Nayak , Sean Christopherson , Leo Yan , Ravi Bangoria , German Gomez , Changbin Du , Paolo Bonzini , Li Dong , Sandipan Das , liuwenyu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Guilherme Amadio Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 27 Nov 2023 14:12:20 -0800 (PST) Maps are sometimes made overlapping, in particular kernel maps. If the end of a map overlaps the start of the next, shorten the overlapping map. This should remove potential non-determinism in maps__find, ie finding maps by address. Signed-off-by: Ian Rogers --- tools/perf/util/maps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/maps.c b/tools/perf/util/maps.c index 01c15d0b300a..fba95a00ecdf 100644 --- a/tools/perf/util/maps.c +++ b/tools/perf/util/maps.c @@ -700,7 +700,7 @@ void maps__fixup_end(struct maps *maps) down_write(maps__lock(maps)); maps__for_each_entry(maps, curr) { - if (prev != NULL && !map__end(prev->map)) + if (prev && (!map__end(prev->map) || map__end(prev->map) > map__start(curr->map))) map__set_end(prev->map, map__start(curr->map)); prev = curr; -- 2.43.0.rc1.413.gea7ed67945-goog