summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/linux/Support.cpp
diff options
context:
space:
mode:
authorRavitheja Addepally <ravitheja.addepally@intel.com>2017-06-28 07:58:31 +0000
committerRavitheja Addepally <ravitheja.addepally@intel.com>2017-06-28 07:58:31 +0000
commit99e376956d6fd12641f8515fb019e9220a2e477f (patch)
tree8a32df6c60408b749b136bab4e0ad149758e872f /lldb/source/Host/linux/Support.cpp
parenteecb353d0e25bae018bad815f9169c73666af5bd (diff)
downloadbcm5719-llvm-99e376956d6fd12641f8515fb019e9220a2e477f.tar.gz
bcm5719-llvm-99e376956d6fd12641f8515fb019e9220a2e477f.zip
Implementation of Intel(R) Processor Trace support for Linux
Summary: This patch implements support for Intel(R) Processor Trace in lldb server. The changes have support for starting/stopping and reading the trace data. The code is only available on Linux versions where the perf attributes for aux buffers are available. The patch also consists of Unit tests for testing the core buffer reading function. Reviewers: lldb-commits, labath, clayborg, zturner, tberghammer Reviewed By: labath, clayborg Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D33674 llvm-svn: 306516
Diffstat (limited to 'lldb/source/Host/linux/Support.cpp')
-rw-r--r--lldb/source/Host/linux/Support.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lldb/source/Host/linux/Support.cpp b/lldb/source/Host/linux/Support.cpp
index 8fbb60052e3..31808401ea6 100644
--- a/lldb/source/Host/linux/Support.cpp
+++ b/lldb/source/Host/linux/Support.cpp
@@ -32,3 +32,13 @@ lldb_private::getProcFile(::pid_t pid, const llvm::Twine &file) {
LLDB_LOG(log, "Failed to open {0}: {1}", File, Ret.getError().message());
return Ret;
}
+
+llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>>
+lldb_private::getProcFile(const llvm::Twine &file) {
+ Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ std::string File = ("/proc/" + file).str();
+ auto Ret = llvm::MemoryBuffer::getFileAsStream(File);
+ if (!Ret)
+ LLDB_LOG(log, "Failed to open {0}: {1}", File, Ret.getError().message());
+ return Ret;
+}
OpenPOWER on IntegriCloud