Embedded Systems Design Europe - April 2008 - (Page 32) linux the graphical trace visualization tool (for more information, read the LTT reference manual at www.opersys.com/LTT/ dox/ltt-online-help/index.html). Eventually all embedded systems projects reach the optimization phase where a good profiler can come in handy. OProfile is a systemwide profiler for Linux that’s capable of profiling user space applications, kernel code, and loadable modules. The OProfile software package consists of kernel code, userspace daemon, and utilities. Fortunately, no kernel patching is required as OProfile is part of the stock Linux 2.6 kernel. A typical OProfile session looks like: opcontrol —vmlinux =/path/to/vmlinux opcontrol —start #execute your code opreport -l /path/to/mybinary opcontrol —reset you to read more at oprofile.sourceforge. net/doc/index.html. An important tip for embedded developers is that they can filter profiling results by modules, which can be a driver, an application, or the kernel itself. Note that OProfile is a statistical profiler, which means it samples program-counter values on interrupt (usually timer interrupt), so you must run the code for some minimal time period to get meaningful results. If your hardware is like most, and has performance counters that can generate an interrupt on such events as cache miss, you can find not only the most CPU-intensive pieces of code, but also the most cache inefficient. Unless you use an exotic CPU, OProfile will already have support for performance counters of that CPU. BINDING IT ALL TOGETHER Although it’s not necessary and can even make things more complex, if you’re more comfortable with a monolithic IDE-like software package that can do all your daily tasks using keyboard shortcuts and menus, the simplest way to do this is to create a new Emacs menu called “Embedded” and add all your scripts to that menu. The example in Listing 3 (Emacs Lisp code The first two commands start the profiler, opreport prints the results, and the last command resets the data. OProfile is a powerful profiler with many features, all of which are outside the scope of this article, but I encourage that should be added to your .emacs file) illustrates this. Full explanation of this code requires some Lisp knowledge (and beyond the scope of this article), but a brief description of each command will be given, so you can customize the code and add new functionality without a full understanding of Lisp and Emacs internals. The first set of commands creates the “Embedded” drop-down menu. The second one adds a new entry “Program flash” to the menu that executes the “program-flash” Lisp function. The third set binds that command to “Ctrl-c” followed by a “pf” key combination. The final one is a Lisp function that executes a “program-flash.sh” shell script redirecting its output to a newly created Emacs buffer. Creating an embedded Linux development environment by yourself may look like a serious task. But keep in mind that this is a good investment. This task can be easily outsourced to an embedded Linux consultant, in which case it’ll probably cost less than an off-the-shelf embedded Linux IDE. Note that in the Linux world, there many different ways to accomplish the same task. This article shows just one of those alternatives. Alexander Sirotkin works for Metalink Broadband as a software architect. For more than 10 years, he’s been dealing with software, operating systems, and networking, and holds M.Sc. and B.Sc. degrees in applied statistics, computer science and physics from Tel-Aviv University. Sirotkin can be reached at sasha.sirotkin@gmail.com. Listing 3 Emacs Lisp code that should be added to your .emacs file to create IDE-type keyboard shortcuts. (define-key global-map [menu-bar embedded] (cons “Embedded” (make-sparse-keymap “Embedded”))) (define-key global-map [menu-bar embedded program-flash] ‘(“Program flash” . program-flash)) (define-key global-map “\C-cpf” ‘program-flash) (defun program-flash () “Program flash.” (interactive) (setq embedded-buffer (get-buffer-create “Embedded Buffer”)) (display-buffer embedded-buffer) (set-buffer embedded-buffer) (setq buffer-read-only nil) (call-process “program-flash.sh” nil embedded-buffer t) RESOURCES Wine – www.winehq.org/ VirtualBox – www.virtualbox.org/ Eclipse – www.eclipse.org/ Emacs – www.gnu.org/software/emacs/ Cscope – cscope.sourceforge.net/ Busybox – busybox.net/ GDB – www.gnu.org/software/gdb/ DDD – www.gnu.org/software/ddd/ Insight – sourceware.org/insight/ OProfile – oprofile.sourceforge.net/ 32 APRIL 2008 | embedded systems design europe | www.embedded.com/europe 028-029-030-031-032_ESDE.indd 32 8/04/08 12:41:44 http://oprofile.sourceforge.net/doc/index.html http://oprofile.sourceforge.net/doc/index.html http://www.opersys.com/LTT/dox/ltt-online-help/index.html http://www.opersys.com/LTT/dox/ltt-online-help/index.html http://www.winehq.org/ http://www.virtualbox.org/ http://www.eclipse.org/ http://www.gnu.org/software/emacs/ http://cscope.sourceforge.net/ http://busybox.net/ http://www.gnu.org/software/gdb/ http://www.gnu.org/software/ddd/ http://sourceware.org/insight/ http://oprofile.sourceforge.net/ http://www.embedded.com/europe
Table of Contents Feed for the Digital Edition of Embedded Systems Design Europe - April 2008 Embedded Systems Design Europe - April 2008 Contents Chip Industry Confronts 'Software' Gap Wind River's VxWorks OS Part of the nEUROn UCAV Demonstrator iSuppli Cuts Electronic Equipment Forecast Study Says GigE Vision Not Mature Chip Aids Wireless Health Monitoring Kontron Reports Strong Financial Growth Xilinx Completes Virtex-5 Line-Up French Project Builds Open Platform Home Automation Group Uses Enocean Radio Layer MIPs Adds Multi-Core Option to Portfolio Cover Feature: Next Gen Programmable Chips: Why Can't Hardware Be More Like Software? Improving Productivity & Quality With Domain-Specific Modeling Efficient CRC Calculation With Minimal Memory Footprint Do-It-Yourself Linux Embedded Development Tools Hardware/Software Verification Enters the Atomic Age New Products Advertising Contacts Embedded Systems Design Europe - April 2008 Embedded Systems Design Europe - April 2008 - Embedded Systems Design Europe - April 2008 (Page Cover1) Embedded Systems Design Europe - April 2008 - Embedded Systems Design Europe - April 2008 (Page Cover2) Embedded Systems Design Europe - April 2008 - Contents (Page 3) Embedded Systems Design Europe - April 2008 - Contents (Page 4) Embedded Systems Design Europe - April 2008 - Contents (Page 5) Embedded Systems Design Europe - April 2008 - Chip Industry Confronts 'Software' Gap (Page 6) Embedded Systems Design Europe - April 2008 - Wind River's VxWorks OS Part of the nEUROn UCAV Demonstrator (Page 7) Embedded Systems Design Europe - April 2008 - Study Says GigE Vision Not Mature (Page 8) Embedded Systems Design Europe - April 2008 - Study Says GigE Vision Not Mature (Page 9) Embedded Systems Design Europe - April 2008 - Kontron Reports Strong Financial Growth (Page 10) Embedded Systems Design Europe - April 2008 - Kontron Reports Strong Financial Growth (Page 11) Embedded Systems Design Europe - April 2008 - Xilinx Completes Virtex-5 Line-Up (Page 12) Embedded Systems Design Europe - April 2008 - Home Automation Group Uses Enocean Radio Layer (Page 13) Embedded Systems Design Europe - April 2008 - MIPs Adds Multi-Core Option to Portfolio (Page 14) Embedded Systems Design Europe - April 2008 - Cover Feature: Next Gen Programmable Chips: Why Can't Hardware Be More Like Software? (Page 15) Embedded Systems Design Europe - April 2008 - Cover Feature: Next Gen Programmable Chips: Why Can't Hardware Be More Like Software? (Page 16) Embedded Systems Design Europe - April 2008 - Cover Feature: Next Gen Programmable Chips: Why Can't Hardware Be More Like Software? (Page 17) Embedded Systems Design Europe - April 2008 - Cover Feature: Next Gen Programmable Chips: Why Can't Hardware Be More Like Software? (Page 18) Embedded Systems Design Europe - April 2008 - Cover Feature: Next Gen Programmable Chips: Why Can't Hardware Be More Like Software? (Page 19) Embedded Systems Design Europe - April 2008 - Improving Productivity & Quality With Domain-Specific Modeling (Page 20) Embedded Systems Design Europe - April 2008 - Improving Productivity & Quality With Domain-Specific Modeling (Page 21) Embedded Systems Design Europe - April 2008 - Improving Productivity & Quality With Domain-Specific Modeling (Page 22) Embedded Systems Design Europe - April 2008 - Improving Productivity & Quality With Domain-Specific Modeling (Page 23) Embedded Systems Design Europe - April 2008 - Efficient CRC Calculation With Minimal Memory Footprint (Page 24) Embedded Systems Design Europe - April 2008 - Efficient CRC Calculation With Minimal Memory Footprint (Page 25) Embedded Systems Design Europe - April 2008 - Efficient CRC Calculation With Minimal Memory Footprint (Page 26) Embedded Systems Design Europe - April 2008 - Efficient CRC Calculation With Minimal Memory Footprint (Page 27) Embedded Systems Design Europe - April 2008 - Do-It-Yourself Linux Embedded Development Tools (Page 28) Embedded Systems Design Europe - April 2008 - Do-It-Yourself Linux Embedded Development Tools (Page 29) Embedded Systems Design Europe - April 2008 - Do-It-Yourself Linux Embedded Development Tools (Page 30) Embedded Systems Design Europe - April 2008 - Do-It-Yourself Linux Embedded Development Tools (Page 31) Embedded Systems Design Europe - April 2008 - Do-It-Yourself Linux Embedded Development Tools (Page 32) Embedded Systems Design Europe - April 2008 - Hardware/Software Verification Enters the Atomic Age (Page 33) Embedded Systems Design Europe - April 2008 - Hardware/Software Verification Enters the Atomic Age (Page 34) Embedded Systems Design Europe - April 2008 - Hardware/Software Verification Enters the Atomic Age (Page 35) Embedded Systems Design Europe - April 2008 - Hardware/Software Verification Enters the Atomic Age (Page 36) Embedded Systems Design Europe - April 2008 - Hardware/Software Verification Enters the Atomic Age (Page 37) Embedded Systems Design Europe - April 2008 - Hardware/Software Verification Enters the Atomic Age (Page 38) Embedded Systems Design Europe - April 2008 - New Products (Page 39) Embedded Systems Design Europe - April 2008 - New Products (Page 40) Embedded Systems Design Europe - April 2008 - New Products (Page 41) Embedded Systems Design Europe - April 2008 - New Products (Page 42) Embedded Systems Design Europe - April 2008 - Advertising Contacts (Page 43) Embedded Systems Design Europe - April 2008 - Advertising Contacts (Page Cover4)
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.