Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1364152rdb; Wed, 6 Dec 2023 17:24:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyzrNQBGTceIv8jqtJEXfbhWaM0/xlSILAMnVvGEAmHMKubm0rdoGnvE57E5DVFttreWp1 X-Received: by 2002:a05:6870:fba5:b0:1fb:75a:77bd with SMTP id kv37-20020a056870fba500b001fb075a77bdmr1881954oab.110.1701912240776; Wed, 06 Dec 2023 17:24:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701912240; cv=none; d=google.com; s=arc-20160816; b=ajUwMs4gKRt3ziMry/rVv+wDfMmBIse7t6k0OopXYtKwnVq/OQhis90EbN19VwGAoI mqN4bdxBP9v0e3VAaftUA1UNxf1+iIhdR+1ql3DKn457xCovlYSsJhr3Xs6vVO5guknq JxH1XgT6FqIBNVW77i2MXWsW5vGlK/Wto24GJuZLN6uJdwY3ZYBBd9mCZ28l+qItUyvC hEKf7SGiInniqJGq6p2iA2it4zzCVT/2bUR0NfrKBwcmkQbfsm8I0TONnn+clZk3XyXe VXm6fHQL4tKWQPbBzr9zpuEXAdCf/C/LQD6JvUZdhy+6En3LyEOKFQCDsIa6aNireefT Zr2Q== 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=080Vne9luGbMZqG9+uC+XiM2BHOgF/5Ti1/3JRRVPt4=; fh=Io7x3OacpefNRRNKoYAzVE0aWTDwD7FRzyCdD1e3AN4=; b=JG9Yycvtg5tUUTm5WpcyFsJm/OAtEkM8i+O0naG3U/tD+TTwo8G0EVrh1+ONBEFk4f 8uswBt7HtTrfeUDZxjhQLltk/3HRGHLlisF0LiA84ibn+8PEPl/m9ebxuOCQKsIf8u1+ 1ERK4CJmp0fhnKy+sKRa1xT5XdOgdATgOZix+nWEa2cxKhWGY7DXVUDC9vMF+Zic1++D YI17/4ux7HxzNDFBQtGZfEaqFlehY+sF0G8Mcs+lu6HJw5ki0ozK5yLLjrSmikLc2OB3 SwrzXpMw7c1koTRri/+pA79YvFy/Grqc4N7NZMXj8xAMIsO9CPMsAc6EGi+JRE7vYubC JpHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=p4eqo5IN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id s23-20020a632c17000000b005be27af74basi231601pgs.33.2023.12.06.17.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 17:24:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=p4eqo5IN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 CE8688411881; Wed, 6 Dec 2023 17:23:43 -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 S1443118AbjLGBWw (ORCPT + 99 others); Wed, 6 Dec 2023 20:22:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443028AbjLGBWZ (ORCPT ); Wed, 6 Dec 2023 20:22:25 -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 33C07D69 for ; Wed, 6 Dec 2023 17:18:19 -0800 (PST) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5d8da78a5fbso1682717b3.3 for ; Wed, 06 Dec 2023 17:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701911898; x=1702516698; 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=080Vne9luGbMZqG9+uC+XiM2BHOgF/5Ti1/3JRRVPt4=; b=p4eqo5INaoPbamFeVR49NReo+CxMmLU6+CG2r0+wdu5piDGHizYYEydMgsHRprRqzk 7cE6EhfJu3s0tPKjPHVl/ZuIfIkdCYHyXvZMshC0CobrumfOTBKVblmEfHQl88XgHdq0 yk954OC3RXiFjUHqhm3DOlDF/qmBQIlLkvNoBbNT23D2fbA9qEP6de1JqiU2lvH1KuJx lAGFB8eZ3lhsYaLC0trDhYpO6akM+YDoeJkxH6X/2tv2RMiA2KLDZGzQ5zx9NJQwa1NZ DN9Or8a4R+/J1R1VPEcCxMe5tEOVhB+qm7u2toDmgt++f7527HXsYg7nQfiqp6AAGIkd f+yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701911898; x=1702516698; 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=080Vne9luGbMZqG9+uC+XiM2BHOgF/5Ti1/3JRRVPt4=; b=PhfG9K4beF0om+CpYbfaknXLRfi4FoEyCUV+c13/Fv+eKWXzsMpQsLAscj2Jlj5C0H NUut0dPhBOZSMKcVVBKrV9KHqbjsnlEGAjOwWQp/5fr3T8CyA1Xas5kghihk3l7eE1nA 64nn1bOKdZvthelTlHRNfseJlbgW0CJqCCoveMfJGbrAkMYyREsHuHWdpCHYPTbenmM8 u3tHrmUx0tWT7P2DlHmbi5Ibb0OAYsD2jmO5OS/EB0YAlQVy1Jve5idMt042CRWhXtHf ITPHnsfmtI+VmTOkxYretIQYZ1/bEQnuJI9kZcN4gt6T+ddB+Y4I9jmxpT/sagUj90Ns UNYA== X-Gm-Message-State: AOJu0YxbTrz5UdRsXheFkO1zkig1fQAsUbsd90Dxubm7kyvsxJT/h4GK C00UL1hRV6SWwSm07EQuk4+lNlihl0ug X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:35bf:293e:7696:34e9]) (user=irogers job=sendgmr) by 2002:a81:ad24:0:b0:5d9:20ac:5126 with SMTP id l36-20020a81ad24000000b005d920ac5126mr26333ywh.4.1701911898601; Wed, 06 Dec 2023 17:18:18 -0800 (PST) Date: Wed, 6 Dec 2023 17:16:56 -0800 In-Reply-To: <20231207011722.1220634-1-irogers@google.com> Message-Id: <20231207011722.1220634-23-irogers@google.com> Mime-Version: 1.0 References: <20231207011722.1220634-1-irogers@google.com> X-Mailer: git-send-email 2.43.0.rc2.451.g8631bc7472-goog Subject: [PATCH v6 22/47] 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" 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]); Wed, 06 Dec 2023 17:23:44 -0800 (PST) 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 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 dcd67384d877..0334fc18d9c6 100644 --- a/tools/perf/util/maps.c +++ b/tools/perf/util/maps.c @@ -701,7 +701,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.rc2.451.g8631bc7472-goog