New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 843246 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

Code Coverage: Demangle template instantiations to indicate the type of T

Project Member Reported by rsleevi@chromium.org, May 15 2018

Issue description

Example report:
https://chromium-coverage.appspot.com/reports/558266/linux/chromium/src/net/ntlm/ntlm_buffer_writer.cc.html

NtlmBufferWrite::WriteUInt is templatized, and there's three invocations (lines 35-49)

These are reported after line 169 inline (which, by the way, is absolutely amazing work and kudos to the team for that), but with a header block for each of those that indicates the templated invocation.

It would be awesome to run those through the symbolizer, so that their types can be distinguished from the type name.
 
Summary: Code Coverage: Demangle template instantiations to indicate the type of T (was: Code Coverage: Symbolize template instantiations to indicate the type of T)
It looks like it's just a matter of passing along a name demangler via the -Xdemangler option, as per https://llvm.org/docs/CommandGuide/llvm-cov.html#llvm-cov-show , as part of the line-by-line invocation as part of https://chromium.googlesource.com/chromium/src/+/acb53bd0a13e18d85743f30c83dd560ea1e8f175/tools/code_coverage/coverage.py#510

I'm not sure if just passing llvm-symbolizer was the correct one, but it seems like it would be?


Er, sorry, C++filt

Comment 3 by mmoroz@chromium.org, May 15 2018

 Issue 842303  has been merged into this issue.

Comment 4 by mmoroz@chromium.org, May 15 2018

Labels: -Pri-3 Pri-1
Status: Available (was: Untriaged)
Thanks a lot for the report and for the investigation! C++filt seems to work find on Linux:

$ echo _ZN3net4ntlm16NtlmBufferWriter9WriteUIntIjEEbT_ | c++filt 
bool net::ntlm::NtlmBufferWriter::WriteUInt<unsigned int>(unsigned int)

Should be an easy patch. Do you want to give it a try? :)

Yeah, I had a local patch - my uncertainty was around the cross-platform requirements for the script, since c++filt will only conditionally be available, even on Linux, so it didn't seem a good long term option.

I wasn't sure the cross-platform plans, and whether we'd want to opt for per-platform solutions (similar to //base/debug/stack_trace_*), or whether we were looking at something integrated with llvm (like https://llvm.org/docs/CommandGuide/llvm-symbolizer.html , as used by asan_symbolize.py)

Comment 6 by mmoroz@chromium.org, May 15 2018

Yes, llvm-symbolizer would be a better choice in a long term, as I think we have it available on all platforms.

But in the meantime, while we are running only Linux bots for the dashboard reports, I wouldn't mind to have something like "if linux: add option -Xdemangler=C++filt"

Comment 7 by aarya@google.com, May 15 2018

llvm-symbolizer is the preferred option, even for cross-platform. See _GetPathWithLLVMSymbolizerDir, might need to put that in PATH for llvm-cov.

Comment 8 by aarya@google.com, May 15 2018

ah sorry i didn't read Max's comment, c++filt is fine for now for non-win platforms. it works fine on mac too.

Comment 9 by aarya@google.com, May 15 2018

Owner: rsleevi@chromium.org
Status: Assigned (was: Available)
Ryan, assigning to you since you have the patch already for this :)
Project Member

Comment 11 by bugdroid1@chromium.org, May 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae19b2c36a367858c631fb533c0e7c1bc8fee677

commit ae19b2c36a367858c631fb533c0e7c1bc8fee677
Author: Ryan Sleevi <rsleevi@chromium.org>
Date: Tue May 15 22:36:17 2018

Run coverage reports through c++filt on Linux and macOS.

The code coverage reports from llvm-cov will emit detailed coverage
information for instantiated templates, but by default, will emit
the method names using their mangled form. llvm-cov allows for
providing a custom demangler.

This conditionally provides custom demangler, using c++filt when
running on Linux and macOS. Longer-term, a solution based on
llvm-symbolizer is more desirable for platform neutrality, but
this helps bridge the short-term need.

BUG= 843246 

Change-Id: I718016b05af0842ac148d06e968f362bc68b5fc8
Reviewed-on: https://chromium-review.googlesource.com/1060264
Commit-Queue: Ryan Sleevi <rsleevi@chromium.org>
Reviewed-by: Abhishek Arya <inferno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558863}
[modify] https://crrev.com/ae19b2c36a367858c631fb533c0e7c1bc8fee677/tools/code_coverage/coverage.py

Code Coverage owners: Would you rather close this and leave the switch to llvm-symbolizer as part of the cross-platform work (is their a bug to star for Windows?), or leave it open to track the remaining xplat stuff?
Status: Fixed (was: Started)
I think this will come up later anyway (e.g. during issue 809150), so let's close this one. Thanks a lot, Ryan!
Status: Verified (was: Fixed)

Sign in to add a comment