Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4130038rwd; Tue, 23 May 2023 03:41:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4U0eITdfAy+13krScYvtcLXdMwsJ+8QzlWhEe73yKNWRRsPapViAUuSg4kQUMcm/rso5Ss X-Received: by 2002:a05:6a20:3d09:b0:10a:cbe6:69f0 with SMTP id y9-20020a056a203d0900b0010acbe669f0mr11293661pzi.10.1684838518964; Tue, 23 May 2023 03:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684838518; cv=none; d=google.com; s=arc-20160816; b=eRbZroyocsE8P5SzuNTA5WoTcl9EqvlkzfgEyZgpxpTUUkRyx/THF+W4Fi3sGFMQQU MkvgaVZElIh9k/9qFqZO7CQb+yV7ZpNCZ1Qo2tQvFA8WjPgCnbDanAl/WoDlocgCH+dk NxQU0NHNYiZfyVOrt9s+zC1bIjV2PqJrkIllrnM8xuzQLoSRCXqo1GuB9b3JjjFiBRN+ eiWgEw5MiL0//WNhZrsDE0Utusda+wNCmOVBfvlQlMak3Q8nBoxZO/cV+7XPmC1/Nzj0 LjxstMCwvIfZ9eT7o3JgU8yDXnPEegL7HBvVPZJdxnJQKyuZYzh0EaAIBLFhQt6zBVtt FArg== 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=i2Egnr4d0rluoE/hRYLroJ4kcXOwyU/Lj5FuOQvlIp8=; b=P4ALNcX34/gI/rgWAc2kVMxEhgnSFHpC6onEyxky7g+goBtz00dxLeh2TEmdjTSUws BypGIwuSZQqeR2XiENtx6MlTU1p/IP/JCg/TiWf0CNoBYKoospSl0W9t9bSZJmsdQ07c PYpUAW9E9VRtLKQA1NfoA27x4tER+X37ZBSh+GtNteEJXUDSCJPkMy2xzgSZdBik6zqC NzmA7lCsn6zLWqScGyk1P8lAAqpnm6ZnfoGM32sTaw5yXWJCmeaFA/K/ynN7UJQ0bt88 Qpt4KwLje/Q+PkY/vpGUc/37tSRNXuBDQoTVkgtlBmVNguoWGS3DF04aH6mrpSTfZBHF KCnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q/nNk8Zl"; 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 v15-20020a63b94f000000b0053ef15f2655si1001331pgo.617.2023.05.23.03.41.46; Tue, 23 May 2023 03:41:58 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="q/nNk8Zl"; 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 S236568AbjEWK05 (ORCPT + 99 others); Tue, 23 May 2023 06:26:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbjEWK04 (ORCPT ); Tue, 23 May 2023 06:26:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7790FE; Tue, 23 May 2023 03:26:54 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7CFA0630D0; Tue, 23 May 2023 10:26:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3193C433A4; Tue, 23 May 2023 10:26:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684837613; bh=0vlCDn5GYXan9qivPDneQ2nYL3hkWFznEm195urAu+4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=q/nNk8Zlf7v9fHI6+tL4MQADuV0OJXDkiBSDRZ/yyPbxZPtdKvzjBuVW5SB5Zs7pV rBCpiiJ+PlK8q26rSP4InoJjgEB9SMROwUc84eqeRk9umUs9eAEkDd7U72LQhRifFs BuHN3V+mOBBrcVCDsKa9yfb2p0/4M+FI7etoyz6p5m77EA5KaL9NjeI/d+XonOsu1M DUXSZ6Bx2PxSFxRhqLkAFTPiiG1DyDnBc2GrhT+p4ygAp3VwMydxyzgn4a2SfNwLe6 4KpeinGI7YQT4zv1vr9qWesb5wPBKyJkl4VKRWyIUxxXYuy/5h5I7RLiVdvvKAaPZe YXJrOF8RZbVEA== Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-510d6e1f1abso1333945a12.2; Tue, 23 May 2023 03:26:53 -0700 (PDT) X-Gm-Message-State: AC+VfDxjB+6e5pSgO9wI0QRbIFbYYCGG5ORRo4XKRe2QvW37d8lsuhWS 2RlyuwQeMa7dtPuv1+ZDbzZdHkuySNQlxnyQgrI= X-Received: by 2002:a17:907:9494:b0:96a:30b5:cfb0 with SMTP id dm20-20020a170907949400b0096a30b5cfb0mr12353417ejc.22.1684837612089; Tue, 23 May 2023 03:26:52 -0700 (PDT) MIME-Version: 1.0 References: <1684835873-15956-1-git-send-email-yangtiezhu@loongson.cn> In-Reply-To: <1684835873-15956-1-git-send-email-yangtiezhu@loongson.cn> From: Huacai Chen Date: Tue, 23 May 2023 18:26:39 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] perf symbol: Add LoongArch case in get_plt_sizes() To: Tiezhu Yang Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Leo Yan , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, loongson-kernel@lists.loongnix.cn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Acked-by: Huacai Chen On Tue, May 23, 2023 at 5:57=E2=80=AFPM Tiezhu Yang wrote: > > We can see the following definitions in bfd/elfnn-loongarch.c: > > #define PLT_HEADER_INSNS 8 > #define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4) > > #define PLT_ENTRY_INSNS 4 > #define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4) > > so plt header size is 32 and plt entry size is 16 on LoongArch, > let us add LoongArch case in get_plt_sizes(). > > Link: https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dblob;f=3Dbfd/e= lfnn-loongarch.c > Signed-off-by: Tiezhu Yang > --- > > v2: Add EM_LOONGARCH definition to avoid build error > > tools/perf/util/symbol-elf.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c > index b2ed9cc..b3dbf6c 100644 > --- a/tools/perf/util/symbol-elf.c > +++ b/tools/perf/util/symbol-elf.c > @@ -35,6 +35,10 @@ > #define EM_AARCH64 183 /* ARM 64 bit */ > #endif > > +#ifndef EM_LOONGARCH > +#define EM_LOONGARCH 258 > +#endif > + > #ifndef ELF32_ST_VISIBILITY > #define ELF32_ST_VISIBILITY(o) ((o) & 0x03) > #endif > @@ -411,6 +415,10 @@ static bool get_plt_sizes(struct dso *dso, GElf_Ehdr= *ehdr, GElf_Shdr *shdr_plt, > *plt_header_size =3D 32; > *plt_entry_size =3D 16; > return true; > + case EM_LOONGARCH: > + *plt_header_size =3D 32; > + *plt_entry_size =3D 16; > + return true; > case EM_SPARC: > *plt_header_size =3D 48; > *plt_entry_size =3D 12; > -- > 2.1.0 > >