  Computer science marches towards energy-aware practices. This trend impacts
not only the design of computer architectures, but also the design of programs.
However, developers still lack affordable and accurate technology to measure
energy consumption in computing systems. The goal of this paper is to mitigate
such problem. To this end, we introduce JetsonLEAP, a framework that supports
the implementation of energy-aware programs. JetsonLEAP consists of an embedded
hardware, in our case, the Nvidia Tegra TK1 System-on-a-chip device, a circuit
to control the flow of energy, of our own design, plus a library to instrument
program parts. We discuss two different circuit setups. The most precise setup
lets us reliably measure the energy spent by 225,000 instructions, the least
precise, although more affordable setup, gives us a window of 975,000
instructions. To probe the precision of our system, we use it in tandem with a
high-precision, high-cost acquisition system, and show that results do not
differ in any significant way from those that we get using our simpler
apparatus. Our entire infrastructure - board, power meter and both circuits -
can be reproduced with about $500.00. To demonstrate the efficacy of our
framework, we have used it to measure the energy consumed by programs running
on ARM cores, on the GPU, and on a remote server. Furthermore, we have studied
the impact of OpenACC directives on the energy efficiency of high-performance
applications.
