New issue
Advanced search Search tips

Issue 900603 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Dec 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature

Blocking:
issue 839084



Sign in to add a comment

Perfetto: port system tracing agents to the perfetto service

Project Member Reported by eseckler@chromium.org, Oct 31

Issue description

CrOS, Cast, Win (ETW), and CrOS Arc use custom tracing agents. This bug tracks work required to port them to the new perfetto service.

Initially, we will simply wrap their current tracing output (legacy json events for Win and Arc, and ftrace text output for CrOS and Cast) in the perfetto protos.
 
Labels: -Type-Bug Type-Feature
Blocking: 839084
Project Member

Comment 3 by bugdroid1@chromium.org, Nov 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4d2bcd38e11955a28fdb1a17b18dab5e6c43cf27

commit 4d2bcd38e11955a28fdb1a17b18dab5e6c43cf27
Author: Eric Seckler <eseckler@chromium.org>
Date: Thu Nov 01 09:51:09 2018

tracing: Add a system tracing integration test

The new test verifies that system tracing output on CrOS, Cast and Win
actually ends up in a trace - in preparation for porting the respective
tracing agents to the new perfetto service.

Bug:  900603 
Change-Id: I8383a907d2aa843cb2f67f5300e82c7684f116fc
Reviewed-on: https://chromium-review.googlesource.com/c/1309835
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604546}
[modify] https://crrev.com/4d2bcd38e11955a28fdb1a17b18dab5e6c43cf27/chromecast/tracing/BUILD.gn
[modify] https://crrev.com/4d2bcd38e11955a28fdb1a17b18dab5e6c43cf27/chromecast/tracing/system_tracer.cc
[modify] https://crrev.com/4d2bcd38e11955a28fdb1a17b18dab5e6c43cf27/chromecast/tracing/system_tracer.h
[modify] https://crrev.com/4d2bcd38e11955a28fdb1a17b18dab5e6c43cf27/chromeos/dbus/fake_debug_daemon_client.cc
[modify] https://crrev.com/4d2bcd38e11955a28fdb1a17b18dab5e6c43cf27/content/browser/tracing/cast_tracing_agent.cc
[modify] https://crrev.com/4d2bcd38e11955a28fdb1a17b18dab5e6c43cf27/content/browser/tracing/tracing_controller_browsertest.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Nov 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/178e46f542fc17abd0d0c74fcb2a2d274b46a2e1

commit 178e46f542fc17abd0d0c74fcb2a2d274b46a2e1
Author: Eric Seckler <eseckler@chromium.org>
Date: Wed Nov 14 16:09:53 2018

perfetto: Make ProducerClient a singleton

So that we can access the process-wide client from other tracing agents.

Bug:  900603 
Change-Id: Ie157ecc6c5e59e449c8e8182d3a2b31ea8b1bd9e
Reviewed-on: https://chromium-review.googlesource.com/c/1335588
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607995}
[modify] https://crrev.com/178e46f542fc17abd0d0c74fcb2a2d274b46a2e1/services/tracing/public/cpp/perfetto/producer_client.cc
[modify] https://crrev.com/178e46f542fc17abd0d0c74fcb2a2d274b46a2e1/services/tracing/public/cpp/perfetto/producer_client.h
[modify] https://crrev.com/178e46f542fc17abd0d0c74fcb2a2d274b46a2e1/services/tracing/public/cpp/trace_event_agent.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 15

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1f1d363c089ea71191f4b68694edfd7409f1893d

commit 1f1d363c089ea71191f4b68694edfd7409f1893d
Author: Eric Seckler <eseckler@chromium.org>
Date: Thu Nov 15 10:58:51 2018

perfetto: Support legacy system traces in JSON exporter

Adds support for legacy_ftrace_output and legacy_json_trace fields,
which will later be filled by the respective system tracing agents.

Bug:  900603 
Change-Id: I1fd201bf7c1d9110c5f8c1b7df6209948d11787a
Reviewed-on: https://chromium-review.googlesource.com/c/1335603
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608314}
[modify] https://crrev.com/1f1d363c089ea71191f4b68694edfd7409f1893d/services/tracing/perfetto/json_trace_exporter.cc
[modify] https://crrev.com/1f1d363c089ea71191f4b68694edfd7409f1893d/services/tracing/perfetto/json_trace_exporter.h
[modify] https://crrev.com/1f1d363c089ea71191f4b68694edfd7409f1893d/services/tracing/perfetto/json_trace_exporter_unittest.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a626407720f9b9edf2ce9070db7952bedc99ba2f

