29.01.2014 Views

A CIL Tutorial - Department of Computer Science - ETH Zürich

A CIL Tutorial - Department of Computer Science - ETH Zürich

A CIL Tutorial - Department of Computer Science - ETH Zürich

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 4. INSTRUMENTATION 41<br />

$ ciltutcc --enable-tut4 -o tut4 test/tut4.c<br />

Then, when we run tut4, we get the following output:<br />

$ ./tut4<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:18 - 5 times<br />

loop: test/tut4.c:17 - 10 times<br />

which is what we expected.<br />

4.4 Exercises<br />

1. Count the number <strong>of</strong> times: a variable is read/written, a particular instruction or statement<br />

is executed, how many times a branch is taken one way or the other, etc.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!