[Lldb-commits] [lldb] [lldb][telemetry] Implement LLDB Telemetry (part 1) (PR #119716)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 6 08:06:45 PST 2025
================
@@ -0,0 +1,100 @@
+//===-- Telemetry.h ----------------------------------------------*- C++
+//-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_CORE_TELEMETRY_H
+#define LLDB_CORE_TELEMETRY_H
+
+#include "lldb/Core/StructuredDataImpl.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Utility/StructuredData.h"
+#include "lldb/lldb-forward.h"
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/JSON.h"
+#include "llvm/Telemetry/Telemetry.h"
+#include <chrono>
+#include <ctime>
+#include <memory>
+#include <optional>
+#include <string>
+#include <unordered_map>
+
+namespace lldb_private {
+
+using llvm::telemetry::Destination;
----------------
labath wrote:
Maybe, but if you don't want a namespace, then you should be also be careful about other names that you create. For example, `lldb_private::LldbEntryKind` is not very telling (it doesn't tell you that it has anything to do with telemetry, the string "lldb" in the name is redundant. In this setup I'd probably go with `lldb_private::TelemetryEntryKind`. Same goes for `EventStats` which sounds like it has something to do with the `Event` class in `Utility/Event.h` (it doesn't) and `SteadyTimePoint`, which could be generic, but it's suprising to see it defined in Telemetry.h. So, `TelemetryEventStats` and `TelemetryTimePoint` ?
You don't have to do that, but after writing all this I'm starting to incline towards putting everything in a namespace.. Then the names can stay pretty much as they are?
https://github.com/llvm/llvm-project/pull/119716
More information about the lldb-commits
mailing list