23 Commits

Author SHA1 Message Date
Stan Iliev
c90438175f Refactor GraphicsStatsService for updateability
Move GraphicsStatsService to android.graphics package.
Move GraphicsStatsService JNI from libservices.core to
libandroid_runtime.
Declare GraphicsStatsService ctor as the only @SystemApi.
Remove MemoryFile usage from GraphicsStatsService, but use
SharedMemory and other SDK APIs instead. This is done to
avoid using unstable API MemoryFile.getFileDescriptor.
Propose new SharedMemory.getFdDup API for next release, which
is hidden for now.
Refactor statsd puller to avoid proto serialization by moving
data directly into AStatsEventList.
"libprotoutil" is added as a static dependancy to libhwui, which
should be fine because its implementation does not link anything.

Bug: 146353313
Test: Ran "adb shell cmd stats pull-source 10068"
Test: Passed unit tests and GraphicsStatsValidationTest CTS
Change-Id: If16c5addbd519cba33e03bd84ac312595032e0e1
2020-02-07 12:27:07 -05:00
Stan Iliev
637ba5e8da Expose HWUI metrics via statsd
Add atom definition for HWUI stats. Implement a C++
statsd puller inside GraphicsStatsService service.
GraphicsStatsService has new private API, which
returns a serialized proto with HWUI stats grouped
by application package and version.

Test: Ran "adb shell cmd stats pull-source 10068"
Test: Ran "statsd_testdrive 10068" and it looks OK
Bug: 142665516
Change-Id: I400c0dbf9e25181d36f9018688b03d86839ac3de
2020-01-10 10:50:25 -05:00
Colin Cross
d013a88277 Adapt to google::protobuf::uint64 type change
Protobuf 3.9.1 redefines google::protobuf::uint64 from unsigned long
long to uint64_t, which is sometimes unsigned long and sometimes
unsigned long long.  Use PRIu64 to print it, and add an implementation
of ProtoOutputStream::write for long.

Bug: 117607748
Test: m checkbuild
Exempt-From-Owner-Approval: approved at https://android-review.googlesource.com/q/Ib2d3f4e17857f8ccbbe342ce6678e76b591df510
Change-Id: Ib2d3f4e17857f8ccbbe342ce6678e76b591df510
2019-09-04 12:48:36 -07:00
Stan Iliev
7203e1f55a Add GPU draw stats to gfxinfo and GraphicsStatsService
Test: ran dumpsys with gfxinfo and graphicsstats
Change-Id: Id9950de87dc4343c6878baa6a6dd42fbc8aeddef
2019-08-01 18:53:21 +00:00
Chih-Hung Hsieh
f21b0b6d36 Fix/suppress hwui google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
* Use NOLINT or NOLINTNEXTLINE to suppress warnings on intended converters

Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: I8c6ebb99679b0a71251024d70a13f8164e67db5e
2019-01-09 19:50:30 +00:00
liulvping
4832438c3a fix mmap leak of graphicsstats service
Test: repeat dumpsys graphicsstats and check process maps

Change-Id: Iae2baa7eb7761aefb867644edfaaf8dbe2132c7b
Signed-off-by: liulvping <liulvping@xiaomi.com>
2019-01-02 10:54:57 +00:00
Colin Cross
054b0c0e06 Revert "Adapt to google::protobuf::uint64 type change"
This reverts commit fa6bc27df0820a362e0ceae7f9ea73e8a058fe47.

Change-Id: I9f778e6daa9ae0c6080016ab0bd1e6e414ae6061
2018-11-04 17:24:27 -08:00
Colin Cross
fa6bc27df0 Adapt to google::protobuf::uint64 type change
Protobuf 3.5.2 redefines google::protobuf::uint64 from unsigned long
long to uint64_t, which is sometimes unsigned long and sometimes
unsigned long long.  Use PRIu64 to print it, and add an implementation
of ProtoOutputStream::write for long.

Bug: 117607748
Test: m checkbuild
Change-Id: I48912f58e2f63f4a98c3aefaa4f78cc2c719bb68
2018-11-02 11:35:48 -07:00
zhangkuili
399ac24bdf Merge "[Stability][hwui] check mmap return value"
am: b352dcd153

Change-Id: I8d04c5433ca881e62a23e0aa13e022cdf8d16d9a
2018-06-21 14:53:15 -07:00
zhangkuili
24a1bc39bb [Stability][hwui] check mmap return value
If mmap failed, it return -1 (MAP_FAILED)

Bug:110507462
Test: manual

Change-Id: I3d0bac2e7c8b0bdc9cfb4ebb7b766d858876679d
Signed-off-by: zhangkuili <zhangkuili@xiaomi.com>
2018-06-21 17:43:10 +08:00
Kweku Adams
1856a4cfcc Adding privacy tags to graphicsstats proto.
Creating a copy of the graphicsstats proto so that one can be tagged
with privacy annotations and the other can be used internally while
still using the protobuf-cpp-lite library.

