History log of /external/perfetto/src/traced/probes/process_stats_data_source.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2755dd2f221685586f31ee0f289caf952850a874 02-May-2018 Primiano Tucci <primiano@google.com> ps_tree: No scan on startup by default, make thread names optional

There can be over 1500 threads in total and dumping all of them at
startup causes:
1) Too much use of the trace buffer.
2) Because of 1, the buffer is more likely to wrap, and we are more
likely to lose the whole TracePacket with the ps tree. However,
once the initial dump is made, the data source is convinced that
we recorded all those threads and will stop emitting them later
on. As such we get ironically less data compared to the
on-deman only case.

This CL:
- Makes the dump on startup optional.
- Makes dumping thread names optional (they are redundant given that
they show up already in sched_switch events)

This CL diable the scan on startup

Bug: 78106582
Change-Id: I12e9c3e32f4af9e0dd5bb4d67be88706bb47b40e
Merged-In: I12e9c3e32f4af9e0dd5bb4d67be88706bb47b40e
(cherry picked from commit e8d7595f35ff1ad68581164d18d762afb3c03383)
/external/perfetto/src/traced/probes/process_stats_data_source.h
9ce66e8c365b9ed3ddd88a168f9d19f075820788 30-Apr-2018 Primiano Tucci <primiano@google.com> traced_probes: omit empty process_tree packets

Follow-up to I4592c9c0317c6f66b68357684ce9cd0577c9bdb5
which caused empty ProcessTree packets to be emitted in
the trace in corner cases (e.g., if the process has a
short lifetime).

Bug: b/78453224
Bug: b/78106582
Bug: b/77316877
Change-Id: I14831bb38fa8cfe1a81b2870d6d873ac0ea1bc9f
Merged-In: I14831bb38fa8cfe1a81b2870d6d873ac0ea1bc9f
(cherry picked from commit 68574f22cc7145d9dafca9fb9866f9c496269643)
/external/perfetto/src/traced/probes/process_stats_data_source.h
567a5111ff3fad730c1b9c8b1a77a09f187a7385 25-Apr-2018 Primiano Tucci <primiano@google.com> traced_probes: fix tid/pid incremental mapping and reduce overhead

This CL:
1) Fixes an architectural bug related to the way tid/pid mapping is
established. The current proto structure, in fact, is strictly
hierarchical and requires that a process and all its threads are
dumped together. This has two problems: (i) it either requires to
always dump all threads for a process or re-dump the process
record for each thread; (ii) doesn't deal with the fact that new
threads can be spawned after the initial dump.
2) Fixes a performance bug, reducing traced_probes cpu usage by more
than 30% when process metadata collection is enabled.
3) Removes unused/forked code and puts everything into
process_stats_data_source.cc.

In terms of risk this CL should be rather safe. The entire
process_stats_data_source.cc is an optional module and can be
disabled at any point through the TraceConfig.

(cherry picked from commit bd0c02f02090a2b06d0ea93155aa0fcc05ff0cbc)

Bug: b/78453224
Bug: b/78106582
Bug: b/77316877
Change-Id: I4592c9c0317c6f66b68357684ce9cd0577c9bdb5
Merged-In: I4592c9c0317c6f66b68357684ce9cd0577c9bdb5
/external/perfetto/src/traced/probes/process_stats_data_source.h
16848562562f3c3d34edcd859b1f4be250e4e46e 12-Apr-2018 Isabelle Taylor <taylori@google.com> ProcessStatsDataSource test

Tests that ProcessStatsDataSource writes the process data
into the trace writer as requested.
This CL includes a trace writer to be used for testing that allows the test to
read what was written.

Change-Id: Iaf78aac5fef9481594a17f7a667e860fb9297c62
/external/perfetto/src/traced/probes/process_stats_data_source.h
d52e627deeeeae323e65ee266d2bf0dcedee3c98 06-Apr-2018 Primiano Tucci <primiano@google.com> Add Flush support to Producer and expose API to Consumer

Background
----------
Before this CL, when tracing is disabled we might lose the last
trace packets produced near the end of the trace. This happens
because the service sees data in the SMB only when it's notified
by the producer via a CommitData() request. In turn, in the current
implementation, a Producer commits data only when the chunk is full.
Hence the last chunk for each data source will never been seen by
the service when disabling tracing. This causes partial data losses.

