Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1058050lqt; Tue, 19 Mar 2024 11:19:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVcnfGEtfRBUBLxVgzTWbezyVpHy+qPdALsvYETcQJhRoTT1yAa+iBTs1Wg6EOa8Y9VY4wSnYFqO5gi6Ovh22Y5+ZyKI0P0jgCMLKm+tg== X-Google-Smtp-Source: AGHT+IEDb5QBVJTOw0mx0ipJMrw0nsO3iLgP4/U7qk1OMraXCWhxPIWt8u4aWhIn9Wdcw3eqvJk5 X-Received: by 2002:a17:907:76e9:b0:a44:e92:ebcb with SMTP id kg9-20020a17090776e900b00a440e92ebcbmr2428319ejc.21.1710872382887; Tue, 19 Mar 2024 11:19:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710872382; cv=pass; d=google.com; s=arc-20160816; b=zOU44R0FdR8vLGyA/sfMOqBWAK1adhUMNxY3lc23wawim0evNUMGwATvP4CNkFCupi ZsXeBs8BoNu/ZoEWqz3dHZhXy9fBc7iB539DnHTeAbb+cA+SCaei57/2RdtNXwoOttYm nTAl05K3oEzjdHTrrzUOJOH6r31/XoQ27DqZGBIUfjbGxjW4CdmsdKzr2jsLreyUaQZN 26ghNqmkgQ6cla4uA0FORJVcsMMReE1vC/VqRRsWT8RJn6wodbAyePHYWdNIq9ohGv/2 /R0E8xq2qCsyBey034UQQj4nZNfSmFuxUFdktU2YT87vZI3iRDCK5Ps6hbh0thwVYlKW QnjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+Wo708MgNkmfubUadkAZRbHpIU2vu+csLp+GDPjQdR4=; fh=W3KJ4rXcu85ubgqT2134A/cdx6WzcKhVk/3nUKtpIrQ=; b=EXBFewnvN+FX3YrqfnqsyG/TdiR6bsszu3cW59Z9Azwi6Olzz09vRl31KLSGOXNZk+ QQjgB4QvhkxyZXsg7Kk807AqEjo5NC5dWaaN8bcUCqBRkfN6xf1lEgI7qSutHbmJ/j0o DdbK6ZdIFwNJ+GZft6EyKy9RI8fDbH1k5V/qXdZw4WdFXrFKWtwNlxXp+/gOO2/j2dJh 3m8Qslc3L9tQuATRi5SQ1wyfTEzk0BP7mYnPKW20pvUbGDIYDHzFJwnsH4CJJMif0+35 O+XWezw7xOStOgt9lrpJFC7uK5edmScYnkNU8SjUkd8Ca2k15Ta0gxEOfMvHkTb5bUnw /5hg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zwt93e6S; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-107996-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gg15-20020a170906e28f00b00a462fa148ddsi5495386ejb.544.2024.03.19.11.19.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 11:19:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107996-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Zwt93e6S; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-107996-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107996-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9B9A21F23612 for ; Tue, 19 Mar 2024 18:19:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 337A333CCF; Tue, 19 Mar 2024 18:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Zwt93e6S" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49AA339AE7; Tue, 19 Mar 2024 18:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872361; cv=none; b=U+8CBhikrHT+hJL1apq5r2Tel5O2oa3Nj6Fy58/26gdKQnWFUbfWuYqF17FxC94KioeDCWUsG21X/X7m2RUIMmVagZ+llHFCrssn3xJj8CCmRzuo0t5kbu6moy+6VblTv0vseQ/BMmr3tJS+XTApwcKA+m/XP180kJhHhiCZEQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710872361; c=relaxed/simple; bh=i0jJsj6QvM/T9Iar8vRpnhnFjXjdbecnQoMeRz8UCm4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sfQxJwrNiamyU1UGMwNrTNNQ1n7Z+CzbfR+rup0FQsl2Qa4XP4YqQlkeB84YR5FuDE6dtzvkTosnoYiQs6AYk769nhq5qQazG/Oqd/L+eWPgtlkbYULQ53SnjyIvotycWUKxU3j63amJwWhF6lCn6ccrU5oHk3apaUUM7RqRznk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Zwt93e6S; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79037C433F1; Tue, 19 Mar 2024 18:19:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710872360; bh=i0jJsj6QvM/T9Iar8vRpnhnFjXjdbecnQoMeRz8UCm4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zwt93e6S4MGi6Vrjb8S0YIhp2ZYSCunZV3Trr1Vboq1hluAIDUahavKnyjRcyQCry PHneLxbf0VmHR3qJ6bi+kHv5U1762hmxc5zQ5VFwqbDZZhxvIb6yW6rs8vhTppnGLe 1EceDQEfvKn10j9FBbYK+fWlKSpb67iuVQDHQiLnS1hYcnJoP9xlFvJ4R+Ssfz+36q ubaas5hxdwkL8SN439jyI3AP37QJ5A0ql6jBw8895asz00VwY/f45lok9Qpd4dcLO5 nhZskBupYmH1D09K0i7C7xP+in004Y/V/nbfJKoFUR8HQIg9klAEQRitgnoNhXcpn1 riD9iDGZZIE0A== Date: Tue, 19 Mar 2024 15:19:14 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ian Rogers , Jiri Olsa , Adrian Hunter , Peter Zijlstra , 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 Subject: Re: [PATCH 04/23] perf dwarf-aux: Add die_find_func_rettype() Message-ID: References: <20240319055115.4063940-1-namhyung@kernel.org> <20240319055115.4063940-5-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Mar 19, 2024 at 10:42:00AM -0700, Namhyung Kim wrote: > On Tue, Mar 19, 2024 at 6:56 AM Arnaldo Carvalho de Melo > > > + return NULL; > > > + > > > + if (die_get_real_type(&tmp_die, die_mem) == NULL) > > > + return NULL; > > > > > > Here you check die_get_real_type() return, may I go and do the same for > > the previous patch to address my review comment? > > Sure thing! :) Ack? - Arnaldo diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c index cd9364d296b6bf42..09fd6f1f0ed8eac3 100644 --- a/tools/perf/util/dwarf-aux.c +++ b/tools/perf/util/dwarf-aux.c @@ -1856,7 +1856,10 @@ static int __die_find_member_offset_cb(Dwarf_Die *die_mem, void *arg) if (offset == loc) return DIE_FIND_CB_END; - die_get_real_type(die_mem, &type_die); + if (die_get_real_type(die_mem, &type_die) == NULL) { + // TODO: add a pr_debug_dtp() later for this unlikely failure + return DIE_FIND_CB_SIBLING; + } if (dwarf_aggregate_size(&type_die, &size) < 0) size = 0;