From patchwork Fri Nov 3 19:19:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 16234 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1264020vqu; Fri, 3 Nov 2023 12:21:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHA7njJvQGryo6RNvz3u/+GlcKFCx+VaS5EQTp/V9qVOCjHvteGEVTVmjUkZ12H1BPQtKZE X-Received: by 2002:a05:6358:8a9:b0:168:e841:5450 with SMTP id m41-20020a05635808a900b00168e8415450mr30395552rwj.0.1699039274296; Fri, 03 Nov 2023 12:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699039274; cv=none; d=google.com; s=arc-20160816; b=zck3pen8G3c1EPNvQtVbJ5xu8Ud+oF3wdEE4KPN//iznJ6tvHeAOSJPsbSGE+bAxfX o70OI6ia5mPmtMTWls3L8zqDrmt5FUDI7Io7QwLSTvUskVYgsuUhNyngFSOhQvaS/QeC B8AD0ORDTUQH3gS2e2N2n4nNltUrNnsMK/NMWFwJb/CSab7E6h6UF7EG2QA9RTlTVci7 kqJcgdjjqlbp0LKzkuIKRJ2WQd/7EmehZCrPXmd9mXfEkoXgTgAYfivE9KefRgsI6BkJ q9HpS5IRd9fjXad6B+V6xFlRb9St7Dbrpp4E/tKfa/mCXbV7leRcxyglwGfi738Qqss3 kXcQ== 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=A/lpgYKX/gR35qBoWxiaOvO5gEklUt5pUGK1IY4URpI=; fh=dEmjb93PdOJTvdPu/f/jsaBqMdye6vrnelmCgjjKNOM=; b=u1WS3jcvI6fEzGjVMsS3c/686KfTTqMxZ2A6Uzorh1uOt6FXuKvcyiCd9Ko88K5Rma LZJr1sajdTYxC09/4+LyGWQHXxuPeMhS1oQvuoSoC9iLOJRKwV9PKxO3yteNN90kgn1m jMqHJ3PoxmeRCx4RP6SX9EpmrX3/HZOsXQY8+jy7ZTRto2YNXkLToi6H2LOnNaIvkms6 JI6v2PiPRfNBSxnDqSeJ+My9qj3zdoF7uYRKdE99oHL4hOJ+TXEoxVUcN16SG1BZ8V8K 9MDpNjHnzAOcp19FBPMzwXg8Z+DZrb9+Cq0IBQZLCko1mxPgs3bjdPQG6qz+z1Bvj+ua uC9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LLPb5pI0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id cl1-20020a056a02098100b0057c24bae994si2086878pgb.355.2023.11.03.12.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 12:21:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LLPb5pI0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id DBD72807C5FA; Fri, 3 Nov 2023 12:20:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377111AbjKCTTP (ORCPT + 35 others); Fri, 3 Nov 2023 15:19:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234266AbjKCTTO (ORCPT ); Fri, 3 Nov 2023 15:19:14 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE918D60; Fri, 3 Nov 2023 12:19:11 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-28098ebd5aeso2270803a91.0; Fri, 03 Nov 2023 12:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699039151; x=1699643951; 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=A/lpgYKX/gR35qBoWxiaOvO5gEklUt5pUGK1IY4URpI=; b=LLPb5pI0ry9vw5ATA9rFnErDoMd+x2lGH/r3LGldi6h1LiwFn7zpBWRV/byaBpu5Lp X+hoxlgJNzFhToW6hRQi0NXRMGGwi0JoVnUgzLnnCBipj5glioS0s2usDKPVt3vAArZN aKpuJQMAuGwNRUsPZPdq84pWF9F7+SqR86inqPqCDtVqaZ1JwRmzcIN67a/lyRzjEEcn xxeLviKGZf9MqZhkWRuP+lCtwdDFcdSKGoVV/JcBY62z3OdkfEHMS8p1H0FBMdt2sp7K q9teRKCooNM3CRKS9SyHZWQEbhsbDivptYnO6uUiGZ0TKUkic9bBzXl7qpPCzZ3Iz08s RTXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699039151; x=1699643951; 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=A/lpgYKX/gR35qBoWxiaOvO5gEklUt5pUGK1IY4URpI=; b=SWhHEcBx3ID7Sxbo2pEwH/fw51TZY2HKh9hsctqvZGhCYkxkiLBtcXJCqtk1pTEOyk VKaX6/pywukuEBbdpwL+2ODMdywSi3KdgE2alwp1g7dlE/e+OZ7rlyJgk2evAT31sN+h tKUB/lyxa/YllVyboACKRUA6eBXsTOvJ25sbK5UQCSZQP3xXiHmxeRyE+ks2jNqAdFBU RMmQmK/kvIirR+OsqjXd27aJCpHtXbuv32f2AvINem2e293oXg7ZI/6efJWlddQMZF5c DLYZUtvvIVdQAJZm11Zpzk95BKyLy+vFnQYLW6dO5ruT/1GVwjMfGJjVMoGLd0exWX6M p4aw== X-Gm-Message-State: AOJu0YziVdmqK7K8TvcMSevObFsrO3FGrHXGTFv7irOV2IzPsvj8ned5 ctaW0GxM6d9HPKMOB+k+cs0= X-Received: by 2002:a17:90a:17a2:b0:27c:fe72:6e9 with SMTP id q31-20020a17090a17a200b0027cfe7206e9mr19234826pja.27.1699039151179; Fri, 03 Nov 2023 12:19:11 -0700 (PDT) Received: from bangji.hsd1.ca.comcast.net ([2601:647:6780:42e0:8234:4ed3:2635:c9d6]) by smtp.gmail.com with ESMTPSA id y17-20020a17090aca9100b0027cf4c554dasm1761349pjt.11.2023.11.03.12.19.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 12:19:09 -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, Christophe JAILLET Subject: [PATCHSET 0/5] perf annotate: Reduce memory footprint (v2) Date: Fri, 3 Nov 2023 12:19:02 -0700 Message-ID: <20231103191907.54531-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 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]); Fri, 03 Nov 2023 12:20:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781571805993975413 X-GMAIL-MSGID: 1781571805993975413 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. * v2 changes) - fix typo - reorder struct annotated_source - add Ian's Reviewed-by tags With this applied, size of the struct goes down from 96 to 48. The code is available at perf/annotate-diet-v2 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(-)