Changes
-------
This CL introduces a Flush() signaling mechanism as follows:
3) Introduces a flush request from the service to producers. Producers
are supposed to flush all their trace writers in response to that.
2) Introduces a flush request from the consumer to the service. This allows
the consumer to request all data to be committed at any time (not just
while disabling tracing). The flush request has also a callback
that is invoked by the service only after all producers have acked the
flush (so the consumer is guaranteed that the next ReadBuffers will contain
the result of the flush), or after a given timeout (so that the callback
doesn't hang forever).
3) Causes time-based traces (which are handled by the service) to
automatically flush before disabling tracing.

This CL does NOT fix the underlying problem in the ftrace reader
(see bug 73886018) where, because of the splice, we don't see the
latest trace event even on the producer side. Fixing this problem
requires the Flush() to abort the splice in ftrace's CpuReader and
commit the data (see TODO in SinkDelegate::Flush()).

Change-Id: Ifdec9f241b2ff98a7b4925b02fdd0beb16942e0e
Bug: 77684460
/external/perfetto/src/traced/probes/process_stats_data_source.h
e86dde3eb66aa9e5db49f35e689af214599e2b96 05-Apr-2018 Hector Dearman <hjd@google.com> traced_probes: Write only one process tree per packet

Bug: b/77572477
Change-Id: I5451b8a6f93f379a38c12d7255b7ae41486c2f05
/external/perfetto/src/traced/probes/process_stats_data_source.h
2c31b80789e71f64ee7db80c5a37bb236176bcbe 04-Apr-2018 Isabelle Taylor <taylori@google.com> Disable on demand process stats implementation.

Add implementation so that logging the information about every process can
be turned off through a quirk in the process stats config.

Change-Id: Ia5f97a2e8e5ef5ef930a683504522c2f75e6deb8
/external/perfetto/src/traced/probes/process_stats_data_source.h
3c4e5c27a1ec10cb16fbb75ae4bdd45be2f93505 29-Mar-2018 Hector Dearman <hjd@google.com> traced_probes: Support on demand proccess info

Bug: 73058765
Change-Id: I62801d558363a66c1683b12cb58ae6b36daf8515
/external/perfetto/src/traced/probes/process_stats_data_source.h
ad2c546a266d850dd9c2fa716893d1bb03d7e59c 15-Mar-2018 Hector Dearman <hjd@google.com> traced_probes: Fix gcc build

We were missing an include.

Bug: 69362224
Change-Id: I1bf225d4dc1ac96cd4a2925f4a79078476be341c
/external/perfetto/src/traced/probes/process_stats_data_source.h
0ff07c7f4fdf27a7eacc53353c140e4ca8785f98 15-Mar-2018 Hector Dearman <hjd@google.com> probe_producer: Post metadata to helper sources

ftrace_reader needs a way to signal to the inode/ps metadata sources
with vectors of intresting inodes/pids. It should signal only data
sources which belong to the same tracing session. These sources may not
exist. Rather than keeping many parallel maps up to date and having
lookups in the fast path instead everytime a new datasource is created
we do a pass though all the ftrace datasources and try to set weak
pointers on them leading to the corresponding inode/ps datasources.
Then when we see metadata we post task to relevent datasource via the
weak pointer.

Bug: 73873362
Bug: 73625715
Bug: 73625480
Change-Id: I8371067f0e948733ed8d321479031deaa4ca7db9
/external/perfetto/src/traced/probes/process_stats_data_source.h
ebf07c71c922fdb55535ac29129241f68ac9d947 13-Mar-2018 Hector Dearman <hjd@google.com> traced_probes: Add ProcessStatsDataSource

ProcessStatsDataSource should be able to write metadata for processes
which are created while a trace is running. To do this it needs to live
as long as the trace does so this change creates a
ProcessStatsDataSource to mirror the Sink and InodeFileMapDataSource
that exist for the ftrace and inode datasources.

This also pulls ProcessStatsDataSource and associated logic into its
own class: ProbesProducer is getting too big. Finally it adds the
boilerplate for testing ProcessStatsDataSource - but no actual tests.
There is some additional work required to add tests (e.g. creating a
fake TraceWriter impl) and that shouldn't block progress on
ProcessStatsDataSource.

Bug: 73058765
Change-Id: I2bf68166711289df081edd4ee3375b6fd77f4bb0
/external/perfetto/src/traced/probes/process_stats_data_source.h