From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5ED23C433EF for ; Fri, 8 Apr 2022 23:52:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240101AbiDHXyZ (ORCPT ); Fri, 8 Apr 2022 19:54:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235169AbiDHXyW (ORCPT ); Fri, 8 Apr 2022 19:54:22 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0533C1B29E7 for ; Fri, 8 Apr 2022 16:52:15 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id c7so15123741wrd.0 for ; Fri, 08 Apr 2022 16:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9Z5lmTeyx84Yo2aB1/h1dMObiSZnUIdjrOa7dhn9z+0=; b=bWrf8tXOOR8KJK7v9SrFzKCWzYyURowo3Mex/cgaWSy0JHDrBN5HbmpK0nYBuvar+5 hQbnXjbZsp7mu6M40ZDEUBVg+r0T1Muvri627DKFFIgkezlfeTJQSFF2kmDHiIP6xOxY u6+ylUb+xzzk1Bm8UKJppu+9esqExyHMHhtxm389OAPwJ3q7fBzdS6qgiIRCClFTpixB KupVRwkNVe5fcJDFhyxzRO0m/00vtg4zSw241C14U2jbyrzsCesen08pgQQjo2mIaoCV jVQXPJhmzNIq/6XPeBz0GNrNQmnv834mZI9BFdU85VA6JI2Km9PSLYbsq3lZSfReDUvf HISg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9Z5lmTeyx84Yo2aB1/h1dMObiSZnUIdjrOa7dhn9z+0=; b=w6H8mQDWcT7SyQTjSFXTyDOC/BMhbCEV/gt0yxWi7hzZ1RkI2SAviUlhJPw3ZaUzvN xM5l0W935Hs4k9IugwuydTn5dJEMoXPpjpM2KDxuA8ic6yEjJDOvv+mA456IwKsZrpy5 RgpKcRui/5pWDXWW/yrpUi7iW0dFXODpqF6lYOGErq4ttmwl7691SU79eGg8S38BjxYv vvEU/p08IOGu4KBqH0onk3CUS43eo6IAJryH02XJETw/YOZfHN9Ajt0wH1jgh6p4GqNG xey0i4Wet+XkWnNr+cIs0bK/sfr36TmrY6afaO6L0cdzzbNjBH9CRd1RBgerW27ewPVT jy4g== X-Gm-Message-State: AOAM533DeE0JxnVF5wXEOLN77DOTk5upXzrdHMKXoE9p06IEmbVgFROS X9QyJRT7jjUZaZz6xjxxUBnIv4BYwL0ZnfIAtEvQvg== X-Google-Smtp-Source: ABdhPJwhpFPHZ6T5uG1eJYKJykakLx69sYt54ZUlpc0GREa0vdDTuFMxX6xYub8+/m83iXAOcL9lfessfIuumOJOb78= X-Received: by 2002:adf:f6c4:0:b0:206:1581:dabc with SMTP id y4-20020adff6c4000000b002061581dabcmr16707057wrp.375.1649461933269; Fri, 08 Apr 2022 16:52:13 -0700 (PDT) MIME-Version: 1.0 References: <20220407230503.1265036-1-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Fri, 8 Apr 2022 16:52:00 -0700 Message-ID: Subject: Re: [PATCH 0/5] Tidy up symbol end fixup To: Namhyung Kim Cc: Michael Petlan , Masami Hiramatsu , John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , James Clark , Alexandre Truong , German Gomez , Dave Marchevsky , Song Liu , Ravi Bangoria , Li Huafei , =?UTF-8?Q?Martin_Li=C5=A1ka?= , William Cohen , Riccardo Mancini , Thomas Richter , Lexi Shao , Remi Bernon , Denis Nikitin , linux-arm-kernel@lists.infradead.org, linux-perf-users , linux-kernel , Stephane Eranian Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 8, 2022 at 10:15 AM Namhyung Kim wrote: > > Hi Ian, > > On Thu, Apr 7, 2022 at 4:05 PM Ian Rogers wrote: > > > > Fixing up more symbol ends as introduced in: > > https://lore.kernel.org/lkml/20220317135536.805-1-mpetlan@redhat.com/ > > caused perf annotate to run into memory limits - every symbol holds > > all the disassembled code in the annotation, and so making symbols > > ends further away dramatically increased memory usage (40MB to > > >1GB). Modify the symbol end logic so that special kernel cases aren't > > applied in the common case. > > I'm not sure what was the actual problem the patch tried to solve. > It seems like a specific problem on powerpc + kprobes and now > it affects all other architectures. Thanks Namhyung, this patch set reverts that. > In the above commit, optinsn_slot and kprobe_optinsn_page will > have the same address and optinsn_slot cannot be fixed up. > But I guess the kprobe_optinsn_page still can be fixed up and > you can use the symbol instead, no? > > To me, it'd be better to revert the change and add a special > handling for the kprobe insn pages as they appear as > modules. > > Also, all the arch symbols fixup routine seem to do the same > then we might move it to the general logic. Agreed. It isn't possible for me to test that behavior and so the change tries to make the behavior clearer and to isolate Michael's change to PowerPC. I like the idea of removing the weak symbols and making the behavior common. I also don't know why we're trying to fix broken elf file symbols and don't just let the assembly/compiler writers fix that. Thanks, Ian > Thanks, > Namhyung > > > > > Minor fix to perf annotate to not stall when stderr is full. > > > > Ian Rogers (5): > > perf annotate: Drop objdump stderr > > perf symbols: Always do architecture specific fixups > > perf symbols: Add is_kernel argument to fixup end > > perf symbol: By default only fix zero length symbols > > perf symbols: More specific architecture end fixing > > > > tools/perf/arch/arm64/util/machine.c | 14 +++++++++----- > > tools/perf/arch/powerpc/util/machine.c | 10 +++++++--- > > tools/perf/arch/s390/util/machine.c | 12 ++++++++---- > > tools/perf/util/annotate.c | 1 + > > tools/perf/util/symbol-elf.c | 2 +- > > tools/perf/util/symbol.c | 14 ++++++++------ > > tools/perf/util/symbol.h | 4 ++-- > > 7 files changed, 36 insertions(+), 21 deletions(-) > > > > -- > > 2.35.1.1178.g4f1659d476-goog > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23072C433F5 for ; Fri, 8 Apr 2022 23:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xx/JFA1vtY3RusmU5Ev96vV2Y4O0609loR6qHLQMBGw=; b=tLgW+f+bzEKzpr c6ItU4deaI3xyL3YUQALEPGRtIsiSTMHqfuoGd3cF7PHtYexEDwxNrDguXk/4UHAR6L18sAMyLbyI uGG1SmrebRtBRPTl16655HJ2Bd9Yng6/KGIBFht5qmLEWN93j+qXYak4T1+r0D01MzdHfcaJJRTJX e0kPaFK3FL1J3SipRS4TqfA7r3b7unkwgcVS9O+2/kkFoevOTPacz4FO1hSC8Nu5ODQrDITu4PRQj tmBf7wWQiMyPL/MgACcB+HtINMT8gYQYZsvVfvKOujojasM0ahLUAgoBEfFTNXZtCevdHTsl8/EkI R5MK+KY+VRAWZugXzThQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncyOo-001VN1-FH; Fri, 08 Apr 2022 23:52:18 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncyOl-001VLu-Rp for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 23:52:17 +0000 Received: by mail-wr1-x432.google.com with SMTP id w4so14976612wrg.12 for ; Fri, 08 Apr 2022 16:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9Z5lmTeyx84Yo2aB1/h1dMObiSZnUIdjrOa7dhn9z+0=; b=bWrf8tXOOR8KJK7v9SrFzKCWzYyURowo3Mex/cgaWSy0JHDrBN5HbmpK0nYBuvar+5 hQbnXjbZsp7mu6M40ZDEUBVg+r0T1Muvri627DKFFIgkezlfeTJQSFF2kmDHiIP6xOxY u6+ylUb+xzzk1Bm8UKJppu+9esqExyHMHhtxm389OAPwJ3q7fBzdS6qgiIRCClFTpixB KupVRwkNVe5fcJDFhyxzRO0m/00vtg4zSw241C14U2jbyrzsCesen08pgQQjo2mIaoCV jVQXPJhmzNIq/6XPeBz0GNrNQmnv834mZI9BFdU85VA6JI2Km9PSLYbsq3lZSfReDUvf HISg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9Z5lmTeyx84Yo2aB1/h1dMObiSZnUIdjrOa7dhn9z+0=; b=d6yT1wpAUy7x0WuDhI1ykwzyZXPoJVoGgMGqrmjZ7BSZpJejINwwtHjO9h+QlkVXsY klUpH/3Vowvd+OPrVIRN6Dhai9N5O9SxT4zfQjMYR/aWTNwCrf9J7bhqAwFvuBez1at/ BeQs29mETOy0gHd4JyPHbEttZF5EA3d1u4oGlpjob2DMA6PpCZZp8VeKBe5/iWKHhurN 5tKw6QDtPiHc5wMx5CSz/AHHcAfzDrt0PNELXSHkqp0sGp3LkCQGyWU1EcPcw1hbjzEr SXhPA5T1Q7/YP7VjrPZdlnhqz2cjofn0TPnkdNk2GRSdBjiVSsfOhGMrT4YjSbo8dH3T 9KbQ== X-Gm-Message-State: AOAM530Cr9M8hKiTTnaEA0Hbe9QQTzbZ+97D+NAANn1A1OO8EelIJSBl LjA8FiLrz9pDlkxAqiDHgeF+JS6AI+/nA7CkHzcVsw== X-Google-Smtp-Source: ABdhPJwhpFPHZ6T5uG1eJYKJykakLx69sYt54ZUlpc0GREa0vdDTuFMxX6xYub8+/m83iXAOcL9lfessfIuumOJOb78= X-Received: by 2002:adf:f6c4:0:b0:206:1581:dabc with SMTP id y4-20020adff6c4000000b002061581dabcmr16707057wrp.375.1649461933269; Fri, 08 Apr 2022 16:52:13 -0700 (PDT) MIME-Version: 1.0 References: <20220407230503.1265036-1-irogers@google.com> In-Reply-To: From: Ian Rogers Date: Fri, 8 Apr 2022 16:52:00 -0700 Message-ID: Subject: Re: [PATCH 0/5] Tidy up symbol end fixup To: Namhyung Kim Cc: Michael Petlan , Masami Hiramatsu , John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , James Clark , Alexandre Truong , German Gomez , Dave Marchevsky , Song Liu , Ravi Bangoria , Li Huafei , =?UTF-8?Q?Martin_Li=C5=A1ka?= , William Cohen , Riccardo Mancini , Thomas Richter , Lexi Shao , Remi Bernon , Denis Nikitin , linux-arm-kernel@lists.infradead.org, linux-perf-users , linux-kernel , Stephane Eranian X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_165215_939570_0B5EDF80 X-CRM114-Status: GOOD ( 29.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 8, 2022 at 10:15 AM Namhyung Kim wrote: > > Hi Ian, > > On Thu, Apr 7, 2022 at 4:05 PM Ian Rogers wrote: > > > > Fixing up more symbol ends as introduced in: > > https://lore.kernel.org/lkml/20220317135536.805-1-mpetlan@redhat.com/ > > caused perf annotate to run into memory limits - every symbol holds > > all the disassembled code in the annotation, and so making symbols > > ends further away dramatically increased memory usage (40MB to > > >1GB). Modify the symbol end logic so that special kernel cases aren't > > applied in the common case. > > I'm not sure what was the actual problem the patch tried to solve. > It seems like a specific problem on powerpc + kprobes and now > it affects all other architectures. Thanks Namhyung, this patch set reverts that. > In the above commit, optinsn_slot and kprobe_optinsn_page will > have the same address and optinsn_slot cannot be fixed up. > But I guess the kprobe_optinsn_page still can be fixed up and > you can use the symbol instead, no? > > To me, it'd be better to revert the change and add a special > handling for the kprobe insn pages as they appear as > modules. > > Also, all the arch symbols fixup routine seem to do the same > then we might move it to the general logic. Agreed. It isn't possible for me to test that behavior and so the change tries to make the behavior clearer and to isolate Michael's change to PowerPC. I like the idea of removing the weak symbols and making the behavior common. I also don't know why we're trying to fix broken elf file symbols and don't just let the assembly/compiler writers fix that. Thanks, Ian > Thanks, > Namhyung > > > > > Minor fix to perf annotate to not stall when stderr is full. > > > > Ian Rogers (5): > > perf annotate: Drop objdump stderr > > perf symbols: Always do architecture specific fixups > > perf symbols: Add is_kernel argument to fixup end > > perf symbol: By default only fix zero length symbols > > perf symbols: More specific architecture end fixing > > > > tools/perf/arch/arm64/util/machine.c | 14 +++++++++----- > > tools/perf/arch/powerpc/util/machine.c | 10 +++++++--- > > tools/perf/arch/s390/util/machine.c | 12 ++++++++---- > > tools/perf/util/annotate.c | 1 + > > tools/perf/util/symbol-elf.c | 2 +- > > tools/perf/util/symbol.c | 14 ++++++++------ > > tools/perf/util/symbol.h | 4 ++-- > > 7 files changed, 36 insertions(+), 21 deletions(-) > > > > -- > > 2.35.1.1178.g4f1659d476-goog > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel