Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2190134rda; Tue, 24 Oct 2023 15:37:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9LfZhEp11615TrMJP8t0GtSBNmhfHaZxmSoGN9fN6XLPMCHLfxfWmCaRA0dreVaYQrEs7 X-Received: by 2002:a05:6a21:488b:b0:134:2e3c:9845 with SMTP id av11-20020a056a21488b00b001342e3c9845mr4451317pzc.22.1698187052782; Tue, 24 Oct 2023 15:37:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698187052; cv=none; d=google.com; s=arc-20160816; b=1GFjUNmrQl5I9CoJaWs8G+fE0A29S3dR3DdcHHW+NPZiYgPqsIOrgavViuCCVvw1jI kZq8a1Om0eEJ1bUetoE/ySRJrFmdjcUWmJIqQd/1qlmnYucxFHKlLcvAoxtbP0njmxe5 oxzQMyyjx/wS0jqOJkIUZ4oMGDZd9Z4uPWe86FY5TSZXuGrrHMD5JJN28cwN6H6pGjGx UUPI+N8ENQevgcQ8wZn2yykhA4GeZ6wZPcMAAF/ow0niOjEXCC2A170zB4UwwXsNMhGZ /rQASMch1Sj9Sy0qMlqvqcDwM8LTQUFZxQvABO0PBwTmd8EUzyus/L6tWquTBn16MASy BpBA== 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=zZGWaGIyb2MLTR6FKf9sQ21nNy6Say3HBAADxZHBZRA=; fh=NAro5oTsDEB2Or99ABwb774QJkwQSkr6EoLVqn/Yde0=; b=apWTJqMpFZUl3X37V7NxWO3Aci6/Vr9UEQx7iXxMsDCQv5RPtcHUDuBBeUeUce1b8P ZljwZKoGTeZHyg2LnDvRtXhY/cUg5tu/VYQ9BxP3yF9C8yH0jDUg5ef695afjZhOb0SQ Iqe1P+0Ea6BZodYJ6DEPTXwFyaQFvfSKphajWAJ3vAYLFfPboIPZnMPdftAwnJamxn04 3ZS2nDxdpY/1u9PLXVfODFVll2XVER1Hnf9hcf7PbJ5BKZgfD9kDtwyn1iHMtlB+sMLT 51m79qHN7R+taBlTksaE01oPDglYpFNZxQ5XltMqi7L7YRKoYAbOKOoP5R+/Y0NI0Ofg a7Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pRRwvyFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id i16-20020a17090332d000b001bf0916b665si9401995plr.393.2023.10.24.15.37.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 15:37:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=pRRwvyFw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 2180C801DD8B; Tue, 24 Oct 2023 15:37:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344678AbjJXWhB (ORCPT + 99 others); Tue, 24 Oct 2023 18:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344608AbjJXWgk (ORCPT ); Tue, 24 Oct 2023 18:36:40 -0400 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 BAA7730C7 for ; Tue, 24 Oct 2023 15:25:37 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-59f61a639b9so68801927b3.1 for ; Tue, 24 Oct 2023 15:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698186336; x=1698791136; 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=zZGWaGIyb2MLTR6FKf9sQ21nNy6Say3HBAADxZHBZRA=; b=pRRwvyFwnHwcygLAejayEt2NNSybuNbRUx0dieNKbFFQqJu7pI8tjFYOrawnhYicxv 1k0s8yf+6VTLk4WCYSzaql5nS7MVqnV5XCK/g8ICGM/5ONMACRtQHl5LAKKoiJSkVzpN ZsZSKpI+3/nviSFk61QM/s2HdbcWWOt3eneMrl1frMOC92ZOB0zCHQxiH+B+NMIeWo6/ OFeWUFRa8I2PAcYmzsGZW5u14sz2uGvKKMCPjejuiVyNyeB+62N037HQ9wkSImkPutMQ n/7rf3FqhGekKlkSqe3kylPdv2yUruR3m8WaAT2A3bPBlQtfL+ujG18gdSUrRdMs0DqJ +uLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698186336; x=1698791136; 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=zZGWaGIyb2MLTR6FKf9sQ21nNy6Say3HBAADxZHBZRA=; b=iF0NhXb42ayiOXxm3QBv9qYib3DX5PhiNTE0UFhLCAmEEgKUvUbnKo6SQHmbj5m9HK Vpq2g01QNoMjufQTTyYOSDFKxLdll33NJXOJFQxK82SJbxbj0lYbU8+a3+Im3lt1TRGJ ggzucvkpjLzPSQYqvvcnF+KbBe06fwKbut4tfrNeZ+a24QcCStmZ6vSeQzLSuCDQEJ+f wnyjUpf6YdsXhrIV823jto0hHmE8I6fUloTa/mZXmCfP7ZfDXaos2k4+8o6fIDc1c6/N pu+oha/tNSm8HUQ7VeLwPKX8l3M7pk1jr6VG7qLdi/HFXAhEDNL8rU+gI6PE96ry4f6V 0w3Q== X-Gm-Message-State: AOJu0YxZodC4Q2Ridl61+nkslqaHXJCoRbS1+1xCpPc/jKGd5Kuo9gwc pjpqwJIAkRjKhJ3LjmhR/SjBw2LmqXN7 X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:93d2:18cc:4d63:45ba]) (user=irogers job=sendgmr) by 2002:a0d:e8c6:0:b0:5a7:b54e:bfc1 with SMTP id r189-20020a0de8c6000000b005a7b54ebfc1mr337662ywe.10.1698186335876; Tue, 24 Oct 2023 15:25:35 -0700 (PDT) Date: Tue, 24 Oct 2023 15:23:40 -0700 In-Reply-To: <20231024222353.3024098-1-irogers@google.com> Message-Id: <20231024222353.3024098-38-irogers@google.com> Mime-Version: 1.0 References: <20231024222353.3024098-1-irogers@google.com> X-Mailer: git-send-email 2.42.0.758.gaed0368e0e-goog Subject: [PATCH v3 37/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 , Leo Yan , Song Liu , Sandipan Das , James Clark , Anshuman Khandual , Miguel Ojeda , Liam Howlett , Yang Jihong , Athira Rajeev , Kajol Jain , K Prateek Nayak , Sean Christopherson , Yanteng Si , Ravi Bangoria , German Gomez , Changbin Du , Paolo Bonzini , Masami Hiramatsu , 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,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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 24 Oct 2023 15:37:22 -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.758.gaed0368e0e-goog