1. A data processing apparatus, comprising: a processor; a compiler for compiling application code to generate instructions for execution by the processor; a non-invasive trace unit coupled to the processor for generating, from input signals received from the processor, trace signals indicative of the instructions being executed by the processor; the compiler being arranged to control the compilation of the application code dependent on the trace signals.