<rdar://problem/12720514> Sub-TLF: Provide service to profile the inferior
This allows client to query profiling states on the inferior.
llvm-svn: 168228
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index 51cc340..65adbee 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -366,6 +366,29 @@
return bytes_read;
}
+size_t
+SBProcess::GetAsyncProfileData(char *dst, size_t dst_len) const
+{
+ size_t bytes_read = 0;
+ ProcessSP process_sp(GetSP());
+ if (process_sp)
+ {
+ Error error;
+ bytes_read = process_sp->GetAsyncProfileData (dst, dst_len, error);
+ }
+
+ LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+ if (log)
+ log->Printf ("SBProcess(%p)::GetProfileData (dst=\"%.*s\", dst_len=%llu) => %llu",
+ process_sp.get(),
+ (int) bytes_read,
+ dst,
+ (uint64_t)dst_len,
+ (uint64_t)bytes_read);
+
+ return bytes_read;
+}
+
void
SBProcess::ReportEventState (const SBEvent &event, FILE *out) const
{