19 "perfContextSwitchTrace";
27 return json::Value(formatv(
"{0:x+}", uint64.
value));
29 return json::Value(formatv(
"{0}", uint64.
value));
33 if (std::optional<uint64_t> val = value.getAsUINT64()) {
36 }
else if (std::optional<StringRef> val = value.getAsString()) {
37 if (!val->getAsInteger(0, uint64.
value))
39 path.report(
"invalid string number");
41 path.report(
"invalid number or string number");
47 ObjectMapper o(value, path);
65 json::Object &obj = *base.getAsObject();
68 obj.try_emplace(
"psbPeriod", packet.
psb_period);
69 obj.try_emplace(
"enableTsc", packet.
enable_tsc);
77 uint64_t rem_flag = (((uint64_t)1 <<
time_shift) - 1);
78 uint64_t rem = tsc & rem_flag;
90 return json::Value(json::Object{
99 ObjectMapper o(value, path);
100 uint64_t time_mult, time_shift;
101 if (!(o && o.map(
"timeMult", time_mult) && o.map(
"timeShift", time_shift) &&
111 ObjectMapper o(value, path);
119 json::Object &obj = *base.getAsObject();
A class that represents a running process on the host machine.
bool fromJSON(const llvm::json::Value &value, TraceSupportedResponse &info, llvm::json::Path path)
llvm::json::Value toJSON(const TraceSupportedResponse &packet)
static const char * kIptTrace
static const char * kProcFsCpuInfo
static const char * kPerfContextSwitchTrace
Helper structure to help parse long numbers that can't be easily represented by a JSON number that is...
jLLDBTraceGetState gdb-remote packet
uint64_t ToTSC(uint64_t nanos) const
uint64_t ToNanos(uint64_t tsc) const
Convert TSC value to nanosecond wall time.
std::optional< LinuxPerfZeroTscConversion > tsc_perf_zero_conversion
The TSC to wall time conversion if it exists, otherwise nullptr.
bool using_cgroup_filtering
jLLDBTraceStart gdb-remote packet
bool IsPerCpuTracing() const
bool enable_tsc
Whether to enable TSC.
std::optional< bool > disable_cgroup_filtering
Disable the cgroup filtering that is automatically applied in per cpu mode.
std::optional< bool > per_cpu_tracing
Whether to have a trace buffer per thread or per cpu cpu.
std::optional< uint64_t > psb_period
PSB packet period.
std::optional< uint64_t > process_buffer_size_limit
Required when doing "process tracing".
uint64_t ipt_trace_size
Size in bytes to use for each thread's trace buffer.
jLLDBTraceStart gdb-remote packet
bool IsProcessTracing() const
jLLDBTraceStart