commit a626407720f9b9edf2ce9070db7952bedc99ba2f
Author: Eric Seckler <eseckler@chromium.org>
Date: Wed Nov 28 11:53:10 2018

perfetto: Port CrOS tracing agent to perfetto

Adds a new DataSource for the CrOS system tracing agent and enables the
corresponding TracingController test on CrOS for perfetto.

TBR=oysteine@google.com

Bug:  900603 
Change-Id: I6652ccedc077f2c036ee5e94b68e725d461e656c
Reviewed-on: https://chromium-review.googlesource.com/c/1341835
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611655}
[modify] https://crrev.com/a626407720f9b9edf2ce9070db7952bedc99ba2f/content/browser/tracing/DEPS
[modify] https://crrev.com/a626407720f9b9edf2ce9070db7952bedc99ba2f/content/browser/tracing/cros_tracing_agent.cc
[modify] https://crrev.com/a626407720f9b9edf2ce9070db7952bedc99ba2f/content/browser/tracing/cros_tracing_agent.h
[modify] https://crrev.com/a626407720f9b9edf2ce9070db7952bedc99ba2f/content/browser/tracing/tracing_controller_browsertest.cc
[modify] https://crrev.com/a626407720f9b9edf2ce9070db7952bedc99ba2f/services/tracing/perfetto/json_trace_exporter.cc
[modify] https://crrev.com/a626407720f9b9edf2ce9070db7952bedc99ba2f/services/tracing/public/cpp/perfetto/producer_client.cc
[modify] https://crrev.com/a626407720f9b9edf2ce9070db7952bedc99ba2f/services/tracing/public/mojom/constants.mojom
[modify] https://crrev.com/a626407720f9b9edf2ce9070db7952bedc99ba2f/services/tracing/public/mojom/perfetto_service.mojom

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 28

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1aacfb2cf92dd63652b504f10cd8bf7d037c4615

commit 1aacfb2cf92dd63652b504f10cd8bf7d037c4615
Author: Eric Seckler <eseckler@chromium.org>
Date: Wed Nov 28 18:42:45 2018

perfetto: Add missing reset of field in CrOS tracing agent

Bug:  900603 
Change-Id: If567eedb4071af1d53072bad81c10731c4515fa0
Reviewed-on: https://chromium-review.googlesource.com/c/1353998
Commit-Queue: oysteine <oysteine@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611794}
[modify] https://crrev.com/1aacfb2cf92dd63652b504f10cd8bf7d037c4615/content/browser/tracing/cros_tracing_agent.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Nov 29

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4b8ad57a1e6cac1ddc0776182afc0d6ee92f437c

commit 4b8ad57a1e6cac1ddc0776182afc0d6ee92f437c
Author: Eric Seckler <eseckler@chromium.org>
Date: Thu Nov 29 11:12:41 2018

tracing: Remove ETW tracing agent

The ETW tracing agent isn't currently used widely. In light of the move
towards perfetto, we've decided to remove it until we can replace it
with a new data source (which would provide more selective information
about the OS's scheduling behavior, e.g. chrome's CPU time slices).

Developers can still export chrome's trace events into ETW for the time
being.

Bug:  900603 
Change-Id: Ie482f4377359f54e166636af65a94dac69767b45
Reviewed-on: https://chromium-review.googlesource.com/c/1341989
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612143}
[modify] https://crrev.com/4b8ad57a1e6cac1ddc0776182afc0d6ee92f437c/content/browser/BUILD.gn
[delete] https://crrev.com/0c155df8027d7f3ed00c8bbcce9b78bf9583d52b/content/browser/tracing/etw_tracing_agent_win.cc
[delete] https://crrev.com/0c155df8027d7f3ed00c8bbcce9b78bf9583d52b/content/browser/tracing/etw_tracing_agent_win.h
[modify] https://crrev.com/4b8ad57a1e6cac1ddc0776182afc0d6ee92f437c/content/browser/tracing/tracing_controller_browsertest.cc
[modify] https://crrev.com/4b8ad57a1e6cac1ddc0776182afc0d6ee92f437c/content/browser/tracing/tracing_controller_impl.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Nov 30

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/466e0fbcd73de3d0186b138d972094cf6cd8404a

commit 466e0fbcd73de3d0186b138d972094cf6cd8404a
Author: Eric Seckler <eseckler@chromium.org>
Date: Fri Nov 30 09:06:49 2018

perfetto: Port Cast tracing agent to perfetto

Adds a new DataSource for the Cast system tracing agent and enables the
corresponding TracingController test on Cast for perfetto.

Bug:  900603 
Change-Id: I249066a57003996bb0c40dcc88bcbe5b23414b8d
Reviewed-on: https://chromium-review.googlesource.com/c/1353892
Reviewed-by: oysteine <oysteine@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612597}
[modify] https://crrev.com/466e0fbcd73de3d0186b138d972094cf6cd8404a/content/browser/tracing/cast_tracing_agent.cc
[modify] https://crrev.com/466e0fbcd73de3d0186b138d972094cf6cd8404a/content/browser/tracing/cast_tracing_agent.h
[modify] https://crrev.com/466e0fbcd73de3d0186b138d972094cf6cd8404a/content/browser/tracing/tracing_controller_browsertest.cc

Labels: Perfetto
Project Member

Comment 11 by bugdroid1@chromium.org, Dec 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/624045587baefaab9fc7a601cacfc8488071381a

commit 624045587baefaab9fc7a601cacfc8488071381a
Author: Eric Seckler <eseckler@chromium.org>
Date: Tue Dec 11 10:42:47 2018

tracing: Port ARC tracing agent to perfetto

Adds a new DataSource for the ARC++ system tracing agent.
Each ArcTracingBridge registers with the data source and keeps track of
its state, so that the data source can coordinate tracing between all
the bridges.

TBR=oysteine@google.com

Test: Manually capture a trace with and without perfetto backend.
Bug:  900603 
Change-Id: Ieb29bcb65de9f4802965a30844e9f76af55db1f3
Reviewed-on: https://chromium-review.googlesource.com/c/1360736
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615483}
[add] https://crrev.com/624045587baefaab9fc7a601cacfc8488071381a/chrome/browser/chromeos/arc/tracing/DEPS
[modify] https://crrev.com/624045587baefaab9fc7a601cacfc8488071381a/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc
[modify] https://crrev.com/624045587baefaab9fc7a601cacfc8488071381a/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.h
[modify] https://crrev.com/624045587baefaab9fc7a601cacfc8488071381a/services/tracing/BUILD.gn
[modify] https://crrev.com/624045587baefaab9fc7a601cacfc8488071381a/services/tracing/perfetto/json_trace_exporter.cc
[modify] https://crrev.com/624045587baefaab9fc7a601cacfc8488071381a/services/tracing/public/mojom/perfetto_service.mojom

Status: Fixed (was: Started)
Arc, Cast, CrOS are all ported. ETW was removed. This should be done.
Project Member

Comment 13 by bugdroid1@chromium.org, Dec 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9f0a1f98a43c311b5901a2df6ff560143fc75a58

commit 9f0a1f98a43c311b5901a2df6ff560143fc75a58
Author: Scott Violet <sky@chromium.org>
Date: Thu Dec 13 01:14:28 2018

Revert "tracing: Port ARC tracing agent to perfetto"

This reverts commit 624045587baefaab9fc7a601cacfc8488071381a.

Reason for revert: This causes crashes when running telemetry on actual chromeos devices. I was specifically running on veyron-minnie. I don't know if this is the problem, but turning on DCHECKs shows this DCHECK hit:

#0 0x0000085def4c base::debug::StackTrace::StackTrace()
#1 0x000008564cc6 logging::LogMessage::~LogMessage()
#2 0x000006cfadce arc::(anonymous namespace)::ArcTracingDataSource::StartTracingOnUI()
#3 0x0000085f85ba base::debug::TaskAnnotator::RunTask()
#4 0x00000856d6ee base::MessageLoopImpl::RunTask()
#5 0x00000856db66 base::MessageLoopImpl::DoWork()
#6 0x0000085f5a34 base::MessagePumpLibevent::Run()
#7 0x00000856d364 base::MessageLoopImpl::Run()
#8 0x00000858aed6 base::RunLoop::Run()
#9 0x0000081eed22 ChromeBrowserMainParts::MainMessageLoopRun()
#10 0x0000062a24a2 content::BrowserMainLoop::RunMainMessageLoopParts()
#11 0x0000062a4234 content::BrowserMainRunnerImpl::Run()
#12 0x00000629ffb0 content::BrowserMain()
#13 0x0000081e4870 content::ContentMainRunnerImpl::RunServiceManager()
#14 0x0000081e45dc content::ContentMainRunnerImpl::Run()
#15 0x0000081e99c4 service_manager::Main()
#16 0x0000081e3352 content::ContentMain()
#17 0x0000056be61c ChromeMain
#18 0x0000ab8ef0a2 __libc_start_main

reverting your patch did in fact make things happy.

