Выбрать главу

Like the Performance Profiler, the data is collected in a local buffer and periodically uploaded to the Memory Analyzer GUI on the host.

Data Monitor (Formerly StethoScope)

The Data Monitor uses an oscilloscope metaphor to monitor program variables in real time and display the results graphically (Figure 9.23). Like the Performance Profiler, an agent on the target periodically samples the variables being monitored and stores the values in a local buffer. A low priority process then sends this buffer to the host for display. The performance hit is claimed to be fairly minor.

Figure 9.23: Data Monitor.

The sampling interval is configurable. Variables can be added or removed from the monitor list while the application runs. Variable values can also be modified at run time. Collected data can be stored to a file on the host, formatted for post processing by other applications, such as MatLab or Excel.

As described thus far, the Data Monitor is asynchronous with respect to any running applications. In some situations, it may be more meaningful to collect data synchronously. The Data Monitor target agent can be configured to collect data in response to calls from the application, thus making data collection synchronous with respect to the application.

Code Coverage Analyzer (Formerly CoverageScope)

This tool reports how much of the code in a system has been executed, or more importantly, which code hasn’t been executed. Unlike the other tools, Code Coverage requires that the code be recompiled with the appropriate instrumentation added. You select which files to instrument and the level of coverage analysis. The four types of coverage are:

• Function: Verifies that the function was called.

• Block: Did this statement or block of statements get executed?

• Decision: Have both the true and false branches of a Boolean expression used in a branching statement such as if() or while() been executed?

• Condition: Did every subexpression in a Boolean expression evaluate to both true and false? Example:

if (a && b || BuggyFunction())

How to be sure that BuggyFunction() was executed?

The high-level output from Code Coverage is shown in Figure 9.24. Double-click on any function name and the source code shows up in an editor with the uncovered code highlighted.

Figure 9.24: Code Coverage Analyzer. 

Summary

In this chapter we’ve seen how some of the major players in the open source software business have adapted the Eclipse platform to create high quality commercial software development tools. Each vendor has chosen a slightly different approach that emphasizes its particular strengths to differentiate its offerings from the competition.

Free software doesn’t necessarily mean free of charge, and in fact there’s no such thing as zero cost software[15]. One way or another you’re going to pay for it. You can download it all from the Internet and go through the inevitable learning curve. On the other hand, the most cost-effective way to get your product out the door on time may be to buy a high-quality commercial tool.

This brings us to the end of our exploration of Eclipse as a platform for developing embedded software around Linux. We’ve seen how Eclipse provides intuitive, graphical tools for building and managing software projects of any size. Even though Eclipse was originally aimed at Java development, additional plug-ins provide facilities to work with the GNU compiler tool chains for C and C++ development. For the embedded space in particular, Eclipse offers tools to access and manage remote target hardware.

We looked at the Eclipse plug-in architecture and how it extends the functionality of the basic platform. Well over a thousand plug-ins, both open source and commercial, provide support for just about any development task you require. If you can’t find what you need, you can always create your own.

Needless to say, there’s a lot more there. We’ve really only scratched the surface. I hope I’ve piqued your interest sufficiently to dive in and play around with it some more. And don’t forget that Eclipse is constantly evolving.

You may even want to get involved in Eclipse development itself. The Eclipse community enthusiastically welcomes new contributors.

APPENDIX A

The Eclipse Public License

Open Source Initiative OSI - Eclipse Public  License v 1.0

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT’S ACCEPTANCE OF THIS AGREEMENT.

1. DEFINITIONS

“Contribution” means:

a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and

b) in the case of each subsequent Contributor:

 I. changes to the Program, and

 II. additions to the Program;

where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution ‘originates’ from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor’s behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.

“Contributor” means any person or entity that distributes the Program.

“Licensed Patents” mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.

“Program” means the Contributions distributed in accordance with this Agreement.

“Recipient” means anyone who receives the Program under this Agreement, including all Contributors.

2. GRANT OF RIGHTS

a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.

b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.

c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient’s responsibility to acquire that license before distributing the Program.

вернуться

15

As one open source practitioner put it some time ago, “Think free speech, not free beer.”