Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp555283rdb; Thu, 2 Nov 2023 11:01:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7aH3Oet3bBw2FCyaqK8O8M1TyQb0P92FGsZrgXC6pHrJgC4SwSjpvDtCDsaUR+M7LngiF X-Received: by 2002:aa7:80d6:0:b0:6c3:38f5:99d2 with SMTP id a22-20020aa780d6000000b006c338f599d2mr1516720pfn.11.1698948094545; Thu, 02 Nov 2023 11:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698948094; cv=none; d=google.com; s=arc-20160816; b=igtm3shKfbAAjWMYVaYlMExT6St50AjV89wKz8bVYRVss2FE2U0rj+FsEJikD6iWQx +A5i460QSjuOXh8P4WbMbrIynrwi653f3pmNDsr5TA7BNyNpVNdIJJg8aZ0yQWpoZn7/ v4/gYR4YWTznRK7G8IjpMiD0kH2YojiE12O00wu3oAp2anIM1/C52SV+OSWszeNUFAMa gv93LsZjHF1bc10gLaTrceO7UysJp70Nps+Rxicb1aM7bnSf4RhvnRtcBmzBqUO9dnA4 MGX1fU0nCd2k2KMStrR3s+BKDe1tallpqj4vBBWy+A3kCxD3yjZNUXu3Ty9cNVbejHL4 08Og== 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=kZBuX81183QRrNaiqbrsOc3T/YgY2oF4/Db+YNFRBBQ=; fh=z1KcSqUpYQ9oC4uLSeIkhAYTnJ2bvP0QbNW2xqV5NqA=; b=UQ+5iO7/0I8UmjYcUsqPLrSY6HVh8s9aneoOl6ZA54P+Aau3+YAgIOyHJ5RQHLYMqf WUX1U4LJ7UIQgqZ17xZBI367BgcfEYkFmMWEcG7J17WqI/3UmlvaqxapikMqpkp8a4fE W95yBY83iXCgm7FkKx1muPkUpFR1J6d9RMo6ou2avOQf5iFlMGxPxWNir9ih48fev5Ax 8f0J6hea84ujmM1+X3ryq4k4LJ7+TYtYsxil6C6m05kYc4CksVzfkQFOVQ/x71f18IGa kR/Ho8fC83KbGEriYXtx82TlCvqhEeUFVeXEVfO/6iNrnT5MSYTJcPEm4FZVIM9nRghz RK2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CnWi1pUO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n38-20020a056a000d6600b006c081a3fe4dsi64061pfv.259.2023.11.02.11.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 11:01:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CnWi1pUO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 29BDC82155C8; Thu, 2 Nov 2023 11:01:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345724AbjKBSAd (ORCPT + 99 others); Thu, 2 Nov 2023 14:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345059AbjKBR7u (ORCPT ); Thu, 2 Nov 2023 13:59:50 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEC53D77 for ; Thu, 2 Nov 2023 10:58:58 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-5a7af69a4baso17193977b3.0 for ; Thu, 02 Nov 2023 10:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698947938; x=1699552738; 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=kZBuX81183QRrNaiqbrsOc3T/YgY2oF4/Db+YNFRBBQ=; b=CnWi1pUOApOSGz7yPQQN2/n66MaHAO7Hjl2ZVWURDfA5rrkBZPFC1ahMouJimPDjaU AxO37SZ/AXfly5TXSnzvXhQJgcbmM0mqVIY+Rvt37lWITKM0bJp4di7KWDcSB1xnnKYr xvJBjsiHNJGS+/KlnxG7SsQVZcZTUHtXi5bjm4Pw/NB4BtZMUrq+ypP1jrumyV9modXO 3sQgVJq1ji87YThnejgrDysCajgLCD3J8ObCbu2rPXOuBxGUjBN6Rmxt5YTwOhkBW/DQ j8XjmsqRn/2r7Nktof5dpjCoSv97OP7WvcWloP/Ik4VL+i9e9dOt1oDi1Yohm72JiGUs ihBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698947938; x=1699552738; 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=kZBuX81183QRrNaiqbrsOc3T/YgY2oF4/Db+YNFRBBQ=; b=crYhmgTtaxzoW+AbN/LN6NMh/ByMxQeVaT+6s+3Z87bZXjZZn++Y5hjRY/WkDJYqlA 4GZFc1LFXCMPTKb2PpP49gTnUdNQnpYMDQ2QLWhjhWMJQ5OIUbd05hJIAVlKSDkFQ9sy A/Opywz4jo+UzXpyUjgjsZb+mJQoPDSyHZzugMEWrbtZZqyPPKE9R76GdJu/jCZca4I/ omnxU678+IO2DSM32c0u4hq2y2K5qmi3qYwxLe83AhioGfktPBquOVFqrMmPy0OJ2LDB NrxWo0oJLsLK8jJSPJW2Z8BwTB5OlhGrlx1lVT4BESisqbviCxAdz6/F8wlI0MdhmBD3 15RQ== X-Gm-Message-State: AOJu0YyeRSe7f7sU5IsAidNbKNwYYf5ELnTxs+OrMqtSpL8Rk8NPKiro XYXfADzGGyCsG1AEquhc+87t3FsP3RHF X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:bb34:df9c:836c:afca]) (user=irogers job=sendgmr) by 2002:a05:6902:1083:b0:d9a:c3b8:4274 with SMTP id v3-20020a056902108300b00d9ac3b84274mr460470ybu.7.1698947937955; Thu, 02 Nov 2023 10:58:57 -0700 (PDT) Date: Thu, 2 Nov 2023 10:57:09 -0700 In-Reply-To: <20231102175735.2272696-1-irogers@google.com> Message-Id: <20231102175735.2272696-28-irogers@google.com> Mime-Version: 1.0 References: <20231102175735.2272696-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog Subject: [PATCH v4 27/53] 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 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 02 Nov 2023 11:01:14 -0700 (PDT) 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.42.0.869.gea05f2083d-goog