Original change's description:
> tracing: Port ARC tracing agent to perfetto
> 
> Adds a new DataSource for the ARC++ system tracing agent.
> Each ArcTracingBridge registers with the data source and keeps track of
> its state, so that the data source can coordinate tracing between all
> the bridges.
> 
> TBR=oysteine@google.com
> 
> Test: Manually capture a trace with and without perfetto backend.
> Bug:  900603 
> Change-Id: Ieb29bcb65de9f4802965a30844e9f76af55db1f3
> Reviewed-on: https://chromium-review.googlesource.com/c/1360736
> Reviewed-by: Eric Seckler <eseckler@chromium.org>
> Reviewed-by: Yusuke Sato <yusukes@chromium.org>
> Reviewed-by: oysteine <oysteine@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Commit-Queue: Eric Seckler <eseckler@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#615483}

TBR=yusukes@chromium.org,hidehiko@chromium.org,oysteine@chromium.org,tsepez@chromium.org,eseckler@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug:  900603 
Change-Id: I723711488acdbe5c59cd6a70f1443c631b77d9b7
Reviewed-on: https://chromium-review.googlesource.com/c/1374796
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616138}
[delete] https://crrev.com/2b9099ad51e550bd105f46d0295ae4418fbaaa42/chrome/browser/chromeos/arc/tracing/DEPS
[modify] https://crrev.com/9f0a1f98a43c311b5901a2df6ff560143fc75a58/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc
[modify] https://crrev.com/9f0a1f98a43c311b5901a2df6ff560143fc75a58/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.h
[modify] https://crrev.com/9f0a1f98a43c311b5901a2df6ff560143fc75a58/services/tracing/BUILD.gn
[modify] https://crrev.com/9f0a1f98a43c311b5901a2df6ff560143fc75a58/services/tracing/perfetto/json_trace_exporter.cc
[modify] https://crrev.com/9f0a1f98a43c311b5901a2df6ff560143fc75a58/services/tracing/public/mojom/perfetto_service.mojom

Project Member

Comment 14 by bugdroid1@chromium.org, Dec 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/29b53ad4641ba0dbbb518c0bd39b38c8cbc3fbc9

commit 29b53ad4641ba0dbbb518c0bd39b38c8cbc3fbc9
Author: Eric Seckler <eseckler@chromium.org>
Date: Fri Dec 14 19:12:02 2018

Reland "tracing: Port ARC tracing agent to perfetto"

This is a reland of 624045587baefaab9fc7a601cacfc8488071381a with fixes
to the state reset logic in ArcTracingBridge and ArcTracingDataSource.

Original change's description:
> tracing: Port ARC tracing agent to perfetto
>
> Adds a new DataSource for the ARC++ system tracing agent.
> Each ArcTracingBridge registers with the data source and keeps track of
> its state, so that the data source can coordinate tracing between all
> the bridges.
>
> TBR=oysteine@google.com
>
> Test: Manually capture a trace with and without perfetto backend.
> Bug:  900603 
> Change-Id: Ieb29bcb65de9f4802965a30844e9f76af55db1f3
> Reviewed-on: https://chromium-review.googlesource.com/c/1360736
> Reviewed-by: Eric Seckler <eseckler@chromium.org>
> Reviewed-by: Yusuke Sato <yusukes@chromium.org>
> Reviewed-by: oysteine <oysteine@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
> Commit-Queue: Eric Seckler <eseckler@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#615483}

TBR=oysteine@google.com

Bug:  900603 
Change-Id: I018a9493e660fa9654ad31da734866b3835786a0
Reviewed-on: https://chromium-review.googlesource.com/c/1374982
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: oysteine <oysteine@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Yusuke Sato <yusukes@chromium.org>
Commit-Queue: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#616778}
[add] https://crrev.com/29b53ad4641ba0dbbb518c0bd39b38c8cbc3fbc9/chrome/browser/chromeos/arc/tracing/DEPS
[modify] https://crrev.com/29b53ad4641ba0dbbb518c0bd39b38c8cbc3fbc9/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.cc
[modify] https://crrev.com/29b53ad4641ba0dbbb518c0bd39b38c8cbc3fbc9/chrome/browser/chromeos/arc/tracing/arc_tracing_bridge.h
[modify] https://crrev.com/29b53ad4641ba0dbbb518c0bd39b38c8cbc3fbc9/services/tracing/BUILD.gn
[modify] https://crrev.com/29b53ad4641ba0dbbb518c0bd39b38c8cbc3fbc9/services/tracing/perfetto/json_trace_exporter.cc
[modify] https://crrev.com/29b53ad4641ba0dbbb518c0bd39b38c8cbc3fbc9/services/tracing/public/mojom/perfetto_service.mojom

Sign in to add a comment