Commit 232f5c7e authored by Darshan Sen's avatar Darshan Sen Committed by V8 LUCI CQ

[diagnostics] Guard GetCategoryGroupName behind V8_USE_PERFETTO ifdef

I was trying to build chromium with Perfetto enabled and I ran into this
compilation error:
```
../../v8/src/libplatform/tracing/recorder-win.cc(48,42): error: no member named 'GetCategoryGroupName' in 'v8::platform::tracing::TracingController'
                      TracingController::GetCategoryGroupName(
                      ~~~~~~~~~~~~~~~~~~~^
1 error generated.
```
This happens because the GetCategoryGroupName() function is added to
the TracingController class only if Perfetto is disabled.
Signed-off-by: 's avatarDarshan Sen <raisinten@gmail.com>
Change-Id: If53dab5ea9b8c3e2f69e8e84c8d6ba06ee3c496e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3616427Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80310}
parent ee247818
......@@ -43,11 +43,15 @@ void Recorder::AddEvent(TraceObject* trace_event) {
wchar_t* wName = new wchar_t[4096];
MultiByteToWideChar(CP_ACP, 0, trace_event->name(), -1, wName, 4096);
#if defined(V8_USE_PERFETTO)
const wchar_t* wCategoryGroupName = L"";
#else // defined(V8_USE_PERFETTO)
wchar_t* wCategoryGroupName = new wchar_t[4096];
MultiByteToWideChar(CP_ACP, 0,
TracingController::GetCategoryGroupName(
trace_event->category_enabled_flag()),
-1, wCategoryGroupName, 4096);
#endif // !defined(V8_USE_PERFETTO)
TraceLoggingWrite(g_v8LibProvider, "", TraceLoggingValue(wName, "Event Name"),
TraceLoggingValue(trace_event->pid(), "pid"),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment