<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>163407</bug_id>
          
          <creation_ts>2016-10-13 15:16:53 -0700</creation_ts>
          <short_desc>Web Inspector: Call RuntimeAgent.disableControlFlowProfiler when Code Coverage Profiler is turned off</short_desc>
          <delta_ts>2016-11-10 13:55:35 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=163408</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikita Vasilyev">nvasilyev</reporter>
          <assigned_to name="Nikita Vasilyev">nvasilyev</assigned_to>
          <cc>bburg</cc>
    
    <cc>commit-queue</cc>
    
    <cc>joepeck</cc>
    
    <cc>mattbaker</cc>
    
    <cc>nvasilyev</cc>
    
    <cc>saam</cc>
    
    <cc>timothy</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1239974</commentid>
    <comment_count>0</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2016-10-13 15:16:53 -0700</bug_when>
    <thetext>Disabling Code Coverage profiler by clicking [C] button should signal the backend to stop collecting the data by calling RuntimeAgent.disableControlFlowProfiler method.

RuntimeAgent.disableControlFlowProfiler is currently unused.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1239975</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-10-13 15:17:09 -0700</bug_when>
    <thetext>&lt;rdar://problem/28764230&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249875</commentid>
    <comment_count>2</comment_count>
      <attachid>294390</attachid>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2016-11-10 11:28:02 -0800</bug_when>
    <thetext>Created attachment 294390
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249877</commentid>
    <comment_count>3</comment_count>
      <attachid>294390</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-11-10 11:30:56 -0800</bug_when>
    <thetext>Comment on attachment 294390
Patch

It is unfortunate that we don&apos;t have any tests for these methods.

Given the Type Profiler chance is probably going to be identical, is there any reason this is split into two bugs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249883</commentid>
    <comment_count>4</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2016-11-10 11:39:55 -0800</bug_when>
    <thetext>&gt; Given the Type Profiler chance is probably going to be identical, is there
&gt; any reason this is split into two bugs?

Yes, I have concerns about Type Profiler https://bugs.webkit.org/show_bug.cgi?id=163408#c2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249895</commentid>
    <comment_count>5</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2016-11-10 11:53:54 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; Comment on attachment 294390 [details]
&gt; Patch
&gt; 
&gt; It is unfortunate that we don&apos;t have any tests for these methods.

Should we test if RuntimeAgent.enableControlFlowProfiler() and RuntimeAgent.disableControlFlowProfiler() gets called on clicking the [C] icon?

I haven&apos;t written any UI tests that use view wrappers, but I expect it to be feasible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249896</commentid>
    <comment_count>6</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-11-10 11:56:24 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #3)
&gt; &gt; Comment on attachment 294390 [details]
&gt; &gt; Patch
&gt; &gt; 
&gt; &gt; It is unfortunate that we don&apos;t have any tests for these methods.
&gt; 
&gt; Should we test if RuntimeAgent.enableControlFlowProfiler() and
&gt; RuntimeAgent.disableControlFlowProfiler() gets called on clicking the [C]
&gt; icon?

We have no UI tests right now.

I mean we don&apos;t even have tests for these protocol methods to ensure the backend does what we expect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249952</commentid>
    <comment_count>7</comment_count>
      <attachid>294390</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-11-10 13:34:06 -0800</bug_when>
    <thetext>Comment on attachment 294390
Patch

Clearing flags on attachment: 294390

Committed r208561: &lt;http://trac.webkit.org/changeset/208561&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249953</commentid>
    <comment_count>8</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2016-11-10 13:34:10 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249962</commentid>
    <comment_count>9</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2016-11-10 13:48:16 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; Disabling Code Coverage profiler by clicking [C] button should signal the
&gt; backend to stop collecting the data by calling
&gt; RuntimeAgent.disableControlFlowProfiler method.
&gt; 
&gt; RuntimeAgent.disableControlFlowProfiler is currently unused.

The downside of doing this is that if you ever want to toggle the button, you will loose information. What I did with the type profiler is ensure that the button was just a local toggle for the UI, not the actual JSC type profiler. That way, if a user wants to show and then hide and then show the UI, the user wouldn&apos;t loose type information.

What&apos;s the motivation for not following this design here?

(Note that I still think we should turn the profilers off when recording a timeline)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1249964</commentid>
    <comment_count>10</comment_count>
    <who name="Nikita Vasilyev">nvasilyev</who>
    <bug_when>2016-11-10 13:55:35 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #0)
&gt; &gt; Disabling Code Coverage profiler by clicking [C] button should signal the
&gt; &gt; backend to stop collecting the data by calling
&gt; &gt; RuntimeAgent.disableControlFlowProfiler method.
&gt; &gt; 
&gt; &gt; RuntimeAgent.disableControlFlowProfiler is currently unused.
&gt; 
&gt; The downside of doing this is that if you ever want to toggle the button,
&gt; you will loose information. What I did with the type profiler is ensure that
&gt; the button was just a local toggle for the UI, not the actual JSC type
&gt; profiler. That way, if a user wants to show and then hide and then show the
&gt; UI, the user wouldn&apos;t loose type information.
&gt; 
&gt; What&apos;s the motivation for not following this design here?
&gt; 
&gt; (Note that I still think we should turn the profilers off when recording a
&gt; timeline)

Here&apos;s a use case:

1. Turn Code Coverage off and on.
2. Perform some action on a web page.
3. See what got executed.

Previously, we wouldn&apos;t be able to tell if the code was executed before performing that action or not. Now, turning off and on allows us to start with a clean slate.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>294390</attachid>
            <date>2016-11-10 11:28:02 -0800</date>
            <delta_ts>2016-11-10 13:34:06 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1625</size>
            <attacher name="Nikita Vasilyev">nvasilyev</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2VMb2cgYi9Tb3VyY2UvV2Vi
SW5zcGVjdG9yVUkvQ2hhbmdlTG9nCmluZGV4IDYwODM4ZTAuLmFmOTQwMjIgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9XZWJJbnNwZWN0b3JVSS9DaGFuZ2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