Download Design and Implementation of a Source Code Profiling Toolset for

Transcript
Chapter 6
Application Tests and Results
Previous chapters described what a profiler is, how to use it and how it
works, from theory to implementation. In this chapter, we will demonstrate
the usage of Rilievo profiler through analyzing a practical project.
6.1 Test Description
Like “black box test” in software engineering, we start the testing from
introducing an “unknown” project, just like what the profiler is supposed to
be used, that the engineers knows nothing about how the target program
works. Here in our test, we used a JPEG encoder based on libJPEG which is
used in course TSEA44 Computer Hardware.
When we have the encoder, we only know two things. First of all, it’s an
image encoder which encodes raw image data into compressed format. This
piece of information told us that normally image compressing uses large
amount of loops for block computation. Second, from the description file we
can see that the encoder implements Discrete Cosine Transform (DCT) and
Huffman algorithm to compress the raw image. As ASIP engineers, we do
not care how this works and the theory behind these algorithms. However
the information we retrieved is that these algorithms must take the majority
computational payload of the program. Thus we need the profiler to tell us
where exactly these computations are before we examine the code manually.
6.2 Preparations
To start with, we need a working profiler as mentioned in Chapter 4. After
compiling the profiler, we need to modify the “Makefile” of the target
program because we need to use patched GCC as the compiler and linker to