Giter Site home page Giter Site logo

monitor-for-android's Issues

monitor中帧率统计<dumpsys SurfaceFlinger --latency >数据内容已不匹配

new:
SurfaceFlinger: refactor frame time tracking

This change moves the frame time history tracking code out of Layer and into a
new class called FrameTracker.  It also changes the tracking to use signal
timestamps from fences when available for more accurate results.

old:
The first line currently contains the refresh period in nanosecond.
Each 128 following line contains 3 timestamps, of respectively
the app draw time, the vsync timestamp just prior the call to set and
the timestamp of the call to set.

patch:
+void FrameTracker::dump(String8& result) const {

  • processFences();
  • const size_t o = mOffset;
  • for (size_t i = 1; i < NUM_FRAME_RECORDS; i++) {
  •    const size_t index = (o+i) % NUM_FRAME_RECORDS;
    
  •    result.appendFormat("%lld\t%lld\t%lld\n",
    
  •        mFrameRecords[index].desiredPresentTime,
    
  •        mFrameRecords[index].actualPresentTime,
    
  •        mFrameRecords[index].frameReadyTime);
    
  • }

void Layer::dumpStats(String8& result, char* buffer, size_t SIZE) const
{
LayerBaseClient::dumpStats(result, buffer, SIZE);

  • const size_t o = mFrameLatencyOffset;
    const nsecs_t period =
    mFlinger->getHwComposer().getRefreshPeriod(HWC_DISPLAY_PRIMARY);
    result.appendFormat("%lld\n", period);
  • for (size_t i=0 ; i<128 ; i++) {
  •    const size_t index = (o+i) % 128;
    
  •    const nsecs_t time_app   = mFrameStats[index].timestamp;
    
  •    const nsecs_t time_set   = mFrameStats[index].set;
    
  •    const nsecs_t time_vsync = mFrameStats[index].vsync;
    
  •    result.appendFormat("%lld\t%lld\t%lld\n",
    
  •            time_app,
    
  •            time_vsync,
    
  •            time_set);
    
  • }

启动报错

手机型号 荣耀9
Android 9
EMUI 9.1.0
启动指令 :
sh monitor.sh fps/ "SurfaceView - com.tencent.tmgp.supercell.brawlstars/com.supercell.titan.tencent.GameAppTencent#0"
报错信息:
monitor.sh[334]: [: 1: unexpected operator/operand
monitor.sh[334]: [: 0: unexpected operator/operand

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.