当前位置: 首页 > news >正文

网站空间的存放种类网站建设与管理收获

网站空间的存放种类,网站建设与管理收获,家教网站如何建设,python开发做网站Android 9上有了binder_calls_stats服务#xff0c;提供了java层的binder统计#xff0c; Android中的Binder Call Stats#xff08;Binder调用统计#xff09;是一项用于监控和记录Android系统中Binder通信的统计信息的功能。Binder是Android中的一种进程间通信#xff…Android 9上有了binder_calls_stats服务提供了java层的binder统计 Android中的Binder Call StatsBinder调用统计是一项用于监控和记录Android系统中Binder通信的统计信息的功能。Binder是Android中的一种进程间通信IPC机制用于在不同的进程之间传递数据和调用方法。 Binder Call Stats提供了有关Binder调用的性能和统计数据帮助开发人员分析和优化系统的性能。它可以提供以下信息 Binder调用次数统计Binder方法被调用的次数包括进程间的远程调用和本地调用。 Binder调用耗时记录Binder方法的执行时间包括调用传输数据的时间和远程进程执行方法的时间。 Binder调用堆栈跟踪跟踪Binder调用的堆栈信息可以帮助开发人员确定调用路径和定位性能瓶颈。 Binder调用的进程和线程信息记录Binder调用发生的进程和线程信息有助于分析系统中不同组件之间的通信情况。 通过分析Binder Call Stats开发人员可以识别性能瓶颈、优化IPC通信改进应用程序的响应性能和资源利用率。 要收集Binder Call Stats开发人员可以使用Android系统提供的工具和API例如使用adb shell命令进行监测或者使用Trace类和Debug类提供的方法进行手动埋点和记录统计数据。 需要注意的是Binder Call Stats对于普通应用程序开发人员来说可能并不常用主要用于系统级开发和性能调优。 public class BinderCallsStatsService extends Binder { 30 31 private static final String TAG BinderCallsStatsService; 32 33 private static final String PERSIST_SYS_BINDER_CALLS_DETAILED_TRACKING 34 persist.sys.binder_calls_detailed_tracking; 35 36 public static void start() { 37 BinderCallsStatsService service new BinderCallsStatsService(); 38 ServiceManager.addService(binder_calls_stats, service); 39 boolean detailedTrackingEnabled SystemProperties.getBoolean( 40 PERSIST_SYS_BINDER_CALLS_DETAILED_TRACKING, false); 41 42 if (detailedTrackingEnabled) { 43 Slog.i(TAG, Enabled CPU usage tracking for binder calls. Controlled by 44 PERSIST_SYS_BINDER_CALLS_DETAILED_TRACKING 45 or via dumpsys binder_calls_stats --enable-detailed-tracking); 46 BinderCallsStats.getInstance().setDetailedTracking(true); 47 } 48 } 49 50 public static void reset() { 51 Slog.i(TAG, Resetting stats); 52 BinderCallsStats.getInstance().reset(); 53 } 54 55 Override 56 protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { 57 if (args ! null) { 58 for (final String arg : args) { 59 if (-a.equals(arg)) { 60 // We currently dump all information by default 61 continue; 62 } else if (--reset.equals(arg)) { 63 reset(); 64 pw.println(binder_calls_stats reset.); 65 return; 66 } else if (--enable-detailed-tracking.equals(arg)) { 67 SystemProperties.set(PERSIST_SYS_BINDER_CALLS_DETAILED_TRACKING, 1); 68 BinderCallsStats.getInstance().setDetailedTracking(true); 69 pw.println(Detailed tracking enabled); 70 return; 71 } else if (--disable-detailed-tracking.equals(arg)) { 72 SystemProperties.set(PERSIST_SYS_BINDER_CALLS_DETAILED_TRACKING, ); 73 BinderCallsStats.getInstance().setDetailedTracking(false); 74 pw.println(Detailed tracking disabled); 75 return; 76 } else if (-h.equals(arg)) { 77 pw.println(binder_calls_stats commands:); 78 pw.println( --reset: Reset stats); 79 pw.println( --enable-detailed-tracking: Enables detailed tracking); 80 pw.println( --disable-detailed-tracking: Disables detailed tracking); 81 return; 82 } else { 83 pw.println(Unknown option: arg); 84 } 85 } 86 } 87 BinderCallsStats.getInstance().dump(pw); 88 } 89} 90 可以看到是通过BinderCallsStats来进行统计的而BinderCallsStats通过在Java层Binder对象中的使用来进行记录 frameworks/base/core/java/android/os/Binder.java // Entry point from android_util_Binder.cpps onTransact 714 private boolean execTransact(int code, long dataObj, long replyObj, 715 int flags) { 716 BinderCallsStats binderCallsStats BinderCallsStats.getInstance(); 717 BinderCallsStats.CallSession callSession binderCallsStats.callStarted(this, code); 718 Parcel data Parcel.obtain(dataObj); 719 Parcel reply Parcel.obtain(replyObj); 720 // theoretically, we should call transact, which will call onTransact, 721 // but all that does is rewind it, and we just got these from an IPC, 722 // so well just call it directly. 723 boolean res; 724 // Log any exceptions as warnings, dont silently suppress them. 725 // If the call was FLAG_ONEWAY then these exceptions disappear into the ether. 726 final boolean tracingEnabled Binder.isTracingEnabled(); 727 try { 728 if (tracingEnabled) { 729 Trace.traceBegin(Trace.TRACE_TAG_ALWAYS, getClass().getName() : code); 730 } 731 res onTransact(code, data, reply, flags); 732 } catch (RemoteException|RuntimeException e) { 733 if (LOG_RUNTIME_EXCEPTION) { 734 Log.w(TAG, Caught a RuntimeException from the binder stub implementation., e); 735 } 736 if ((flags FLAG_ONEWAY) ! 0) { 737 if (e instanceof RemoteException) { 738 Log.w(TAG, Binder call failed., e); 739 } else { 740 Log.w(TAG, Caught a RuntimeException from the binder stub implementation., e); 741 } 742 } else { 743 reply.setDataPosition(0); 744 reply.writeException(e); 745 } 746 res true; 747 } finally { 748 if (tracingEnabled) { 749 Trace.traceEnd(Trace.TRACE_TAG_ALWAYS); 750 } 751 } 752 checkParcel(this, code, reply, Unreasonably large binder reply buffer); 753 reply.recycle(); 754 data.recycle(); 755 756 // Just in case -- we are done with the IPC, so there should be no more strict 757 // mode violations that have gathered for this thread. Either they have been 758 // parceled and are now in transport off to the caller, or we are returning back 759 // to the main transaction loop to wait for another incoming transaction. Either 760 // way, strict mode begone! 761 StrictMode.clearGatheredViolations(); 762 binderCallsStats.callEnded(callSession); 763 764 return res; 765 } 而更加底层的统计可以查看/dev/binder 里面的binder_status binder_status是Android系统中的一个特殊文件用于提供有关Binder驱动程序状态的信息。该文件位于/proc/binder/status路径下只有在具有root权限或系统签名的设备上才能访问。 binder_status文件提供了有关Binder驱动程序的各种统计和状态信息包括 总体信息包括Binder线程池的大小、当前正在等待的线程数等。 事务计数显示有关Binder事务包括进程间通信和本地调用的计数信息例如总事务数、活动事务数、等待事务数等。 线程信息列出了所有活动的Binder线程的详细信息包括线程ID、所属进程、线程状态等。 回收信息显示已回收的Binder对象和节点的数量。 通过读取binder_status文件您可以获取有关Binder驱动程序的运行状况和性能指标的信息这对于调试和分析Binder相关问题非常有用。然而由于它提供的信息非常底层和详细需要一定的理解和背景知识才能正确解读和使用这些数据。 请注意访问binder_status文件需要root权限或系统签名并且在正常情况下一般用户不需要直接访问或操作该文件。
http://www.dnsts.com.cn/news/198109.html

