Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4081014rdh; Tue, 28 Nov 2023 11:14:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTS4olsRXittGzUBfw/LK3laKCeqNF9Hcc+lJQ/wrzGZViM9XKptK/gRnumCr8yyNWV07J X-Received: by 2002:a92:d64c:0:b0:35c:87da:3cb9 with SMTP id x12-20020a92d64c000000b0035c87da3cb9mr12214819ilp.19.1701198871113; Tue, 28 Nov 2023 11:14:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701198871; cv=none; d=google.com; s=arc-20160816; b=rcAiXtOVFYARSAcJUJLs2fUJ0qROpRTLBdQlC02pC+1iIBsk4o31wPZYh+mIdfCiaT fKtd2Ov1hWtscgKP1QuXeHTpllbzPq1PFaxPGgRFwE6xSkyqwkvwZBGn6+kLWco55eM6 CpTf+7pL1dKUfvtxjyHH/tliu1ate548p+N0fqbxZvg8rdFCSpKt/QJPw3H4s96Pgmzj IISygLbE+ShfL6rQhJGwuwPp3Znvj+++iLOsE8GQOSan+3zrzY/j8Dv0duE1NzSo+lip +xwjO93kJo85ehdcH17o4cLmZyngWCPCr5gWXoWEvhWaFyz8YvusgkssTlIfurKec9Sv 2fNQ== 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=1sQJEQO1lAXLUO7lOurIsnWNVY/yZ4K1PFUY114AiIg=; fh=Pbu1BQwhCOAA2d/C0IOLVYR5czI2/+Avx4u+s0uioL8=; b=O8u3dzKwfr881rDYXEF/9LhFitrN3abGkQLUwuRiFTdgVHaeASpCntiEIlpPuJUykX 353ON52mrkDsLpXefV2ilwGnwBVODXPXyo0A+riD2eLCKdNQ1KAGBWbc5RMOQfOpq6Kb fop6pDPshg8exGaXIfLgAY/p77mKSObb27jL2lxRtA+gVCmtNmzG/27h6T5swezp1tyc Hb2z68vRq+0qy/xdYL7TQ+0nJggy5SV/Jy0BB89afD0WRzk+2TbXz+cRbQBp3pZ+z6WC 6qcetusP6uyf2gA6gxKd8zIpWwkp3QknvXi8guaPDWL7uNzx6Ci0wALptWR6NPCyoGU4 7RzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=UTiD8QGp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id 31-20020a63145f000000b0057760853706si13019671pgu.578.2023.11.28.11.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 11:14:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=UTiD8QGp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 739EF80659B0; Tue, 28 Nov 2023 11:14:27 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346160AbjK1TOH (ORCPT + 99 others); Tue, 28 Nov 2023 14:14:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345286AbjK1TOG (ORCPT ); Tue, 28 Nov 2023 14:14:06 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FEC61707 for ; Tue, 28 Nov 2023 11:14:12 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-40b367a0a12so9185e9.1 for ; Tue, 28 Nov 2023 11:14:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701198851; x=1701803651; 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=1sQJEQO1lAXLUO7lOurIsnWNVY/yZ4K1PFUY114AiIg=; b=UTiD8QGp5Xp1eKjwifmVLLr7sxUtHpUEziO2Noc8x1Sa37ahGCzd70cf9mCLlsriYR HZD+A+nLCdmaZgOAt1LFCEdH0a3v4V5/yO8F5ej7JhiIyw4AJS+wSsRA1Eyw7RoNmHbS kEprG0pVuaaVo2AYOfUQIfypUCGP+UKZoRh2lSKEO06R8raWtHeTgJvRQCCmC9b+p6T3 5id3cBOWTHJDTewr1W4SgT2jaTr6kna3vAlN3wTGnrJqg2ootaVfB373R/jCYusW81go 3ib+Dg2t2i5xOP546YGZTw9JSZrLDP9pCGbzhpZDIACDYc9IVXsiZyG/jjKB0ZMFjimt nG+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701198851; x=1701803651; 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=1sQJEQO1lAXLUO7lOurIsnWNVY/yZ4K1PFUY114AiIg=; b=hfWfVaHY8zPfMdqFAiIo7hAHRC0qryPGqKRQZnpNfZiEoqmYqCbAmHJTommXNXcpTL FQsMGViPstQTfZVkgTBWiXIwe4Oobm3ugHt+lJCwFOTIisOJjs2Y54hZXb/fOTjbxcVN pkeppK4Rlx7HFswYOlaRamP46X8MMlZUJIvBueEDY0tHTXUMeUV+o34FQ4R17hONEpai SGakjy4pbm1rc9bjQoG7p0eWB3YnuqmvwVCvqnnrJosHW2LjzwSkIyDPFN1OkeFsniBm RmsKj1wSqyQBSLMOszQKTmlET+10K7pDyk+nI4oyNfPGCSJnwOf49RCZ/EOd/Dyh09Hj LUmQ== X-Gm-Message-State: AOJu0Yz7UNb2l8YKeczefRTPuaAiyJLZnKggo9iIviGclAK9KCA6pl6U NWGz5AqDMmowMxy4FcE73/O6VSaKa1FRoin3SMD2mA== X-Received: by 2002:a05:600c:4f44:b0:408:3727:92c5 with SMTP id m4-20020a05600c4f4400b00408372792c5mr852331wmq.2.1701198850618; Tue, 28 Nov 2023 11:14:10 -0800 (PST) MIME-Version: 1.0 References: <20231128175441.721579-1-namhyung@kernel.org> In-Reply-To: <20231128175441.721579-1-namhyung@kernel.org> From: Ian Rogers Date: Tue, 28 Nov 2023 11:13:55 -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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 11:14:27 -0800 (PST) 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 (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. 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 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. 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. Thanks, Ian > 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 >