Android code debugging tool traceview

Source: Internet
Author: User

Highlights of the Code debugging tools Google provides for us: traceview and dmtracedump. With these two tools, we can easily Debug programs to analyze bugs. Traceview helps us analyze program performance. dmtracedump generates a function call diagram. Unfortunately, the dmtracedump provided by google is a failed tool and cannot be drawn. This article will introduce the solution in detail to implement plotting. Generate the. trace file android. OS. Debug class. Two important methods are Debug. startMethodTracing () and Debug. stopMethodTracing (). These two methods are used to create. trace file, which will be from Debug. startMethodTracing (), to Debug. stopMethodTracing () ends, during which all calling processes are stored in. the trace file contains the called function name and execution time. Add the following code to the start and end positions of the debugging code respectively. [Java] Debug. startMethodTracing ("test"); Debug. stopMethodTracing (); where the parameter test is the name of the trace file to be created, test. trace. The default path is/sdcard/test. trace. You can also Customize/data/log/test to indicate that the file is in/data/log/test. trace. Traceview is executed in the SDK:./traceview test. trace. We can get 1. Start and Stop times of each thread calling method in the Program 2. Function execution information and Efficiency Analysis

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.