[PATCH 5/9] Android: hard code the trace file path to be under /data

Imre Deak imre.deak at intel.com
Wed Apr 11 08:19:35 PDT 2012


On Android for Dalvik applications cwd is preset to that of the zygote
(app_process) process and it's the root directory. Since root is r/o
mounted by default it's more convenient to have the trace file in /data
which is writeable at least by root by default.

Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 common/trace_writer_local.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/common/trace_writer_local.cpp b/common/trace_writer_local.cpp
index a3ab720..5aeedac 100644
--- a/common/trace_writer_local.cpp
+++ b/common/trace_writer_local.cpp
@@ -89,7 +89,11 @@ LocalWriter::open(void) {
 #endif
         process.trimDirectory();
 
-        os::String prefix = os::getCurrentDir();
+#ifdef ANDROID
+	os::String prefix = "/data";
+#else
+	os::String prefix = os::getCurrentDir();
+#endif
         prefix.join(process);
 
         for (;;) {
-- 
1.7.5.4



More information about the apitrace mailing list