From patchwork Thu Nov 2 22:26:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 16204 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp679278vqu; Thu, 2 Nov 2023 15:27:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFbwWFlKII/cx6ivb4YhRthzPrwRmeNrSNBYDxWXl3lxO+YT0BxG3ZcFjsyahnk+0dVAL2x X-Received: by 2002:a17:903:1104:b0:1c9:bca2:d653 with SMTP id n4-20020a170903110400b001c9bca2d653mr23150439plh.11.1698964044182; Thu, 02 Nov 2023 15:27:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698964044; cv=none; d=google.com; s=arc-20160816; b=G9GuESUSWZ8nrTTZkYKQ+NAiVD1MRtdO+Q7gGWoWg1BYJTbISfLbxQkWDeI9HWGJyJ WUeZEuadDgMDkaBEVw9IgaXa/GRxQexmDnVHIIS//jSZR2Os3Mh017iHvFMDI2HnyAAA g0LwxYd7fsZG0DNmOFhEdHxweHg1lwwySHziP5RCXqSd5QBspUyGYwG534KCYkeI4rg+ C9dwTQK/tgJfl8N3BoklwuO6cytkl0Q+CvTYvcvTbI+fCKNkiMqiAJTWAlQFjmI9fq9V Hxp3Xg68muOtXObRBkgZU5pd/j1s2UXRYx7pNjZhHiwxznSwbrXE5Vapa97uZh8zyKvk gq+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=TjmpE0gPA0E82Gx4VbLnVe9nx66Z7Ry4rmjC/WuSGb0=; fh=/TViaxNXj9Ubl1KVZseJCqJutBKG0dvzf3DPkf/1G64=; b=SLhE/pTm6aScEcux3oCO/iAtJxJxu9UfvCc5kW71Crp2U151Gz0yBJsTM7FXO5X62I Ignk59yhWNr7BH9tBzro3GB0shIvos1A0z9psGYXYVXQFX2iJhywyGlTAtS0ouztSHKV dWzrm5ECN9WpFFsxl5Iz9GL+G9bS94UeAfsq6FV7U80pOMTz+PrQkDFneNhuHzja7tHE 5qvxm/pqiZcVbWdN2ZzUyUIv05O0ZuQpTTMQ8sXSW9/oWmCCJKt2ARSJK6R5Es5dKLhd Kmmfm5NqgBFWG6Z2FKE8haw33YanRuSolYq8y5jwoPV5IYLlp2oCYjqDUSvx4SzaEL93 iBYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gS57c+lY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id h8-20020a170902f54800b001c77674ea97si372289plf.423.2023.11.02.15.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:27:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gS57c+lY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 561C68115472; Thu, 2 Nov 2023 15:27:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377494AbjKBW07 (ORCPT + 37 others); Thu, 2 Nov 2023 18:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377485AbjKBW06 (ORCPT ); Thu, 2 Nov 2023 18:26:58 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3914FB7; Thu, 2 Nov 2023 15:26:56 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5b9a7357553so1177908a12.0; Thu, 02 Nov 2023 15:26:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698964015; x=1699568815; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=TjmpE0gPA0E82Gx4VbLnVe9nx66Z7Ry4rmjC/WuSGb0=; b=gS57c+lY2XVefQFdw3VkeOsR7hMrJ3kN+XzP/XjsGZtsBGggbspv2mr3vgNat8G/UO jh8JC+TDu30CVF9O/ZA7ZSbQDtWeO2S5qJHuVprm/8e8XlSai5wK9m13WQQfC+bWWfw0 74SBTqXrbMDN4Mq5yD7WW/NzF3vh6A+8436bEELLLdiEiLaAP4FW0ie8ImUbAIEPPDyy Iw3fYPTgyf7Lji3+EGats5h+H7NclHXBQHGZo5iD3p2S/yp/eSdZrWbMNnwbwWp9b8fp uqUztU1PxcYAAqFb9xMmGl/kVuVghaSDd9/M7MFbkO2nuYLlSgt+ka1RDdYddM4haGFR FIhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698964015; x=1699568815; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TjmpE0gPA0E82Gx4VbLnVe9nx66Z7Ry4rmjC/WuSGb0=; b=MTsy/LM6GkgJojWxYUmcXjRhDVPAUwnyF0vOQEGctgN0vSied+uWrvCy7VNzmIGO3k tTH6cLAuPZ4h4OL77A53bm139XbKXxlXBMemuqPH9oDbb/yXSVCBF6moI4e5cBi9GUJ6 skFhuMIFiMwsIgG5GMXR0hDZZ9FjDeX/Ygo0eVHEOLqRfBOnpM5v1YjD5fYovjka2SGq OFC3EcQ/ISdWKB/FYmdaoXIIjQlsm/gAgYDr6GpFcSaQ/zoKqmWjEisaloIq7ESOtZfX LBiICXohOHiAqODf3VK03iSrx4TRryRvUSfrzwD/jTN0+QXaRobhIo3wETtHBIxwfJMO 500Q== X-Gm-Message-State: AOJu0Yz4I78iHUoTXLub0tFOMUxcYaOicDF6r/0z95hEfDkpFPc3h69F 08z2d25SUv0dQwp+p8shd7nfgmuo76k= X-Received: by 2002:a17:90b:4f91:b0:27d:3f0c:f087 with SMTP id qe17-20020a17090b4f9100b0027d3f0cf087mr19355978pjb.25.1698964015475; Thu, 02 Nov 2023 15:26:55 -0700 (PDT) Received: from bangji.corp.google.com ([2620:15c:2c0:5:ea22:bed1:d67b:af04]) by smtp.gmail.com with ESMTPSA id cn18-20020a17090af09200b0027d015c365csm309894pjb.31.2023.11.02.15.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 15:26:55 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: [PATCHSET 0/5] perf annotate: Reduce memory footprint (v1) Date: Thu, 2 Nov 2023 15:26:48 -0700 Message-ID: <20231102222653.4165959-1-namhyung@kernel.org> X-Mailer: git-send-email 2.42.0.869.gea05f2083d-goog MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 agentk.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 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 15:27:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781492921176386129 X-GMAIL-MSGID: 1781492921176386129 Hello, This is a part of my work to improve perf annotate. At first, I'd like reduce the size of struct annotation which will be allocated together with struct symbol in some cases. In fact, it doesn't use most of them so it needs to slim down and lazy-allocate used part. With this applied, size of the struct goes down from 96 to 48. The code is available at perf/annotate-diet-v1 branch in git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git Thanks, Namhyung Namhyung Kim (5): perf annotate: Split struct cycles_info perf annotate: Split struct annotated_branch perf annotate: Move max_coverage to annotated_branch perf annotate: Move some fields to annotated_source perf annotate: Move offsets to annotated_source tools/perf/builtin-annotate.c | 7 +- tools/perf/ui/browsers/annotate.c | 18 ++-- tools/perf/util/annotate.c | 162 ++++++++++++++++-------------- tools/perf/util/annotate.h | 49 +++++---- tools/perf/util/block-info.c | 4 +- tools/perf/util/block-range.c | 7 +- tools/perf/util/sort.c | 14 +-- 7 files changed, 147 insertions(+), 114 deletions(-)