[patch][commit] sid/bsp Support and Documentation of new sw-profile-gprof Interface

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[patch][commit] sid/bsp Support and Documentation of new sw-profile-gprof Interface

Dave Brolley-2
Hi,

I've committed the attached patch which documents the new
sw-profile-gprof interface.

ALso, I don't know it it's supported anymore, but I also updated
sid/bsp/configrun-sid.in to generate the correct configuration for the
new interface.

Dave

2006-06-26  Dave Brolley  <[hidden email]>

        * sw-profile-gprof.xml: Document new sampling interface.
        * sw-profile-gprof.txt: Regenerated.

2006-06-26  Dave Brolley  <[hidden email]>

        * configrun-sid.in (opt_gprof): Do not
        "connect-pin target-sched 0-event -> gprof sample".
        Do not "set gprof value-attribute pc".
        connect-pin cpu sample-gprof -> gprof sample.
        connect-pin cpu gprof-pc -> gprof pc.
        connect-pin cpu gprof-pc-hi -> gprof pc-hi.


Index: sid/bsp/configrun-sid.in
===================================================================
RCS file: /cvs/src/src/sid/bsp/configrun-sid.in,v
retrieving revision 1.37
diff -c -p -r1.37 configrun-sid.in
*** sid/bsp/configrun-sid.in 16 Dec 2005 10:23:12 -0000 1.37
--- sid/bsp/configrun-sid.in 26 Jun 2006 21:57:15 -0000
*************** if ($opt_cpu eq "mt")
*** 499,510 ****
  if ($opt_gprof)
    {
      $second_section .= "# gprof connections
- connect-pin target-sched 0-event -> gprof sample
  connect-pin deinit-sequence output-7 -> gprof store
! relate gprof target-component cpu
  connect-pin cpu cg-caller -> gprof cg-caller
  connect-pin cpu cg-callee -> gprof cg-callee
! set gprof value-attribute pc
  set gprof bucket-size 4 # bytes per bucket
  ";
    }
--- 499,511 ----
  if ($opt_gprof)
    {
      $second_section .= "# gprof connections
  connect-pin deinit-sequence output-7 -> gprof store
! connect-pin cpu sample-gprof -> gprof sample
! connect-pin cpu gprof-pc -> gprof pc
! connect-pin cpu gprof-pc-hi -> gprof pc-hi
  connect-pin cpu cg-caller -> gprof cg-caller
  connect-pin cpu cg-callee -> gprof cg-callee
! relate gprof target-component cpu
  set gprof bucket-size 4 # bytes per bucket
  ";
    }
Index: sid/component/profiling/sw-profile-gprof.xml
===================================================================
RCS file: /cvs/src/src/sid/component/profiling/sw-profile-gprof.xml,v
retrieving revision 1.4
diff -c -p -r1.4 sw-profile-gprof.xml
*** sid/component/profiling/sw-profile-gprof.xml 11 May 2006 16:04:38 -0000 1.4
--- sid/component/profiling/sw-profile-gprof.xml 26 Jun 2006 21:57:16 -0000
***************
*** 6,11 ****
--- 6,13 ----
 
      <!-- pins -->
      <defpin name="reset" direction="in" legalvalues="any" behaviors="resetting" />
+     <defpin name="pc" direction="in" legalvalues="any" behaviors="data gathering" />
+     <defpin name="pc-hi" direction="in" legalvalues="any" behaviors="data gathering" />
      <defpin name="sample" direction="in" legalvalues="any" behaviors="data gathering" />
      <defpin name="cg-caller" direction="in" legalvalues="any" behaviors="data gathering" />
      <defpin name="cg-caller-hi" direction="in" legalvalues="any" behaviors="data gathering" />
***************
*** 21,27 ****
      <defattribute name="limit-max" category="setting" legalvalues="decimal string" defaultvalue="infinity" behaviors="data gathering" />
      <defattribute name="bucket-size" category="setting" legalvalues="integer" defaultvalue="1" behaviors="data gathering" />
      <defattribute name="pc-size" category="setting" legalvalues="4 or 8" defaultvalue="4" behaviors="data gathering" />
