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 #include "llvm/Support/DataTypes.h"
22 /* A file in this case is a translation unit. Each .o file built with line
23 * profiling enabled will emit to a different file. Only one file may be
26 void llvm_prof_linectr_start_file(const char *orig_filename
) {
27 printf("[%s]\n", orig_filename
);
30 /* Emit data about a counter to the data file. */
31 void llvm_prof_linectr_emit_counter(const char *dir
, const char *file
,
32 uint32_t line
, uint32_t column
,
34 printf("%s/%s:%u:%u %ull\n", dir
, file
, line
, column
,
35 (unsigned long long)(*counter
));
38 void llvm_prof_linectr_end_file() {