Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3318296ioa; Tue, 26 Apr 2022 00:53:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHXvxPdoYJMdhhetxgvhFvrAw7xulRx/kOkExbUwoJb+uaE3cFc9o3ODOC/W+hvIwCHZ8W X-Received: by 2002:a05:6402:1541:b0:41c:bfb9:d56b with SMTP id p1-20020a056402154100b0041cbfb9d56bmr22990770edx.344.1650959613677; Tue, 26 Apr 2022 00:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650959613; cv=none; d=google.com; s=arc-20160816; b=WFp0/yGcLoUnnOJ2BC5CkEagHSypLVogBbRcQ6DUPITiwwnQiJ8QU5yTsdBT7easAZ fgAHLg6t3srd1uYxayMOL7HBwvP172LmC3DDY1z0CIz0EEsCcM09jLxzYEehbl75XOL/ O2ov/1Rh9pe/A45IUQyNJl/B5KJqtl7GexrfuqIgEnr7+n+S3a2NJy+nHHFQg4Jc2lOz LAg67lws65JqB+ICV9yYsvaztZI0o15sUDEMVXSebWXoKukB46TdnuVo1+CZl7hKwr80 5l+kBcwyVjF7s6HrXMIsCHt25wl+8fOetYXQadbxtQVmdkmymeZ69oTNsrhqzXoSR1xl 7nuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=dHw3bSR/H7CsKHNYVZ388J1hNpCRBRDwS8dgecfZChM=; b=lenkKr19RqkEYAAYDGPdvS+xajCTdr7iop1bWSUMEeaawNgu4vx8y1MtpmWVjhHL9+ xKoltHiDKGKEi31OR66HqLnqZ6T8zEZABlcdr4xuJYf6Wrh4jvmruisOxLZaAqIqj0Xs 8jBHyuW7+Dn47YNpTA/LNMbSBUb32481U/U4pDH4FHe2sKFbltOg25iPulU28gkma1no 1F2yBCOBo4i0eaRvBwhEPgmjVBIEFbqxp8h3BhHFl3SaKPb6NjiUkm3znk4IaGhVl2rV 1Hwgp51f10kDn4PNzl0B4lPpv3NEtcWU3ImgYnOStaz6QSixa2cWFbFSw+y3+RZlFONb JzEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c10-20020a170906d18a00b006e86ef1545csi15514294ejz.326.2022.04.26.00.53.10; Tue, 26 Apr 2022 00:53:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244843AbiDYTR6 (ORCPT + 99 others); Mon, 25 Apr 2022 15:17:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242986AbiDYTR4 (ORCPT ); Mon, 25 Apr 2022 15:17:56 -0400 Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6399B2ED62; Mon, 25 Apr 2022 12:14:51 -0700 (PDT) Received: by mail-lf1-f51.google.com with SMTP id w19so27934949lfu.11; Mon, 25 Apr 2022 12:14:51 -0700 (PDT) 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=dHw3bSR/H7CsKHNYVZ388J1hNpCRBRDwS8dgecfZChM=; b=hicR/D69ANxKVPCF+DF7id9Artecst5j9WieldcfF6yVeaMpAHW6VxiUua7Otzi/qZ c9WmgBjW8pnONB4M9Xqd4cKTl/I8nOegNHNZ9d8UGf44ToG3buIHAwO0ZRCokmF2TX7n GFMEMWzJU84BAhiDZq5lbBsYjyt2GroP8f6UHniOmR0ICTx06dvJbwbqX9QxklEYItUo xkWDwb5pBgRjUZckmlcVuvj10j0YfhKiUSbMTroBihMnXR3osaLmSegNLDyHVjQgl8Gd B+xaHrKaZK8PEzEkRjUOm31DIr/A7WuRvpvj1RH9YeLzebQiJ60pRjOzpxfIjuRvIatX R/vg== X-Gm-Message-State: AOAM533C4KkQnlExerDEwAtpOda7J2hl1v0cRji05/QQwMdACFtTdCvA K8ClGO6hYIuq6Z6JIzqg69LY5tUIxXj+7BgQMCk= X-Received: by 2002:ac2:4c4f:0:b0:44a:4357:c285 with SMTP id o15-20020ac24c4f000000b0044a4357c285mr13820828lfk.99.1650914089654; Mon, 25 Apr 2022 12:14:49 -0700 (PDT) MIME-Version: 1.0 References: <20220416004048.1514900-1-namhyung@kernel.org> <20220416004048.1514900-2-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Mon, 25 Apr 2022 12:14:38 -0700 Message-ID: Subject: Re: [PATCH 1/3] perf symbol: Pass is_kallsyms to symbols__fixup_end() To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Michael Petlan , Peter Zijlstra , Ingo Molnar , Song Liu , Will Deacon , Mark Rutland , John Garry , Mathieu Poirier , Leo Yan , Michael Ellerman , Heiko Carstens , LKML , linux-perf-users , linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ian, On Sat, Apr 16, 2022 at 7:59 AM Ian Rogers wrote: > > On Fri, Apr 15, 2022 at 8:40 PM Namhyung Kim wrote: > > > > The symbol fixup is necessary for symbols in kallsyms since they don't > > have size info. So we use the next symbol's address to calculate the > > size. Now it's also used for user binaries because sometimes they > > miss size for hand-written asm functions. > > > > There's a arch-specific function to handle kallsyms differently but > > currently it cannot distinguish kallsyms from others. Pass this > > information explicitly to handle it properly. Note that those arch > > functions will be moved to the generic function so I didn't added it > > to the arch-functions. > > Thanks Namhyung, in: > https://lore.kernel.org/linux-perf-users/20220412154817.2728324-3-irogers@google.com/ > I used "dso->kernel != DSO_SPACE__USER" in symbol-elf to make this > more than just kallsyms as presumably kernel code is the issue. Do we > know elf kernel code has correctly sized symbols? Yeah, IIUC the whole point of the symbol end fixup is because the kallsyms doesn't have the symbol size info. Every ELF binaries should have the size except for some hand-written asm functions which missed adding it manually. I guess that's the reason it was added to other DSO loading paths. Also considering "[" (and "]") in the symbol name is specific to kallsyms which has both kernel and module symbols together. Thanks, Namhyung