[VD] Correct the file format for startup tracing 51/316351/2
authorLizhi Fan <lizhi.fan@samsung.com>
Tue, 20 Aug 2024 03:41:22 +0000 (11:41 +0800)
committerBot Blink <blinkbot@samsung.com>
Sat, 14 Sep 2024 06:21:56 +0000 (06:21 +0000)
Startup tracing usage:
1. Copy trace.config to /tmp of TV
2. Run the web browser or app:
/usr/apps/org.tizen.chromium-efl/bin/ubrowser --trace-config-file=/tmp/trace.config
3. Find the tracing result in /tmp/trace.json

Ref doc:
https://chromium.googlesource.com/chromium/src/+/lkgr/docs/memory-infra/memory_infra_startup_tracing.md

For WebBrowser chromium may be not able to access /tmp/trace.config,
you could put it into /opt/usr/apps/org.tizen.browser directory.

Sometimes WebBrowser can't write tracing result to /tmp,
you may find this log:
[ERROR:startup_tracing_controller.cc: Finalise(270)] Cannot move
file '/tmp/.org.chromium.Chromium.0RRXgP' to '/tmp/trace.json' :
FILE_ERROR_ACCESS_DENIED

In this case, '/tmp/.org.chromium.Chromium.0RRXgP' has the correct
tracing result inside.

Change-Id: I477be3a6590d61629a510d18ce69e70cf75174bd
Signed-off-by: Lizhi Fan <lizhi.fan@samsung.com>
components/tracing/common/trace.config [new file with mode: 0644]
components/tracing/common/trace_startup_config.h

diff --git a/components/tracing/common/trace.config b/components/tracing/common/trace.config
new file mode 100644 (file)
index 0000000..0143691
--- /dev/null
@@ -0,0 +1,14 @@
+{
+  "startup_duration": 4,
+  "result_file": "/tmp/trace.json",
+  "trace_config": {
+    "included_categories": ["benchmark,blink,toplevel,startup,cc,toplevel.flow,disabled-by-default-memory-infra"],
+    "excluded_categories": ["*"],
+    "memory_dump_config": {
+      "triggers": [
+        { "mode": "light", "periodic_interval_ms": 50 },
+        { "mode": "detailed", "periodic_interval_ms": 1000 }
+      ]
+    }
+  }
+}
index 988c137c1356267c9ef848d2fec5b27c44b00fc7..a033397c6e3cee6bf5c79c153f2f44ee425389a4 100644 (file)
@@ -168,7 +168,11 @@ class TRACING_EXPORT TraceStartupConfig {
   base::FilePath result_file_;
   SessionOwner session_owner_ = SessionOwner::kTracingController;
   bool session_adopted_ = false;
+#if BUILDFLAG(IS_TIZEN_TV)
+  OutputFormat output_format_ = OutputFormat::kLegacyJSON;
+#else
   OutputFormat output_format_ = OutputFormat::kProto;
+#endif
 };
 
 }  // namespace tracing