Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2097166rda; Tue, 24 Oct 2023 12:11:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHL+00LGKj+XKKbnI1yCDF0cP5rM5OGrBQ9BdrtTyE5Upm43MXnJeBe+6j516jgCU25448l X-Received: by 2002:a05:6a20:7aa7:b0:16b:79b3:222b with SMTP id u39-20020a056a207aa700b0016b79b3222bmr3107330pzh.34.1698174666713; Tue, 24 Oct 2023 12:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698174666; cv=none; d=google.com; s=arc-20160816; b=FCGKro4snNixvIbdL4UrKwl9pG0QLYIupxCaswI76M8X2x2mksRmatDmPidayUhf/F l9j719oznNhMZ4GMTZzZN6T2p6YOLsx10D4Qg/hE8O2GLn2/He1MQ01DJ/eqVWKlbiqT geAfToxrSkrsJAVcKU+B0DECm1Ti9gjqAoT/SVikDg8KCgaU52Uwga0ybid+qPua26bf /7Gw/0NGUjALRn+HnVaa3NESQUbdW1CCciz3uuIX4llbVPL+AfV3lvpmPv3Os1XJ45cI lLcpcOXtg0TTesUFceKhB/SBZMWb6r01ZQaUYWbkNxYCKkk6rUHVaK7yT4KtHJ+Jv/Fv ENAw== 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; bh=Gkq6OGZkIeDIbC4L/NEeWjUQnbJ0RGyN0btRMk7JKpg=; fh=InvvdGthjIaAiBo93mBLATxwfbVgK7ITxv58Kzsopn8=; b=hyy4uqLMqESVNDndtebuIqNgkwVR0Aj6g6WkwaU9tNp3YeMPUdVoPZTKVetS2OP+lB yRldonw6zL/N0eHJr4iXDNZF3rXRE8tLhIQW5ffdOb6tUQCsG+32iOUKXremesyS04Y+ LkIVSA9KJB3xtmHFuSLGmHBQRuNXCwdozvb7ctW2jUgslc5vBUF4sOfoKNPfMbd4VtUP usRgqELtvomY65Owyl2fGDhsVIBsehVAl98cJmjgp1Hrd7gNntV49IKXew5H1Fm81yW2 pM0Lsb4hnXByQeVmVrZXj6RLJ70MDpApTZCUDAwIjfkpSNAFHhHjQO7NWqtoXbnktn4d gQtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id v202-20020a6361d3000000b005b74de09ee0si8849839pgb.108.2023.10.24.12.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 12:11:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 712B180859B2; Tue, 24 Oct 2023 12:10:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234913AbjJXTKS convert rfc822-to-8bit (ORCPT + 99 others); Tue, 24 Oct 2023 15:10:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234699AbjJXTKP (ORCPT ); Tue, 24 Oct 2023 15:10:15 -0400 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE10510C9; Tue, 24 Oct 2023 12:10:13 -0700 (PDT) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-27d425a2dd0so4212773a91.2; Tue, 24 Oct 2023 12:10:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698174613; x=1698779413; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GFLJZBS7agKqAkEvq06+8+duvFvUx+uUvizA/RGK7gk=; b=Gd6TRx6/m7r0r47AI+HnypksqBe5Kspgw8VTtOMTnjP23TZdYOVlAv2/1hidb+YBWP Y9Doi0zYY+HcrTpk9wY9FTuX5psBoB7XWIRikhv7W6Z25gedH4JBdK4Rde8t53ocAjWA YGyhawOzav8/IhVoaPMXW23kXa86vvsouYdTV2v0BAtNMjTWu32eyr//dB2HsQ2x3LtE nwUS/ZeeA8g57PCRWOlbd7WDvizr8W5jLQF8RiBNv+ytVLm6TZGvK8zx9EUL7MRcS/xu fQDYCcklYrrRtrXELY66soS92pVoPlvYYjWogoZtnhMK1XBX7Pb8qiwvx6b+6E4N2qVE 65Gg== X-Gm-Message-State: AOJu0Yy1JGAKjrFeFLSvtjgY7QvxucFj16NlLTFrEK+NgDzqy+jE1rzS wqnkdJyIN7v/xTF0LApBo191z9DPFdeQhIQOpYA= X-Received: by 2002:a17:90b:3812:b0:27d:3f08:cc21 with SMTP id mq18-20020a17090b381200b0027d3f08cc21mr14009203pjb.5.1698174612976; Tue, 24 Oct 2023 12:10:12 -0700 (PDT) MIME-Version: 1.0 References: <20231012035111.676789-1-namhyung@kernel.org> <20231012035111.676789-14-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Tue, 24 Oct 2023 12:10:01 -0700 Message-ID: Subject: Re: [PATCH 13/48] perf annotate: Add annotate_get_insn_location() To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Peter Zijlstra , Ian Rogers , Adrian Hunter , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Linus Torvalds , Stephane Eranian , Masami Hiramatsu , linux-toolchains@vger.kernel.org, linux-trace-devel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 24 Oct 2023 12:10:24 -0700 (PDT) Hi Arnaldo, On Mon, Oct 23, 2023 at 9:38 AM Arnaldo Carvalho de Melo wrote: > > Em Wed, Oct 11, 2023 at 08:50:36PM -0700, Namhyung Kim escreveu: > > The annotate_get_insn_location() is to get the detailed information of > > instruction locations like registers and offset. It has source and > > target operands locations in an array. Each operand can have a > > register and an offset. The offset is meaningful when mem_ref flag is > > set. > > This needs to be enclosed in HAVE_DWARF_SUPPORT, as the build is failing > in systems where this isn't available, see patch below. Thanks for the test and the patch, will add it to v2. Namhyung > > CC /tmp/build/perf/arch/x86/util/pmu.o > util/annotate.c: In function 'extract_reg_offset': > util/annotate.c:3537:24: error: implicit declaration of function 'get_dwarf_regnum' [-Werror=implicit-function-declaration] > 3537 | op_loc->reg1 = get_dwarf_regnum(regname, 0); > | ^~~~~~~~~~~~~~~~ > CC /tmp/build/perf/tests/vmlinux-kallsyms.o > > I tested it with 'make NO_DWARF=1' > > - Arnaldo > > diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c > index 9d653a1e84ce4889..b998c81c89be04fc 100644 > --- a/tools/perf/util/annotate.c > +++ b/tools/perf/util/annotate.c > @@ -3486,6 +3486,7 @@ int annotate_check_args(struct annotation_options *args) > return 0; > } > > +#ifdef HAVE_DWARF_SUPPORT > /* > * Get register number and access offset from the given instruction. > * It assumes AT&T x86 asm format like OFFSET(REG). Maybe it needs > @@ -3591,3 +3592,4 @@ int annotate_get_insn_location(struct arch *arch, struct disasm_line *dl, > > return 0; > } > +#endif // HAVE_DWARF_SUPPORT > diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h > index 4adda492233d2742..484be346a279c481 100644 > --- a/tools/perf/util/annotate.h > +++ b/tools/perf/util/annotate.h > @@ -437,6 +437,7 @@ int annotate_parse_percent_type(const struct option *opt, const char *_str, > > int annotate_check_args(struct annotation_options *args); > > +#ifdef HAVE_DWARF_SUPPORT > /** > * struct annotated_op_loc - Location info of instruction operand > * @reg: Register in the operand > @@ -473,4 +474,5 @@ struct annotated_insn_loc { > int annotate_get_insn_location(struct arch *arch, struct disasm_line *dl, > struct annotated_insn_loc *loc); > > +#endif /* HAVE_DWARF_SUPPORT */ > #endif /* __PERF_ANNOTATE_H */