Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp727186pxj; Thu, 27 May 2021 10:15:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUlYFWVmmLpYhjNgbrKGp6EDKtWFGAT060EVSU9da6ddS844+1cpauhz8sZZC/BNLjoiD+ X-Received: by 2002:a17:906:f0cd:: with SMTP id dk13mr4975813ejb.11.1622135750098; Thu, 27 May 2021 10:15:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622135750; cv=none; d=google.com; s=arc-20160816; b=iwUI1i706e8FTty4qH8CaWpfwZptdQd5Q/uk9VjhagS/r/QdLtvKUqpdR8gNS2Br8f lT3ddnzkuKxdDv92V4sx8uTJXNowVTrRS+u9pmTeDAlXNCrnHHKbpK1YtezqTLAKrrDT qp9gAkW06pmGgvw2ZWSp7tUvg9g4ZaBJhkPEw/1n9AoxUIUVFIfqkj+BKYMktQE5qRXv W89iQ81gdSF+bEWx78BjWtleYqu690sy6rWc3DRMJYpdOisNm0RoKFIbLhR9KbCqNyo4 iqz9ERRPS4fKuRp8uZUXumM69QKEkhGaWWN1ZdEg0Yp5DptGIQDmEOTnt6LdQxanbqKa s2yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7hlR8gYx77tBFonlMU3/+f2nN/Ln76kbq+H8w9bWiUI=; b=WUuWLCOIcZdc8j84KiTixYjMJni+tggz/4rt8SaFlICcly2cOU2WgjPGoq20zMhlV1 NacsT5zTTIrJiYqR8IykKNUxpsPSWV8UKRh76vOs/Wm619bZmDjVxDNHgB8dRuNvDOoN 99c/tog9n+F53e5nEa0jQS9V0+r8PCYvBGra5Fxaehk7ysN6tCjLQTQg0cDzQQXFBPqM kBkXgqICdCDz2rXDNoSs1Ajh5BHXz8Ww9ekyvQyfurZgMEY/+f7CeLtz2LfrdMlx1nru ZaGpqTE8OCZiOkuWYd2aFoyasFf9mg2F0vhCd72yM+qN7v0B3vb2scO902v/zAFEcOIU yuFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cGbPbrDH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si1864948edj.577.2021.05.27.10.15.25; Thu, 27 May 2021 10:15:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cGbPbrDH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236983AbhE0PPC (ORCPT + 99 others); Thu, 27 May 2021 11:15:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:43264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236878AbhE0POn (ORCPT ); Thu, 27 May 2021 11:14:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 41CE7613BF; Thu, 27 May 2021 15:13:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622128389; bh=3yNOj5++PHfWawBsKTMH8sT6z9qB4FaUjWSAGNh9MhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cGbPbrDH/Ol2Zygc/CGe5j8/Wvad/tSDSQESzIenOIPWT2w4+4nK7aL+ZnJJDBxbC mtrzdxOGjI9WhqpymJatASWVOgpq44C49gaCp0DrPEjFZQi37wp8MZTwrPPX9zB+Vc 8mJZHqWrin6fvkQWFs4cj5mGFg0tyun3snanemAw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Rigby , Jan Kratochvil , Jiri Olsa , Arnaldo Carvalho de Melo , "Tommi Rantala" Subject: [PATCH 5.4 6/7] perf unwind: Set userdata for all __report_module() paths Date: Thu, 27 May 2021 17:12:48 +0200 Message-Id: <20210527151139.422851630@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210527151139.224619013@linuxfoundation.org> References: <20210527151139.224619013@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dave Rigby commit 4e1481445407b86a483616c4542ffdc810efb680 upstream. When locating the DWARF module for a given address, __find_debuginfo() requires a 'struct dso' passed via the userdata argument. However, this field is only set in __report_module() if the module is found in via dwfl_addrmodule(), not if it is found later via dwfl_report_elf(). Set userdata irrespective of how the DWARF module was found, as long as we found a module. Fixes: bf53fc6b5f41 ("perf unwind: Fix separate debug info files when using elfutils' libdw's unwinder") Signed-off-by: Dave Rigby Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=211801 Acked-by: Jan Kratochvil Acked-by: Jiri Olsa Link: https://lore.kernel.org/linux-perf-users/20210218165654.36604-1-d.rigby@me.com/ Signed-off-by: Arnaldo Carvalho de Melo Cc: "Tommi Rantala" Signed-off-by: Greg Kroah-Hartman --- tools/perf/util/unwind-libdw.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c @@ -60,10 +60,8 @@ static int __report_module(struct addr_l mod = dwfl_addrmodule(ui->dwfl, ip); if (mod) { Dwarf_Addr s; - void **userdatap; - dwfl_module_info(mod, &userdatap, &s, NULL, NULL, NULL, NULL, NULL); - *userdatap = dso; + dwfl_module_info(mod, NULL, &s, NULL, NULL, NULL, NULL, NULL); if (s != al->map->start - al->map->pgoff) mod = 0; } @@ -79,6 +77,13 @@ static int __report_module(struct addr_l al->map->start - al->map->pgoff, false); } + if (mod) { + void **userdatap; + + dwfl_module_info(mod, &userdatap, NULL, NULL, NULL, NULL, NULL, NULL); + *userdatap = dso; + } + return mod && dwfl_addrmodule(ui->dwfl, ip) == mod ? 0 : -1; }