Include pid in trace metadata
Change-Id: I5d23fc7da94c1a344850833dfbbaa330fdbe28a7
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 88be23f..3734903 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -17,6 +17,7 @@
#include "trace.h"
#include <sys/uio.h>
+#include <unistd.h>
#define ATRACE_TAG ATRACE_TAG_DALVIK
#include "cutils/trace.h"
@@ -534,6 +535,7 @@
os << StringPrintf("num-method-calls=%zd\n", num_records);
os << StringPrintf("clock-call-overhead-nsec=%d\n", clock_overhead_ns_);
os << StringPrintf("vm=art\n");
+ os << StringPrintf("pid=%d\n", getpid());
if ((flags_ & kTraceCountAllocs) != 0) {
os << StringPrintf("alloc-count=%d\n", Runtime::Current()->GetStat(KIND_ALLOCATED_OBJECTS));
os << StringPrintf("alloc-size=%d\n", Runtime::Current()->GetStat(KIND_ALLOCATED_BYTES));