This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add CSV export for trace metrics
ClosedPublic

Authored by sammccall on May 9 2020, 1:43 PM.

Diff Detail

Event Timeline

sammccall created this revision.May 9 2020, 1:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2020, 1:43 PM
kadircet accepted this revision.May 10 2020, 1:17 AM
kadircet marked 2 inline comments as done.

Thanks, LGTM!

clang-tools-extra/clangd/support/Trace.cpp
210

do we ever expect to have any of \r \n , " in a label? I think it would be OK to just assert notNeedsQuote on Label.

Up to you though.

214

unused var

215

acquire Mu before printing ?

221

why not use integers instead?

251

what are the benefits for making these absolute apart from being able to merge streams coming from different runs?
I am not sure if we'll ever merge data from multiple users, or even multiple runs from the same user.

This would help decrease output size only by a couple percents though, so not that important. Just wondering if there are any other reasons.

clang-tools-extra/clangd/unittests/support/TraceTests.cpp
183

nit: maybe have a getLines() in the fixture.

This revision is now accepted and ready to land.May 10 2020, 1:17 AM
sammccall marked 6 inline comments as done.May 11 2020, 3:37 AM
sammccall added inline comments.
clang-tools-extra/clangd/support/Trace.cpp
210

I don't think it's terribly likely but I can certainly imagine:

  • using a filename as a label, and some people have weird filenames
  • wanting a compound label, and choosing comma as a separator

I was torn between:

  • doing the escaping (seems a little silly)
  • asserting (a bit of a time bomb in cases above)
  • just ignoring this and outputting garbage

Chose A because it's pretty short, and I wrote a test :-)

251

Yeah no good reason I think. Removed.
Was thinking about converting into walltimes in analysis but it seems unlikely.

sammccall updated this revision to Diff 263137.May 11 2020, 3:38 AM

Address comments

kadircet accepted this revision.May 11 2020, 5:24 AM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.May 19 2020, 6:08 AM

This broke tests on Windows: http://45.33.8.238/win/15539/step_9.txt

Please take a look, and revert if it takes a while to investigate.

(I'll note that the presubmit bot now has a win/msvc bot that failed compile and reported this on this review before it got merged: https://reviews.llvm.org/B56290 . the bot i linked to builds with clang. i'm guessing the msvc bot would also fail tests once the compile is fixed there.)