Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3948755rwb; Fri, 30 Sep 2022 10:26:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM64pn0rU5JqdAIlgOezRSVVVSKyT/P5XjMoGfG4Mo+CuOgnhCTJgM5ygF0+R0OHqtDXlDAt X-Received: by 2002:a05:6402:2793:b0:452:5e81:c624 with SMTP id b19-20020a056402279300b004525e81c624mr8817543ede.36.1664558768202; Fri, 30 Sep 2022 10:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664558768; cv=none; d=google.com; s=arc-20160816; b=vaAC3uZ6Pi3/39/2yfP2PVPFzFP/cQxWGF0hgRHU6hB0fYVdwTPnAkcP3QcCmsW80+ iQLmLi1D3wNISjpmy0nuxHTjJQyGENLFIqmIeajjDUHlgDl9vpZwb4D50W62n+mULwqn fQda3Y5PePm4hymEmjFfi8PZepT9DMDWNBEOYYPMofbp0o4GJQTwQZd+G6xvRyafX6Gt 7Hsoqbi11spWldtkl9nA5mYD/0TGXNVvPD7XNj8ZV2/JwR7yR/zRPo8DsMLkGr8QEP72 4XLFzLqgmf897czNceVUipw+wCk80+SkjC+tzYVfzU/xNP12+TIrhEung1TaJuBmWzGf zYiA== 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=R+WiXLP47nyLieKcyaFDm7uI3zYvk9uOSTGnPEnMU9U=; b=I6XjsjrltwhO9PSkNKTyym9H+eVduDtnX11HEe6mSH/m2NQ5GQmtRa8W/vxcgkmwLS 9zWDe+b321qtGiyR8S4hrCC1GwMHijE3FHydX6Xmjhy0cjP7wbKh/wEt0eqD2h2G6hEj 3PAZ+Dh/XL8oazRhofD2b6TgXjH+5p+aOp1uLB3EVRY/qL+9qkxcVr1OmvmMpNi61KC9 a5jd0nUGf7bjrhb+O8etHY+mVT2CO66GUITpU8WqsPBZbu/Y6V64EvmGO7hunaljtPmu 6BDGZk/JjhmQeg6vUAGAsmbCvJlk8Cu065ooeV1IFKQ/uVdm9NebQvCo1MpW+gW3z7ox sgvg== 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 g22-20020a1709065d1600b00787daa35949si2273621ejt.723.2022.09.30.10.25.42; Fri, 30 Sep 2022 10:26:08 -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 S231405AbiI3RTO (ORCPT + 99 others); Fri, 30 Sep 2022 13:19:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231465AbiI3RTN (ORCPT ); Fri, 30 Sep 2022 13:19:13 -0400 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC26C1C2F91; Fri, 30 Sep 2022 10:19:11 -0700 (PDT) Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-131b7bb5077so6212463fac.2; Fri, 30 Sep 2022 10:19:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=R+WiXLP47nyLieKcyaFDm7uI3zYvk9uOSTGnPEnMU9U=; b=TOPSVhNwt7EZ7u4qF0rKbaqUCqneaifZuenOBH/8RJzHFHXaLw9z8dy2THkWfneHCl S1vklorS9FFiumS6Fm0vnsWISQSNQ/4zgIuhsPTWbSMxOWcg1V8qmk4kmhAh9r6HGKWI PolzDTK3D0PS6RDyptPw13pY4LVJWj9RCutmCUZBrDbuDDm6vnJKS0lbeH4VDenVnUJT t7sidgE1vdNDSEL5iOug9EMpo4NJxK2ouZ7kJaYjts2lSfpAHzAwoQ5Ztcs6dsOuN1vc 2495lt8WgtshIrZ0whhbOWbRF4kuc/QI+9x9UHNVq+8Bq8YIeI4Dj/EhkjaSA8CmEzbi jE3Q== X-Gm-Message-State: ACrzQf2ODkcD+uHdkmH90xBuCq93hOiMPD2cRonEeDi3PrCyUyZvj2hY 535beUINOqcHhq9JUvCpIIoMLrgmJKrFhVWcSRQ= X-Received: by 2002:a05:6870:a70f:b0:127:666a:658 with SMTP id g15-20020a056870a70f00b00127666a0658mr5377853oam.218.1664558351169; Fri, 30 Sep 2022 10:19:11 -0700 (PDT) MIME-Version: 1.0 References: <20220929205958.22225-1-hcvcastro@gmail.com> In-Reply-To: <20220929205958.22225-1-hcvcastro@gmail.com> From: Namhyung Kim Date: Fri, 30 Sep 2022 10:19:00 -0700 Message-ID: Subject: Re: [PATCH] perf: fix the probe finder location (.dwo files) To: Henry Castro Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , linux-perf-users , linux-kernel 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 Hello, On Thu, Sep 29, 2022 at 2:00 PM Henry Castro wrote: > > If the file object is compiled using -gsplit-dwarf, > the probe finder location will fail. > > Signed-off-by: Henry Castro > --- > tools/perf/util/probe-finder.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c > index 50d861a80f57..6d7c5461251d 100644 > --- a/tools/perf/util/probe-finder.c > +++ b/tools/perf/util/probe-finder.c > @@ -1161,7 +1161,8 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg, > struct perf_probe_point *pp = &pf->pev->point; > Dwarf_Off off, noff; > size_t cuhl; > - Dwarf_Die *diep; > + Dwarf_Die *diep, cudie, subdie; > + uint8_t unit_type; > int ret = 0; > > off = 0; > @@ -1200,6 +1201,14 @@ static int debuginfo__find_probe_location(struct debuginfo *dbg, > continue; > } > > + /* Check separate debug information file. */ > + if (dwarf_cu_info(pf->cu_die.cu, NULL, &unit_type, &cudie, > + &subdie, NULL, NULL, NULL)) It seems dwarf_cu_info was introduced in elfutils 0.171 which was released in June 2018. I hope all the test setups have more recent versions. > + continue; > + > + if (unit_type == DW_UT_skeleton) > + pf->cu_die = subdie; Is this DWARF5 thing? Will it handle the previous version well? IOW wouldn't dwarf_cu_info() return fail? Anyway I think it'd be safer to do if (dwarf_cu_info() == 0 && unit_type == skeleton) pf->cu_die = subdie; Thanks, Namhyung > + > /* Check if target file is included. */ > if (pp->file) > pf->fname = cu_find_realpath(&pf->cu_die, pp->file); > -- > 2.20.1 >