public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* hw-glue-probe-bus enhancement
@ 2002-05-27 13:11 Ben Elliston
  0 siblings, 0 replies; only message in thread
From: Ben Elliston @ 2002-05-27 13:11 UTC (permalink / raw)
  To: sid

The following patch enhances the hw-glue-probe-bus component to allow
an optional label to be given to each instance.  This is helpful for
distinguishing trace output when placing multiple probes around a
complicated memory hierarchy.

Okay to commit?


2002-05-27  Ben Elliston  <bje@redhat.com>

	* glue.cxx (bus_prober::label): New member.
	(bus_prober ctor): Add a corresponding "label" attribute.
	(probing_bus::traceAccess): Output a component label, if given.
	* hw-glue-probe-bus.xml: Update documentation.

Index: glue.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/glue/glue.cxx,v
retrieving revision 1.6
diff -u -p -r1.6 glue.cxx
--- glue.cxx	3 Aug 2001 06:02:44 -0000	1.6
+++ glue.cxx	27 May 2002 20:09:18 -0000
@@ -383,6 +383,7 @@ class bus_prober: public virtual compone
   output_pin accesstype_pin;
 
   host_int_4 sample_interval; // 0: disabled
+  string label;
 
 public:
   bus_prober::bus_prober ():
@@ -407,6 +408,7 @@ public:
       
       add_attribute ("sample-interval", & this->sample_interval, "setting");
       add_attribute ("trace?", & this->upstream.verbose_p, "setting");
+      add_attribute ("label", & this->label, "setting");
       add_attribute_ro ("interval-counter", & this->upstream.counter, "register");
 
       // XXX: make watchable
@@ -433,6 +435,9 @@ probing_bus::traceAccess(host_int_4 addr
     (s == bus::unmapped) ? " unmapped!" :
     (s == bus::unpermitted) ? " unpermitted!" : " (unknown)!";
 
+  if (prober->label != "")
+    cout << prober->label << ": ";
+    
   cout << access_type1 << '-' << access_endian << '-' << access_size << ':'
        << make_numeric_attribute (addr, ios::hex | ios::showbase) << ' '
        << access_type2 << ' '
Index: hw-glue-probe-bus.txt
===================================================================
RCS file: /cvs/src/src/sid/component/glue/hw-glue-probe-bus.txt,v
retrieving revision 1.3
diff -u -p -r1.3 hw-glue-probe-bus.txt
--- hw-glue-probe-bus.txt	3 Aug 2001 01:30:18 -0000	1.3
+++ hw-glue-probe-bus.txt	27 May 2002 20:09:18 -0000
@@ -46,7 +46,8 @@ Functionality:
 |           |One line per transaction is shown in a format resembling the common gdb |
 |           |simulators' --trace-core output:                                        |
 |           |                                                                        |
-|           |MODE:ADDRESS ARROW DATA [LATENCY] [STATUS] where MODE is an encoding of |
+|           |[LABEL:] MODE:ADDRESS ARROW DATA [LATENCY] [STATUS] where LABEL is an   |
+|           |optional label identifying the probe component. MODE is an encoding of  |
 |           |the access type: zzz where le and be represent little- or               |
 |           |big-endianness, and 1-8 represent the number of bytes transferred. ARROW|
 |           |is a redundant encoding of direction: {->,<-} for {read,write} ADDRESS  |
@@ -181,6 +182,10 @@ Component Reference:
    |----------------+--------+-------+-------+---------||
    |                |        |       |       |bus      ||
    |type            |pin     |numeric|-      |traffic  ||
+   |                |        |       |       |sampling ||
+   |----------------+--------+-------+-------+---------||
+   |                |        |any    |       |bus      ||
+   |label           |setting |string |-      |traffic  ||
    |                |        |       |       |sampling ||
    +----------------------------------------------------+
 
Index: hw-glue-probe-bus.xml
===================================================================
RCS file: /cvs/src/src/sid/component/glue/hw-glue-probe-bus.xml,v
retrieving revision 1.1
diff -u -p -r1.1 hw-glue-probe-bus.xml
--- hw-glue-probe-bus.xml	3 Aug 2001 01:47:52 -0000	1.1
+++ hw-glue-probe-bus.xml	27 May 2002 20:09:18 -0000
@@ -26,6 +26,7 @@
     <defattribute name="data-low" category="pin" legalvalues="numeric" behaviors="bus traffic sampling" />
     <defattribute name="status" category="pin" legalvalues="numeric" behaviors="bus traffic sampling" />
     <defattribute name="type" category="pin" legalvalues="numeric" behaviors="bus traffic sampling" />
+    <defattribute name="label" category="setting" legalvalues="any string" behaviors="bus traffic sampling" />
   </defcomponent>
   <synop>
     <p>
@@ -82,8 +83,9 @@
 	One line per transaction is shown in a format resembling the common gdb simulators'
 	<tt>--trace-core</tt> output:</p>
 	<tt>
-	MODE:ADDRESS ARROW DATA [LATENCY] [STATUS]</tt>
+	[LABEL:] MODE:ADDRESS ARROW DATA [LATENCY] [STATUS]</tt>
 	where
+        <tt>LABEL</tt> is an optional label identifying the probe component.
 	<tt>MODE</tt> is an encoding of the access type:
 	<tt>zzz</tt>
 	where <tt>le</tt> and <tt>be</tt> represent little- or big-endianness,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-27 20:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-27 13:11 hw-glue-probe-bus enhancement Ben Elliston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).