-     <defattribute name="value-attribute" category="setting" legalvalues="name" defaultvalue="'pc'" behaviors="data gathering" />
      <defattribute name="output-file" category="setting" legalvalues="file name" defaultvalue="'gmon.out'" behaviors="configuration" />
      <defattribute name="output-file-endianness" category="setting" legalvalues="0/1/2/little/big/unknown" defaultvalue="unknown" behaviors="configuration" />
      <defattribute name="reset" category="pin" behaviors="resetting" />
--- 23,28 ----
***************
*** 55,62 ****
        <p>
        This component needs to be configured with the <relation>target-component</relation>
        relation.  The first element in the relation will be used as the
!       target of profiling.  The <attribute>value-attribute</attribute> setting contains the
!       name of the target component's attribute that will be collected. If pc-size is 64, then
        the target component should also have an attribute with the same name suffixed by "-hi"
        </p>
        <p>
--- 56,62 ----
        <p>
        This component needs to be configured with the <relation>target-component</relation>
        relation.  The first element in the relation will be used as the
!       target of profiling.  If pc-size is 64, then
        the target component should also have an attribute with the same name suffixed by "-hi"
        </p>
        <p>
***************
*** 78,90 ****
      <behavior name="data gathering">
        <p>
        Whenever the <pin>sample</pin> pin is driven, this component
!       takes a single sample of the configured target component's value
!       attribute.  The attribute is interpreted as a numeric string,
!       and the resulting number is accumulated in a big histogram, in
!       the appropriate bucket.  The bucket is chosen by masking the
!       number into <attribute>bucket-size</attribute>-wide buckets.
!       If the target component is unset, or its target attribute does
!       not result in a valid numeric string, no sample is accumulated.
        </p>
        <p>Alternately, if the <pin>cg-caller</pin> and perhaps the <pin>cg-caller-hi</pin>
        and then the <pin>cg-callee</pin> and perhaps the <pin>cg-callee-hi</pin>
--- 78,89 ----
      <behavior name="data gathering">
        <p>
        Whenever the <pin>sample</pin> pin is driven, this component
!       takes a single sample using the number drive  on the pin.
!       The resulting number is accumulated in a big histogram, in
!       the appropriate bucket.  The bucket is chosen by combining the two 32 bit values
!       last driven on the <pin>pc</pin> and the <pin>pc-hi</pin> pins to form one 64 bit index.
!       This index is then masked into <attribute>bucket-size</attribute>-wide buckets.
!       If the target component is unset then no sample is accumulated.
        </p>
        <p>Alternately, if the <pin>cg-caller</pin> and perhaps the <pin>cg-caller-hi</pin>
        and then the <pin>cg-callee</pin> and perhaps the <pin>cg-callee-hi</pin>
***************
*** 144,161 ****
        be driven by any activity in SID, such as bus traffic (see
        <tt>hw-probe-bus</tt>), or host or target schedulers (see
        <tt>sid-sched-*</tt>).
!       Perhaps the simplest way is to take a CPU PC sample every time
!       the CPU has completed a batch of instructions.</p>
 
      <code>
  new sw-profile-gprof gprof
  new SOME_KIND_OF_CPU cpu
  relate gprof target-component cpu
  connect-pin shutdown-manager output-5 -&gt; gprof store
! connect-pin foo output -&gt; cpu step!
! connect-pin foo output -&gt; gprof sample
! # Set sampling interval by number of CPU instructions.
! set cpu step-insn-count 127
      </code>
      <title>
     Host system
--- 143,157 ----
        be driven by any activity in SID, such as bus traffic (see
        <tt>hw-probe-bus</tt>), or host or target schedulers (see
        <tt>sid-sched-*</tt>).
!       </p>
 
      <code>
  new sw-profile-gprof gprof
  new SOME_KIND_OF_CPU cpu
  relate gprof target-component cpu
  connect-pin shutdown-manager output-5 -&gt; gprof store
! connect-pin cpu sample-gprof -&gt; gprof sample
! connect-pin cpu gprof-pc -&gt; gprof pc
      </code>
      <title>
     Host system