Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4948032rdh; Wed, 29 Nov 2023 16:01:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHxYvVhAk8igOrooqWH0e616AUPcMO4KT51MDL8KPt9k4YHj8gL9dRRFQb4rvq1ClzpofZ X-Received: by 2002:a05:6e02:8e1:b0:35c:9309:81d1 with SMTP id n1-20020a056e0208e100b0035c930981d1mr17510305ilt.29.1701302508613; Wed, 29 Nov 2023 16:01:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701302508; cv=none; d=google.com; s=arc-20160816; b=m8K8cXWPi8J2eSGrenGlrCf7MnHzGq4fdN7GsIMS6i5EBisPjRsq1I0LGqhQvVRG6m B5WcalcYhimGi7QZR8Zrze2/W34dUhCc8fU+iBKyaIh+HXl3KdqYpUjTR5Wqm8DVT+Oc zSujqOdB9DNmxCAFOyMEpS80uh4vORS3BUwlgpwV3HzDGeYKcj3G4vbVRquliGOSMt+Z ISjvleL8gesbcAtnVUUEgcMtSc3F1uCvz6oRtOwiIPrSMCZ90X2AhjfUM1fyIVtjb8il coPwaHOGNziPJT2TAHH/hTY+n5S46DLMtysoP2r6F+fZlGCE3KWb6H9zAtHMDdIytU84 7fbg== 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; bh=Lam7ncZLl+yVUYdn708SB4ETMCatc2mdJ0XG3u3QOqY=; fh=4Kgt7kDtVrIXe4cKNywMQAY7jLnutXL9uOkaTa5MrMg=; b=AvuiT/wPAzRaxs+fXPoS8Xh00N7z1On3sw2c4YeI6YnSzFFYu0iBDtrO3TgqIoStj6 7AIVxFXi1idbXaIboWloU/9R1bC6ANXtFDPuXWP8gmLMUFOo5zn2QzwXrXN/g5PiSfzJ akVcFa+tk5UT4LVWPeY89WMjVbdYkWA4zrkEl1ZI/73qP1wV3h2SSXdzyeztajfVA9Sn 0OczHXwaucnhuWxmoa+FZU3ktYC/ZC/qzcmhwbiThoLNESQBu+6kWSIpgjol2nb7Sapv A9/sg9YTsZfYszXCk4E9JI5GibL7xNufhih7ympynh/yFyjH956D01ouEQQOyzJNFZt6 sCKw== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n68-20020a634047000000b005c21d7ee51asi15523511pga.301.2023.11.29.16.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 16:01:48 -0800 (PST) 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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 897898031136; Wed, 29 Nov 2023 16:01:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231587AbjK2X4o convert rfc822-to-8bit (ORCPT + 99 others); Wed, 29 Nov 2023 18:56:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229575AbjK2X4n (ORCPT ); Wed, 29 Nov 2023 18:56:43 -0500 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 684B110C2; Wed, 29 Nov 2023 15:56:49 -0800 (PST) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-28613d87c4cso398494a91.3; Wed, 29 Nov 2023 15:56:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701302209; x=1701907009; 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=dyQl4Vy/rEx3cdSpEiRXOw3IV56Abu0Xky4Rbxj2uHw=; b=VsOMszPlF/a39vu0arMliKClNCPkj8EaEgUrDNrgdLUSemSYx1B+G+6Bva4FAiHeS+ 0kKWYqJDEfjtIGh0057No4GSYw0Ny9Mfq1K03wjPIBi8XoXbDS8Tr+5WD7M+1WzLHouw JIznvx41Rw5nuutQsv3i6s44ilU9Uvtf8tRstPSaDhzO17WeL/+v/tlGkIrEgd88T3q2 4+/DFQPU0tevIEh/MXxY83/hCvGB0Lyf+7eIV1c/LlBAYzd3YZ/yRnTDHhge1Ep973Je LLkGCP/BgHhPe3VRiaKUz7SANKPl4NN05NmQT+g/x6BjwXYmUB7ZmBYNdQIgRoyQw/sd +D7w== X-Gm-Message-State: AOJu0YyZUdm3l5ZcNZi2HxztIKv3Tpj4OyfZrl6XZ5SzdKw64l7CNRzt VfbQ/Yjr3Zm2xVKrrrbhsrnTxMIxPtKTcm8s9Qk= X-Received: by 2002:a17:90b:2b50:b0:285:9e58:1bac with SMTP id rr16-20020a17090b2b5000b002859e581bacmr19346035pjb.27.1701302208691; Wed, 29 Nov 2023 15:56:48 -0800 (PST) MIME-Version: 1.0 References: <20231128175441.721579-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Wed, 29 Nov 2023 15:56:37 -0800 Message-ID: Subject: Re: [PATCHSET 0/8] perf annotate: Make annotation_options global (v1) To: Ian Rogers 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: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Wed, 29 Nov 2023 16:01:21 -0800 (PST) Hi Ian, On Tue, Nov 28, 2023 at 11:14 AM Ian Rogers wrote: > > On Tue, Nov 28, 2023 at 9:54 AM Namhyung Kim wrote: > > > > Hello, > > > > It used to have annotation_options for each command separately (for > > example, perf report, annotate, and top), but we can make it global as > > they never used together (with different settings). This would save > > 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-perf.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 sure > 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. > > Annotation is something of unfortunate abstraction as it covers things > 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 symbols > within a dso. If we could have a lazy allocation model with > annotations then maybe we can do away with large hammers like global > 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 option 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 have a global variable. Thanks, Namhyung > > > > Namhyung Kim (8): > > perf annotate: Introduce global annotation_options > > perf report: Convert to the global annotation_options > > perf top: Convert to the global annotation_options > > perf annotate: Use global annotation_options > > perf ui/browser/annotate: Use global annotation_options > > perf annotate: Ensure init/exit for global options > > perf annotate: Remove remaining usages of local annotation options > > perf annotate: Get rid of local annotation options > > > > tools/perf/builtin-annotate.c | 43 +++++---- > > tools/perf/builtin-report.c | 37 ++++---- > > tools/perf/builtin-top.c | 45 +++++----- > > tools/perf/ui/browsers/annotate.c | 85 ++++++++---------- > > tools/perf/ui/browsers/hists.c | 34 +++---- > > tools/perf/ui/browsers/hists.h | 2 - > > tools/perf/util/annotate.c | 142 +++++++++++++++--------------- > > tools/perf/util/annotate.h | 38 ++++---- > > tools/perf/util/block-info.c | 6 +- > > tools/perf/util/block-info.h | 3 +- > > tools/perf/util/hist.h | 25 ++---- > > tools/perf/util/top.h | 1 - > > 12 files changed, 206 insertions(+), 255 deletions(-) > > > > > > base-commit: 757489991f7c08603395b85037a981c31719c92c > > -- > > 2.43.0.rc1.413.gea7ed67945-goog > >