Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp460487rdb; Tue, 5 Dec 2023 09:59:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGttSITLbc24ff5Ec2JQk7aCrdau5etGOR/mqDtjSYL1+QmuNqVPlaoKBa0mu3ieL38ULEj X-Received: by 2002:a05:6a00:420f:b0:6ce:2731:47b4 with SMTP id cd15-20020a056a00420f00b006ce273147b4mr1956949pfb.20.1701799186801; Tue, 05 Dec 2023 09:59:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701799186; cv=none; d=google.com; s=arc-20160816; b=K8QPYU/L8RHuM37bCTKEGpqBHZ/LbgUWwW9Kn4rW/O4OVKQ3VqAmcNTMsPeyidqrfu Va6/H5Z4oJudcqDsBQjuC963i+2Xv9teSnTENNLzs0nOyiWhz9iVbzcUFCVi8eLEA6JB P73XIxOaqhh5/AzCZpKe/tWabbe8pm8RMcySCe50t/P2/sFVlB19eOLRMiQvLsMSlGxB Y5ZCwhz50QoihSikSGA2kVVWKE9G2GBHrT0i/yZILa1y5KYxU9YhSKZxoRWfrTw1ikUR Yuot28zP6Dm6XVu5ZOLOA6FzBharFxTWYsL+QcnRMW9nK1T1blyNFUDFvjeyYGrEa6Us +UZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9gc6EPrb7sJMi5FLo8PEKP3q9XU/ASOLnpitI/EDUi8=; fh=Pbu1BQwhCOAA2d/C0IOLVYR5czI2/+Avx4u+s0uioL8=; b=Px/KycaKuMuXXzrphp+cyj7bLOAb1WYDmBw6wsHOyeH5dUXhC3Rfb9UG9N+K80zNg/ T9dexI/xU+Ue544bsJ5PrZmL0spiboJsUXQYWYTyCi2i2IcxO61SJ9d9/heegh7GOjrO c7D/3GmoL1C7PEfW5QmPccqGklvjYs9kyE5h33pDbIWjFzc/4ADEO7vAGXK8F9tcW+pL dn7GHfM76O3ZOu6+zetXXNh4j4H9y9Q5+PkGk2mLiEIGtHAg2MIMnc7RQxSw+Wo+dPq0 6nilwBdVmQVjjIstZWXHBrvvf35f8KQYHlPaOd44nH9cufpPJ5bvytcAfBFQ/cSNEatg 717w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=mUFzuW2j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id fd24-20020a056a002e9800b006ce11380ce4si6486709pfb.20.2023.12.05.09.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 09:59:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=mUFzuW2j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id A3687807744E; Tue, 5 Dec 2023 09:59:42 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232256AbjLER7K (ORCPT + 99 others); Tue, 5 Dec 2023 12:59:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229569AbjLER7J (ORCPT ); Tue, 5 Dec 2023 12:59:09 -0500 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD5FE1FE8 for ; Tue, 5 Dec 2023 09:59:15 -0800 (PST) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50bf1de91c6so101e87.1 for ; Tue, 05 Dec 2023 09:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701799154; x=1702403954; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9gc6EPrb7sJMi5FLo8PEKP3q9XU/ASOLnpitI/EDUi8=; b=mUFzuW2j4i5cHGKoIsxLhbYUhdPktzcy0ai1owCSBP+8qPTrxPivhBwn4bmdUquMYm aidNDWfKUBMPlg1hX8NmQpjjiZLRlPP1OXLbFOGDr7C/Ceg3uLDuZ1EsIC6alU4LHCM8 IVx9Hsk1VNuLByjJfbxBc/JmYqLqe45IQA2UqhsWezV6fNJcZEboRSLmkqLU+tSyf9uO Mhv6V/2LNhvW6zuA7/0I2tm6ZfUr0AETm4q7vspZJIaklTjk0htDJZgQibcZ9czCbWbu CWOGzBUd0lDl4HFmeZgc5DnHuIaRvteohM6UT9tKDEjswT8fYyvg7IW7q0e6+MNU8tDW XO5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701799154; x=1702403954; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9gc6EPrb7sJMi5FLo8PEKP3q9XU/ASOLnpitI/EDUi8=; b=oAszzDxAvGc5CRjTafmHBtvCj2w1xcA/uZ7iLVXlk+zQ812n8yBe0PxBnXkeeaMDR5 9KFdcBFJo0WJFGtvIzGp/IAhoOMBw7TiOlbhuzVW9gfkFKrrW8r+gmjor3XeB+u2kgVF FPvB78GFwqSSl5WYzmFFVrBriGMULMmRyoK5j3fl5k+YZU9vNTsV3gCGIZrMa9KmX/89 d1kaZZbSrsOmsV1wgkXCF5RElsJ2gXIkHxwrLatQYFjBMgFiVGhHyN1wKX+jDe1TwYmV iu9JNf4AWckXDroarIPSlypw1OWMqV4dKwlIiTJ3aqNM7KjM56XUlcXwQGqgESJjN0fc 1N9w== X-Gm-Message-State: AOJu0Yxq8ldu2ZSpDlUGMi/Ip+BChiWeZW/EkDaUhWpccISoQjU1EWnl czosMRJg6att7JeBI2+4TZv54uo6b3uKuwFeA0w9Cg== X-Received: by 2002:a19:7418:0:b0:50b:fa8d:f28b with SMTP id v24-20020a197418000000b0050bfa8df28bmr149957lfe.1.1701799153760; Tue, 05 Dec 2023 09:59:13 -0800 (PST) MIME-Version: 1.0 References: <20231128175441.721579-1-namhyung@kernel.org> In-Reply-To: From: Ian Rogers Date: Tue, 5 Dec 2023 09:59:02 -0800 Message-ID: Subject: Re: [PATCHSET 0/8] perf annotate: Make annotation_options global (v1) To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 05 Dec 2023 09:59:43 -0800 (PST) On Mon, Dec 4, 2023 at 2:46=E2=80=AFPM Namhyung Kim w= rote: > > On Thu, Nov 30, 2023 at 10:37=E2=80=AFAM Ian Rogers = wrote: > > > > On Wed, Nov 29, 2023 at 3:56=E2=80=AFPM Namhyung Kim wrote: > > > > > > Hi Ian, > > > > > > On Tue, Nov 28, 2023 at 11:14=E2=80=AFAM Ian Rogers wrote: > > > > > > > > On Tue, Nov 28, 2023 at 9:54=E2=80=AFAM Namhyung Kim wrote: > > > > > > > > > > Hello, > > > > > > > > > > It used to have annotation_options for each command separately (f= or > > > > > example, perf report, annotate, and top), but we can make it glob= al as > > > > > they never used together (with different settings). This would s= ave > > > > > some memory for each symbol when annotation is enabled. > > > > > > > > > > This code is available at 'perf/annotate-option-v1' branch in > > > > > > > > > > git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-pe= rf.git > > > > > > > > > > Thanks, > > > > > Namhyung > > > > > > > > Thanks for doing this and I think it is progress. I think there is = a > > > > common problem with having things be an option rather than say part= of > > > > session. Having a global variable seems unfortunate but I'm not sur= e > > > > if in all locations we have easy access to the session. > > > > > > That's not the case when you deal with hist entry or TUI browser. > > > I think that's the reason we have the option in the annotation. > > > > > > > > > > The rough > > > > structure with annotations as I understand it is: > > > > > > > > session has machines > > > > a machine has dsos > > > > a dso has symbols > > > > a symbol has an annotation > > > > > > That's true. But the annotation struct is used only if > > > symbol__annotation_init() is called. > > > > Right. I find this approach likely to lead to errors, such as a symbol > > created globally before symbol__annotation_init() was called breaking > > the container_of assumptions. > > Sure, but that's a different issue. Maybe we can add a hash table > to map a symbol to annotation or annotated_source directly. But > I don't think we need annotation_option for each symbol/annotation. Agreed. > > > > > > > > > > Annotation is something of unfortunate abstraction as it covers thi= ngs > > > > like an IPC per symbol (why hard code to just IPC?) and things like > > > > source files and line numbers. > > > > > > Right, that's why I splitted the struct annotated_branch. > > > > > > > > > > > A recent success story where we got rid of a configuration variable > > > > was by switching to lazy allocation with sorting by name for symbol= s > > > > within a dso. If we could have a lazy allocation model with > > > > annotations then maybe we can do away with large hammers like globa= l > > > > options. > > > > > > Maybe I can move the pointer to option into the annotated_source > > > which is allocated lazily. But I don't think it needs to keep the op= tion > > > for each symbol or annotation. It's usually to control some display > > > behaviors in the disasm output globally. So I think it's better to h= ave > > > a global variable. > > > > Sgtm. My point wasn't to criticize, I think this is a good change, I > > was just trying to imagine doing things in a way that could overall > > reduce complexity > > Yep, thanks for your review. Can I get your ACKs? :) For the series: Reviewed-by: Ian Rogers Thanks, Ian > Namhyung