Bug: 72570104
Test: flash device and check incident output
Merged-In: I2d72e7bd17689c1401a16d5a13956e6528ddb525
Change-Id: I0a46ee6cc463b133925be1cf8dee8cf3d107930c
2018-04-12 14:23:15 -07:00
John Reck
0e4864725a Revert "Revert "Break down jank between frame drops vs. triple buffered""
This reverts commit a6d8fbf4ea634f5f605b2b7db3ca98975f8625b5.

Fixes an out-of-bounds read in COMPARISONS by switching up
how comparisons works. Instead of requiring all jank types
to have an associated COMPARISON's entry, which kHighInputLatency
and kMissedDeadline don't, instead have each
COMPARISON indicate which JankType it applies to so it can
be independently sized from JankTypes.

Bug: 70220906
Bug: 75566601
Test: launching & using maps works
Change-Id: I7fd90daeb320b4627e42c3418c89726d860998c1
2018-03-19 16:36:32 -07:00
Aaron Whyte
a6d8fbf4ea Revert "Break down jank between frame drops vs. triple buffered"
This reverts commit 09979fbee7201b46158c2c033194529e4284ea13.

Reason for revert: Based on stacktraces and change history, I think this is causing a cluster of P crashes.
https://b.corp.google.com/issues?q=(%22android%22%20%22:uirenderer::JankTracker::finishFrame%22)
Bug: 75566601
Bug: 75811585
Bug: 75407175
Bug: 75736222
Bug: 75391447
Bug: 75659839

Change-Id: I59a8c2d8906d347210c77fb3628f5801bc299bfb
2018-03-19 17:53:48 +00:00
John Reck
09979fbee7 Break down jank between frame drops vs. triple buffered
Bug: 70220906
Test: JankyScene vs. systrace vs. jankstats
Change-Id: Ia012685020cc5bcabbd3f92f0bdeb84eaf50733d
2018-03-14 15:00:05 -07:00
Dianne Hackborn
73453e49d5 Update graphics stats to use long version codes.
Bug: 64459786
Test: manual
Change-Id: Iab84727e0ac486f505c10aacdb5ec8871aaf121e
2017-12-11 16:30:36 -08:00
John Reck
1bcacfdcab Format the world (or just HWUI)
Test: No code changes, just ran through clang-format
Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
2017-11-03 10:57:44 -07:00
Dan Albert
caebafaf94 Merge "Add missing includes." am: 4be4bb3db7 am: 41c08f49b4
am: e9aaf3c546

Change-Id: I41e4375d053ad5aa64bd4ca3a78b23644b2c725b
2017-10-11 22:22:04 +00:00
Dan Albert
41c08f49b4 Merge "Add missing includes."
am: 4be4bb3db7

Change-Id: Icdae2b63df8e5d61e6acabb6fb85efa28026d535
2017-10-11 21:52:41 +00:00
Dan Albert
110e007fb8 Add missing includes.
Test: mma
Bug: None
Change-Id: Iec8b0a7854091946a4bb6e804c5f4cce39a52b47
2017-10-11 12:41:33 -07:00
John Reck
5206a871dc Remove all FATAL_IFs from graphicsstats service
As graphicsstats can be subjected to data coming
from the disk and is in system_server we want
to bias towards best-effort instead of strict
no-errors that the rest of HWUI typically uses.

So treat any dump/merge of graphics stats as
best effort, ignoring any errors that occur.

Bug: 65652900
Test: verified 'dumpsys graphicsstats' still works

Change-Id: Ia9b91b745c2a9aedad2f22e3087e1d4bf37a1135
2017-09-18 12:55:17 -07:00
John Reck
7075c79209 Split out jank data from policy
Move ProfileData out to its own file with helper
accessors. This keeps policy (what is/isn't jank)
outside of the data storage.

Also use lambdas to iterate over the histogram
to make it nicer for dumping & proto-ifying.

Test: hwui_unit_tests pass & jank data still dumps

Change-Id: I88488369ec77590a2867f51128e65bb786aa34e6
2017-07-05 14:04:51 -07:00
John Reck
915883b9f0 Switch to protobuf lite
Fixes: 36272398

Protobuf lite isn't just smaller, it also doesn't
have the problematic DescriptorPool at all. So no
need to switch this to a shared library.

Test: hwui_unit_test passes and doesn't crash. CTS incident tests pass
as well

Change-Id: I2693ba2c47af89a5c561c4f63cc7e1f509ebbbec
2017-05-12 10:44:46 -07:00
John Reck
df1742ed47 Overhaul GraphicsStatsService
* LRU cache of recently-used is dead, replaced
  disk storage
* ASHMEM size is read from native by the system service,
  no longer requires keeping a sizeof() in sync with a
  constant in Java
* Supports dumping in proto format by passing --proto
* Rotates logs on a daily basis
* Keeps a history of the most recent 3 days

Bug: 33705836
Test: Manual. Verified log rotating works by setting it up to
rotate every minute instead of day. Confirmed /data/system/graphicsstats
only has the most recent 3 entries after several minutes

Change-Id: Ib84bafb26c58701cc86f123236de4fff01aaa4aa
2017-02-21 09:49:10 -08:00