[Lldb-commits] [lldb] [LLDB][Telemetry]Define TargetInfo for collecting data about a target (PR #127834)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 12 04:26:44 PDT 2025
labath wrote:
> Does that make sense?
Somewhat, but I think there's still a lot of confusion between a target vs. process vs. the main executable of the target.
>
> * How long did it take to load the target? ( the first time it was load vs subsequent times ...)
Define "target". Define "loading a target". When a process does an execve is it still the same target (as far as the rest of lldb is concerned, it is, even though it starts executing a different binary)?
Right now, you're measuring the time it takes to run SetExecutableModule. I think that's a reasonable thing to measure. What I have a problem with is drawing a line between that and SetExitStatus, as those two things are very different. I also (to a slightly lesser degree) have an issue with calling that "TargetInfo", as it's really information about what we're doing with the executable module (for some target).
In the lldb object model, there's isn't really a concept of "loading a target". Target's can be *created*. They can be created with or without an executable module. If they're created without it, the module can be set at a later time (e.g. during an attach operation). While setting the executable module, the debug info for that module may or may not be parsed, depending on the `preload-symbols` setting. I think this is the definition of "loading" you're referring to, but that is not "loading a target", that is "loading (parsing) the debug info for a module" (which happens to be the executable module of some target).
If you want to measure SetExecutableModule, then I think you should call it that (SetExecutableModuleInfo?). With that framing, I think everything you have here makes sense. You are reporting that we've set (for whatever reason) the executable module (identified by its UUID) of a target (we don't have a way to identify a target independently of its executable, but it sounds like you don't care about that), and saying it took certain amount of seconds.
> * Did the target exit successfully? (if not, what was the issue) How long did the "exit" take?
Similarly, I have an issue with this framing, because targets don't exit (processes do). I'd call this ProcessExitInfo, because that's exactly what it's doing: it reports that a process, identified by the UUID of its executable (which, ideally, is one of the executables that we've set earlier, but there isn't an exact 1:1 matching between the two events) has exited and how it did that.
https://github.com/llvm/llvm-project/pull/127834
More information about the lldb-commits
mailing list