summaryrefslogtreecommitdiff
path: root/libs/hwui/FrameInfoVisualizer.cpp
diff options
context:
space:
mode:
author Jing Ji <jji@google.com> 2024-07-12 14:52:13 -0700
committer Jing Ji <jji@google.com> 2024-07-12 16:13:47 -0700
commit70c4592beaf59437023eed243efcfe07d0c54be8 (patch)
treedc153381b3ec4bb8c3c45037a6e84e462d04015e /libs/hwui/FrameInfoVisualizer.cpp
parent6346546884a8b713be1d8a1de7016d55a3fce90b (diff)
Keep reading until end-of-file in reading procfs
As the pread(2) says "it is not an error for a successful call to transfer fewer bytes than requested". The only way to verify we're hitting the end-of-file is to keep reading from the file until it returns 0. Here we're following this rule, in order to make sure we read the whole procfs file to avoid the parser errors. The drawback is that, now for every procfs read, it'll have to hit the pread() at least twice. But if it has reached to the end-of-file, the last read should return within microseconds. Bug: 351917521 Flag: EXEMPT bugfix Test: dumpsys cpuinfo Change-Id: If6a14c4e8f4f1821628f1efb984f8064d4969a8c
Diffstat (limited to 'libs/hwui/FrameInfoVisualizer.cpp')
0 files changed, 0 insertions, 0 deletions