forked from OSchip/llvm-project
[clangd] Add a helper for exposing tracer status
This commit is contained in:
parent
23a53301c5
commit
20f69ccfe6
|
@ -281,6 +281,8 @@ void log(const llvm::Twine &Message) {
|
|||
T->instant("Log", llvm::json::Object{{"Message", Message.str()}});
|
||||
}
|
||||
|
||||
bool enabled() { return T != nullptr; }
|
||||
|
||||
// The JSON object is event args (owned by context), if the tracer wants them.
|
||||
static std::pair<Context, llvm::json::Object *>
|
||||
makeSpanContext(llvm::Twine Name, const Metric &LatencyMetric) {
|
||||
|
|
|
@ -128,6 +128,9 @@ std::unique_ptr<EventTracer> createCSVMetricTracer(llvm::raw_ostream &OS);
|
|||
/// Records a single instant event, associated with the current thread.
|
||||
void log(const llvm::Twine &Name);
|
||||
|
||||
/// Returns true if there is an active tracer.
|
||||
bool enabled();
|
||||
|
||||
/// Records an event whose duration is the lifetime of the Span object.
|
||||
/// This lifetime is extended when the span's context is reused.
|
||||
///
|
||||
|
|
Loading…
Reference in New Issue