From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-0010f301.pphosted.com (mx0a-0010f301.pphosted.com [148.163.149.254]) by sourceware.org (Postfix) with ESMTPS id 945B73858400 for ; Wed, 10 Nov 2021 15:14:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 945B73858400 Received: from pps.filterd (m0102855.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 1AA9e3cw027974; Wed, 10 Nov 2021 09:14:26 -0600 Received: from mh3.mail.rice.edu (mh3.mail.rice.edu [128.42.199.10]) by mx0b-0010f301.pphosted.com (PPS) with ESMTPS id 3c89afrcde-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Nov 2021 09:14:25 -0600 Received-X: from mh3.mail.rice.edu (localhost [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id ECA146037E5; Wed, 10 Nov 2021 09:14:24 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by mh3.mail.rice.edu (Postfix) with ESMTP id EB6F66037DD; Wed, 10 Nov 2021 09:14:24 -0600 (CST) X-Virus-Scanned: by amavis-2.12.1 at mh3.mail.rice.edu, auth channel Received: from mh3.mail.rice.edu ([127.0.0.1]) by localhost (mh3.mail.rice.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id oap3rbCg4S2l; Wed, 10 Nov 2021 09:14:14 -0600 (CST) Received: from [192.168.50.202] (c-98-200-175-18.hsd1.tx.comcast.net [98.200.175.18]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: johnmc@rice.edu) by mh3.mail.rice.edu (Postfix) with ESMTPSA id E536021F84C; Wed, 10 Nov 2021 09:14:13 -0600 (CST) From: John Mellor-Crummey Message-Id: Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [PATCH] (v2) read inlining info in an NVIDIA extended line map Date: Wed, 10 Nov 2021 09:14:13 -0600 In-Reply-To: Cc: John Mellor-Crummey , elfutils-devel@sourceware.org, Jonathon Anderson , Xiaozhu Meng To: Mark Wielaard References: <7C166312-4876-444F-9B85-C7E30C8F4959@rice.edu> <37B899F3-FD5F-4F7B-9F1B-BE63CF84F554@rice.edu> <413A462A-D548-452E-9323-5193339C288A@rice.edu> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Proofpoint-GUID: vK3TNVQxozhyrD0yw771RCDLySFFd-Su X-Proofpoint-ORIG-GUID: vK3TNVQxozhyrD0yw771RCDLySFFd-Su X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-10_05,2021-11-08_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 bulkscore=0 adultscore=0 priorityscore=1501 clxscore=1011 mlxlogscore=980 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111100080 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 15:14:43 -0000 Mark, Your tweaks are fine. Many thanks for accepting our patch before 186! -- John Mellor-Crummey Professor Dept of Computer Science Rice University email: johnmc@rice.edu phone: 713-348-5179 > On Nov 10, 2021, at 4:16 AM, Mark Wielaard wrote: >=20 > Hi John, >=20 > On Thu, Nov 04, 2021 at 04:41:58PM -0500, John Mellor-Crummey via = Elfutils-devel wrote: >> Here I describe just the improvements to that patch that address = Mark=E2=80=99s concerns: >>=20 >> (1) all of the code for handling NVIDIA DWARF extensions is always >> available; there is no special configuration switch needed. >> (2) all changes are bracketed by comments that mark them NVIDIA >> extensions >> (3) the DWARF extended opcodes have been renamed with names that >> include NVIDIA in them >> (4) the two new API functions to surface the new information have >> been improved to separate the interface result from the internal >> representation (at Mark=E2=80=99s request) >> (4a) the API for extracting the name of an inlined function in a >> DWARF line now returns a const char * instead of a string >> table index >> (4b) the API for extracting an inline =E2=80=9Ccontext=E2=80=9D = now returns a >> pointer to a DWARF line where the code is inlined rather >> than returning an unsigned int (an index into the line table >> that one could use to compute the pointer) >> (5) there are test cases for readelf and libdw that use a binary >> generated by NVIDIA=E2=80=99s compiler. the test cases include = information >> about how the binary was generated >=20 > This is really nice. I did make a few tweaks: >=20 > - Added your original overview as commit message because it contains > all the relevant context and pointers to more information. >=20 > - Added ChangeLog and NEWS entries, mainly for my own review. >=20 > - I removed the bracketed comments, I think they cluttered the code > and made it seem like we wanted to remove it or disable at some > point. I think it should just be considered part of the normal code > now. >=20 > - I removed the NVIDIA_LINEMAP_INLINING_EXTENSIONS define from > version.h. If people want they can have a configure check for the > new dwarf_linecontext or dwarf_linefunctionname functions or the > DW_LNE_NVIDIA_inlined_call or DW_LNE_NVIDIA_set_function_name > constants. >=20 > - I made dwarf_linefunctionname always return NULL on error (not > the magic string "???", which is still used in readelf). >=20 > - Changed the header check to be exactly 4 bytes, so we are sure to be > able to read the str offset completely (if it is smaller or larger > we cannot handle it). >=20 > - The new dwarf_linecontext and dwarf_linefunctionname get their own > new ELFUTILS_0.186 section in libdw.map because they are introduced > with verion 0.186. >=20 > - The new run-nvidia-extended-linemap-libdw.sh and > run-nvidia-extended-linemap-readelf.sh sripts and > testfile_nvidia_linemap.bz2 testfile were added to EXTRA_DIST so > they show up in a dist tarball. >=20 > Patch as committed attached. Hope you don't mind the cleanups. >=20 > We still want to reduce the size of the Dwarf_Line_s and struct > line_state (independent of these extensions). I opened a new bug for > that: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28574 >=20 > Thanks, >=20 > Mark<0001-libdw-readelf-Read-inlining-info-in-NVIDIA-extended-.patch>