[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-05 Thread UTKARSH SAXENA via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe397a0a5c3c0: [clangd] Add instrumentation mode in clangd for metrics collection. (authored by usaxena95). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-05 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 248422. usaxena95 added a comment. Passed score as a float as an explicit argument of the callback. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75603/new/ https://reviews.llvm.org/D75603 Files:

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-05 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 added inline comments. Comment at: clang-tools-extra/clangd/CodeComplete.h:139 + /// in the output. + std::function *RecordCCResult = nullptr; sammccall wrote: > I'd suggest including the final score in the signature rather than recompute > it,

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-05 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 248416. usaxena95 marked 5 inline comments as done. usaxena95 added a comment. Addressed comments. - Populated score in CodeCompletion before invoking the callback. - Tested that CodeCompletion is scored - Updated comment for callback. Repository: rG

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-05 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. In D75603#1906418 , @sammccall wrote: > Forgot to mention: I also think the trace approach certainly has things going > for it, or even parsing out the messages from the existing logs. > But in this particular case the callback

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Forgot to mention: I also think the trace approach certainly has things going for it, or even parsing out the messages from the existing logs. But in this particular case the callback happens to be extremely convenient and also not invasive (since the data structures

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/CodeComplete.h:136 + + /// Allows capturing various internal structures used by clangd during code + /// completion. Eg:

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 marked 3 inline comments as done. usaxena95 added inline comments. Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1465 +if (Opts.EnableInstrumentationMode) + (*Opts.RecordCCResults)(toCodeCompleteResult(Top)); + kadircet wrote: > can't

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 248240. usaxena95 marked 2 inline comments as done. usaxena95 added a comment. Remove ununsed import. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75603/new/ https://reviews.llvm.org/D75603 Files:

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 248233. usaxena95 marked 3 inline comments as done. usaxena95 added a comment. Changed to invoke callback on all code completion items. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75603/new/

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/CodeComplete.cpp:1465 +if (Opts.EnableInstrumentationMode) + (*Opts.RecordCCResults)(toCodeCompleteResult(Top)); + can't we make use of the trace::Span instead ? Repository: rG

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/CodeComplete.h:141 + /// Ideally this must be disabled when being used by ClangdLSPServer. + bool EnableInstrumentationMode = false; + std::function* RecordCCResults; I'm wondering if we

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 updated this revision to Diff 248160. usaxena95 added a comment. Addressed linter issues. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75603/new/ https://reviews.llvm.org/D75603 Files: clang-tools-extra/clangd/CodeComplete.cpp

[PATCH] D75603: [clangd] Add instrumentation mode in clangd for metrics collection.

2020-03-04 Thread UTKARSH SAXENA via Phabricator via cfe-commits
usaxena95 created this revision. usaxena95 added a reviewer: sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. This patch adds an instrumentation mode for clangd (enabled by corresponding option in cc_opts). If