Embedded Systems Design - Europe - August/September 2007 - (Page 34) software Listing 2 Macro evaluation when building product. #define TDR_DEFINE_ENTRY(entry_ID_mnemonic, entry_number, format_string) \ enum { entry_ID_mnemonic = entry_number}; Listing 3 Macro evaluation when building dump processing tool. #define TDR_DEFINE_ENTRY(entry_ID_mnemonic, entry_number, format_string) \ {entry_number, #entry_ID_mnemonic, format_string}, address with the operating-system process that owns it. Then, libraries, called by a thread in the process, place data into the correct capture buffer just by calling the capture library. They don’t need to know the buffer address into which they place data. This method can be accomplished by storing the capture buffer address in process-specific storage or task control block. Figure 3 shows a data structure that can be used to implement a capture buffer. Not all of the fields in the capture buffer are dumped to nonvolatile storage. The process owns a header that contains a pointer to the capture buffer shared with the dump agent. The buffer’s body is shared with the dump agent. It identifies the process that created it (PID), the functional subsystem that created it (Module ID), and contains a human-readable string that uniquely identifies the instance of the buffer. Besides the size of the buffer and the number of entries, it contains a next-available field that indicates that next entry to be written/overwritten. When dumped, the value shows the post-processing tool where the oldest and latest entries are in the buffer. The freeze flag is set by the dump agent prior to initiating the dump. It inhibits the capture library from placing further information into the buffer. This restriction preserves the buffer’s contents while the dump occurs. Also included in the buffer’s body are statistics about how the buffer is used. These statistics help software engineers tune the buffer’s size during development. Helpful values include the number of entries placed into the buffer, the number of times the buffer has rolled over, and the average rollover period. Each buffer entry contains the ID of the thread/process that placed it into the buffer. The module ID field indicates the functional component of the software that produced the entry. The Entry ID field identifies the data’s format and identifies the unique line of code that produced it. The entry must also contain a highly accurate timestamp having sub-millisecond resolution. This permits developers to construct a high-fidelity timeline of events leading to the system failure. DEFINING ENTRY IDS Each entry placed into a capture buffer should have a unique ID that parses the entry in the dump and locates the unique line of code that produced the entry. Developers define a new ID each time they write code to place data into the buffer. When defining the ID, the developer can provide information to help generate a parser to post-process the raw dump to produce human-readable output. One way to do this is to define a preprocessor macro. Developers supply a mnemonic identifier, numeric value, and printf-like formatting information. When compiling the system source code, the macro evaluates to the code in Listing 2. But this definition can also help produce a dump post-processing tool. If all entry definitions are placed in the same header file, the macro can be conditionally compiled to evaluate to an entry in a lookup table, as shown in Listing 3. The lookup table can be used as part of a post-processing tool to parse and display the entry when it’s encountered in a dump. Note that the postprocessing code will have to interpret the format_string field to unpack the data bytes in the entry. Listing 4 shows an example of the macro used to define an entry ID for a 34 AUGUST – SEPTEMBER 2007 | embedded systems design europe | www.embedded.com/europe 030-031-032-033-034-035_ESDE.ind34 34 5/09/07 12:32:00 http://www.embedded.com/europe
Table of Contents Feed for the Digital Edition of Embedded Systems Design - Europe - August/September 2007 Contents News Cover Feature: Annual Study Uncovers the Embedded Market DSP Serves the Convergence Needs of Small Business Embedded Test Offers Unique Value for Serial I/O The Software Detective: First-Fault Data Capture Boards May Shrink But Performance Doesn't New Products Advertising Contacts Embedded Systems Design - Europe - August/September 2007 Embedded Systems Design - Europe - August/September 2007 - (Page 1) Embedded Systems Design - Europe - August/September 2007 - (Page 2) Embedded Systems Design - Europe - August/September 2007 - Contents (Page 3) Embedded Systems Design - Europe - August/September 2007 - Contents (Page 4) Embedded Systems Design - Europe - August/September 2007 - Contents (Page 5) Embedded Systems Design - Europe - August/September 2007 - News (Page 6) Embedded Systems Design - Europe - August/September 2007 - News (Page 7) Embedded Systems Design - Europe - August/September 2007 - News (Page 8) Embedded Systems Design - Europe - August/September 2007 - News (Page 9) Embedded Systems Design - Europe - August/September 2007 - News (Page 10) Embedded Systems Design - Europe - August/September 2007 - News (Page 11) Embedded Systems Design - Europe - August/September 2007 - Cover Feature: Annual Study Uncovers the Embedded Market (Page 12) Embedded Systems Design - Europe - August/September 2007 - Cover Feature: Annual Study Uncovers the Embedded Market (Page 13) Embedded Systems Design - Europe - August/September 2007 - Cover Feature: Annual Study Uncovers the Embedded Market (Page 14) Embedded Systems Design - Europe - August/September 2007 - Cover Feature: Annual Study Uncovers the Embedded Market (Page 15) Embedded Systems Design - Europe - August/September 2007 - Cover Feature: Annual Study Uncovers the Embedded Market (Page 16) Embedded Systems Design - Europe - August/September 2007 - Cover Feature: Annual Study Uncovers the Embedded Market (Page 17) Embedded Systems Design - Europe - August/September 2007 - Cover Feature: Annual Study Uncovers the Embedded Market (Page 18) Embedded Systems Design - Europe - August/September 2007 - Cover Feature: Annual Study Uncovers the Embedded Market (Page 19) Embedded Systems Design - Europe - August/September 2007 - DSP Serves the Convergence Needs of Small Business (Page 20) Embedded Systems Design - Europe - August/September 2007 - DSP Serves the Convergence Needs of Small Business (Page 21) Embedded Systems Design - Europe - August/September 2007 - DSP Serves the Convergence Needs of Small Business (Page 22) Embedded Systems Design - Europe - August/September 2007 - DSP Serves the Convergence Needs of Small Business (Page 23) Embedded Systems Design - Europe - August/September 2007 - DSP Serves the Convergence Needs of Small Business (Page 24) Embedded Systems Design - Europe - August/September 2007 - Embedded Test Offers Unique Value for Serial I/O (Page 25) Embedded Systems Design - Europe - August/September 2007 - Embedded Test Offers Unique Value for Serial I/O (Page 26) Embedded Systems Design - Europe - August/September 2007 - Embedded Test Offers Unique Value for Serial I/O (Page 27) Embedded Systems Design - Europe - August/September 2007 - Embedded Test Offers Unique Value for Serial I/O (Page 28) Embedded Systems Design - Europe - August/September 2007 - Embedded Test Offers Unique Value for Serial I/O (Page 29) Embedded Systems Design - Europe - August/September 2007 - The Software Detective: First-Fault Data Capture (Page 30) Embedded Systems Design - Europe - August/September 2007 - The Software Detective: First-Fault Data Capture (Page 31) Embedded Systems Design - Europe - August/September 2007 - The Software Detective: First-Fault Data Capture (Page 32) Embedded Systems Design - Europe - August/September 2007 - The Software Detective: First-Fault Data Capture (Page 33) Embedded Systems Design - Europe - August/September 2007 - The Software Detective: First-Fault Data Capture (Page 34) Embedded Systems Design - Europe - August/September 2007 - The Software Detective: First-Fault Data Capture (Page 35) Embedded Systems Design - Europe - August/September 2007 - Boards May Shrink But Performance Doesn't (Page 36) Embedded Systems Design - Europe - August/September 2007 - Boards May Shrink But Performance Doesn't (Page 37) Embedded Systems Design - Europe - August/September 2007 - Boards May Shrink But Performance Doesn't (Page 38) Embedded Systems Design - Europe - August/September 2007 - Boards May Shrink But Performance Doesn't (Page 39) Embedded Systems Design - Europe - August/September 2007 - New Products (Page 40) Embedded Systems Design - Europe - August/September 2007 - New Products (Page 41) Embedded Systems Design - Europe - August/September 2007 - New Products (Page 42) Embedded Systems Design - Europe - August/September 2007 - Advertising Contacts (Page 43) Embedded Systems Design - Europe - August/September 2007 - Advertising Contacts (Page 44)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.