相关文章:

  • 自己做淘宝客登录网站免费咨询义诊
  • 电子商务网站建设合同签订做淘宝要网站?
  • 广州专业制作网站怎样做网络营销
  • 那些提卡网站是怎么做的福州做网站销售公司
  • 怎么建商城网站吗网页设计实验报告3000
  • 上海公司网站建设pageadmin是免费的吗
  • 网站绩效营销北京网站建设net2006
  • php网站开发基础教程做标书有什么好的网站吗
  • 谈谈设计和建设网站体会只想怎样建设自己的销售网站
  • 长沙百度网站推广公司优化网站公司价格是多少钱
  • 做网站销售提成怎么算wordpress实现微信登录
  • 比较好的ui设计网站seo网站编辑
  • 中国建设教育协会是什么网站wordpress个性标签
  • 做公司网站阿里在线制作公司网站
  • 网页网站建设的ppt在线做网站图标
  • 化妆品网站程序网网站制作开发
  • 用wordpress开发网站淘宝客做网站还是做app
  • 做微网站哪家好校园网站建设结论
  • wordpress 开发插件搜索引擎优化简称
  • 专门设计的网站找人做微信网站
  • 门户网站的传播特点企业网络营销活动
  • 网站建设的基本知识kingcms 暂未创建网站首页
  • 网站建设太仓上海企业扶持政策
  • 30岁转行做网站设计深圳电器公司怎么样
  • 手机端快速建站工具计算机软件培训机构课程
  • 网站低保图用什么做南昌建设医院网站
  • 网站的动态图怎么做的国家建设标准发布网站在哪里
  • 上海做网站的公司网站美工设计收费
  • 海南网站开发网站的作用有哪些
  • wordpress网站怎么进去济南建设集团网站