[Lldb-commits] [PATCH] D124573: [trace][intelpt] Support system-wide tracing [1] - Add a method for accessing the list of logical core ids

walter erquinigo via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 28 11:35:14 PDT 2022


wallace added inline comments.


================
Comment at: lldb/include/lldb/Utility/TraceIntelPTGDBRemotePackets.h:22
+// List of data kinds used by jLLDBGetState and jLLDBGetBinaryData.
+struct IntelPTDataKinds {
+  static const char *kProcFsCpuInfo;
----------------
jj10306 wrote:
> why not use an enum here?
> having "kinds" in the name already makes it sound like an enum and seeing IntelPTDataKinds:: everywhere immediately made me thing it was an enum.
this is actually an enum, but it's an enum of strings. So we have a few options:

- have a normal int enum and have another function that converts int -> const char*. 
- create a fake enum with class static variables like here
- use header inline variables, but they are not available in the C++ version used by LLDB.

Overall I found this to be the simplest way to implement it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124573/new/

https://reviews.llvm.org/D124573



More information about the lldb-commits mailing list