1. A computer-implemented method for determining whether to inline functions into a calling context during compilation of source code for a program, the method comprising: loading a data file containing data gathered during execution of the program, the data file containing a plurality of hardware event samples for inlined functions, wherein each sample includes an associated calling context; loading a debugging information which permits identification of source code positions from the hardware-event samples; analyzing the data file and the debugging information to compute a plurality of context-specific basic block counts; determining whether to inline at least one function in the source code in at least one context during compilation of the source code using the plurality of context-specific basic block counts; and converting the data file into a plurality of context-specific edge frequencies for use by a feedback-directed optimizing compiler.