1 /*===- LineProfiling.c - Support library for line profiling ---------------===*\
3 |* The LLVM Compiler Infrastructure
5 |* This file is distributed under the University of Illinois Open Source
6 |* License. See LICENSE.TXT for details.
8 |*===----------------------------------------------------------------------===*|
10 |* This file implements the call back routines for the line profiling
11 |* instrumentation pass. Link against this library when running code through
12 |* the -insert-line-profiling LLVM pass.
14 \*===----------------------------------------------------------------------===*/
20 /* A file in this case is a translation unit. Each .o file built with line
21 * profiling enabled will emit to a different file. Only one file may be
24 void llvm_prof_linectr_start_file(const char *orig_filename) {
25 printf("[%s]\n", orig_filename);
28 /* Emit data about a counter to the data file. */
29 void llvm_prof_linectr_emit_counter(const char *dir, const char *file,
30 uint32_t line, uint32_t column,
32 printf("%s/%s:%u:%u %lu\n", dir, file, line, column, *counter);
35 void llvm_prof_linectr_end_file() {