Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55c4816f authored by Jeff Hao's avatar Jeff Hao Committed by Android Git Automerger
Browse files

am cf6a3b91: Update ddms and profiling docs to include sample profiling.

* commit 'cf6a3b91':
  Update ddms and profiling docs to include sample profiling.
parents a7577843 cf6a3b91
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -204,6 +204,10 @@ parent.link=index.html


    <li>Click the <strong>Start Method Profiling</strong> button.</li>
    <li>Click the <strong>Start Method Profiling</strong> button.</li>


    <li>In Android 4.4 and later, choose either trace-based profiling or sample-based profiling
    with a specified sampling interval. For earlier versions of Android, only trace-based profiling
    is available.</li>

    <li>Interact with your application to start the methods that you want to profile.</li>
    <li>Interact with your application to start the methods that you want to profile.</li>


    <li>Click the <strong>Stop Method Profiling</strong> button. DDMS stops profiling your
    <li>Click the <strong>Stop Method Profiling</strong> button. DDMS stops profiling your
+9 −2
Original line number Original line Diff line number Diff line
@@ -157,6 +157,12 @@ parent.link=index.html
  times are only useful in relation to other profile output, so you can see if changes have made
  times are only useful in relation to other profile output, so you can see if changes have made
  the code faster or slower relative to a previous profiling run.</p>
  the code faster or slower relative to a previous profiling run.</p>


  <p>In Android 4.4 and later, you can use sample-based profiling to profile with less runtime
  performance impact. To enable sample profiling, call {@link
  android.os.Debug#startMethodTracingSampling() startMethodTracingSampling()} with a specified
  sampling interval. The system will then gather samples periodically until tracing is stopped
  via {@link android.os.Debug#stopMethodTracing() stopMethodTracing()}.</p>

  <h2 id="copyingfiles">Copying Trace Files to a Host Machine</h2>
  <h2 id="copyingfiles">Copying Trace Files to a Host Machine</h2>


  <p>After your application has run and the system has created your trace files
  <p>After your application has run and the system has created your trace files
@@ -277,7 +283,8 @@ dmtracedump [-ho] [-s sortable] [-d trace-base-name] [-g outfile] &lt;trace-base
      Traceview logging does not handle threads well, resulting in these two problems:
      Traceview logging does not handle threads well, resulting in these two problems:


      <ol>
      <ol>
        <li>If a thread exits during profiling, the thread name is not emitted;</li>
        <li>If a thread exits during profiling, the thread name is not emitted (fixed in Android 5.1
	and later);</li>


        <li>The VM reuses thread IDs. If a thread stops and another starts, they may get the same
        <li>The VM reuses thread IDs. If a thread stops and another starts, they may get the same
        ID.</li>
        ID.</li>