From patchwork Sat Dec 21 01:23:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ihor Solodrai X-Patchwork-Id: 13917577 Received: from mail-10630.protonmail.ch (mail-10630.protonmail.ch [79.135.106.30]) (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 4792F195 for ; Sat, 21 Dec 2024 01:23:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.30 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734744223; cv=none; b=nhNfjEJn7aU9199JRaCCI443ZYTCHwaPaMze6xxWwI6xeLP9gl8UxgdNFXPLz5yN/xzgYFdd+nDpMeY8M6r/tE6rHQRDPooBGt9r1jKakNSjzZrvgF6lalecBi4eA4qhYtSm4rh5ZtT30byQZIZ0jWB0pK61YXQf5XIQgycj6+4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734744223; c=relaxed/simple; bh=9VYo4eAq8RtKh26vAo1Pibss4Qs1/eQYick6zfQAWUw=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iAB+La2lIlSutRtIswTFd//S4Js6DaCgaB93TmFfc2MNLkHOuC6DpMnWymmlSpYdAv0MSiwe98XKlGN32c9Lo2fhfWVLTGYEqvBc6EpGO6mai7LGzF6kvPbFBUwlacRbaM10UHUbW/sP4254SD+xFhXVi2xpr/MCKh3mbsMoGys= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me; spf=pass smtp.mailfrom=pm.me; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b=dmTci8vA; arc=none smtp.client-ip=79.135.106.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=pm.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pm.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="dmTci8vA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail3; t=1734744215; x=1735003415; bh=3HTyN4hBVyv4EZy8tnxCPMjsPI0vmWa0uqugOYJgCRM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=dmTci8vAO7YVk4oEjOA4+6RpurDxqq80l9pge9jmnm6xA+ZrcgmEeNHYKCE+bNKe6 0aZq1U5LwUsn9HVICtQndeB5kDIVIozPSWGHy+CnywdQsQcwnEStnKzmity6vx7lUR YZSAzbT1IQE2f7JGJN+Y7IK0aLI4KOxIs6epnm9hCa5ymN9ijkbnLlDPLBtUK+cMAx nCnWClxJlVVwEOMz8r9L5iu92Fdy7xuYMv/dGcQ06A5h/ExPP1Z29Z2vp4OfKgZmXC vBXTsMnLTsJNHrwtsIL/RCUkMnEp3F6rRr30gU/3nxrNsNz/Nxp6EcqJ+pG/Gjl+hu 3zn8keq6j3gUA== Date: Sat, 21 Dec 2024 01:23:30 +0000 To: dwarves@vger.kernel.org From: Ihor Solodrai Cc: acme@kernel.org, alan.maguire@oracle.com, eddyz87@gmail.com, andrii@kernel.org, mykolal@fb.com, bpf@vger.kernel.org Subject: [PATCH dwarves v3 6/8] dwarf_loader: introduce cu->id Message-ID: <20241221012245.243845-7-ihor.solodrai@pm.me> In-Reply-To: <20241221012245.243845-1-ihor.solodrai@pm.me> References: <20241221012245.243845-1-ihor.solodrai@pm.me> Feedback-ID: 27520582:user:proton X-Pm-Message-ID: c41e20e40a76bb309c60cd1a16b18dfd3a8c84e0 Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add an id member to the struct cu. An id is an index of a CU, in order they are created in dwarf_loader.c This allows for an easy identification of a CU, particularly when they need to be processed in order. Signed-off-by: Ihor Solodrai --- dwarf_loader.c | 4 ++++ dwarves.h | 1 + 2 files changed, 5 insertions(+) diff --git a/dwarf_loader.c b/dwarf_loader.c index 598fde4..4f07e17 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -3440,6 +3440,7 @@ struct dwarf_cus { int build_id_len; int error; struct dwarf_cu *type_dcu; + uint32_t nr_cus_created; }; struct dwarf_thread { @@ -3472,6 +3473,9 @@ static struct dwarf_cu *dwarf_cus__create_cu(struct dwarf_cus *dcus, Dwarf_Die * cu->priv = dcu; cu->dfops = &dwarf__ops; + cu->id = dcus->nr_cus_created; + dcus->nr_cus_created++; + return dcu; } diff --git a/dwarves.h b/dwarves.h index 1cb0d62..2d08883 100644 --- a/dwarves.h +++ b/dwarves.h @@ -290,6 +290,7 @@ struct cu { struct ptr_table functions_table; struct ptr_table tags_table; struct rb_root functions; + uint32_t id; const char *name; char *filename; void *priv;