diff options
| author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-03-21 18:29:15 +0000 |
|---|---|---|
| committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-03-21 18:29:15 +0000 |
| commit | be0a5e176b6cadae34b14a7efac7eae2d918cfb6 (patch) | |
| tree | 585c0ec1ada6e845167029fa5ec7e388a0bc22c7 /compiler-rt/lib/profile/InstrProfiling.h | |
| parent | 24b4b6533925e6dbd0faef7976c7f794499e0ec6 (diff) | |
| download | bcm5719-llvm-be0a5e176b6cadae34b14a7efac7eae2d918cfb6.tar.gz bcm5719-llvm-be0a5e176b6cadae34b14a7efac7eae2d918cfb6.zip | |
InstrProf: Reorganize files; no functionality change
Move functions around to prepare for some other changes.
- Merge InstrProfilingExtras.h with InstrProfiling.h. There's no
benefit to having these split.
- Rename InstrProfilingExtras.c to InstrProfilingFile.c.
- Split actual buffer writing code out of InstrProfiling.c into
InstrProfilingBuffer.c.
- Drive-by corrections of a couple of header comments.
<rdar://problem/15943240>
llvm-svn: 204497
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfiling.h')
| -rw-r--r-- | compiler-rt/lib/profile/InstrProfiling.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/compiler-rt/lib/profile/InstrProfiling.h b/compiler-rt/lib/profile/InstrProfiling.h index 17d3fd42401..d3600accf9f 100644 --- a/compiler-rt/lib/profile/InstrProfiling.h +++ b/compiler-rt/lib/profile/InstrProfiling.h @@ -7,8 +7,10 @@ |* \*===----------------------------------------------------------------------===*/ +#ifndef PROFILE_INSTRPROFILING_H__ +#define PROFILE_INSTRPROFILING_H__ + #include <stdio.h> -#include <stdlib.h> #define I386_FREEBSD (defined(__FreeBSD__) && defined(__i386__)) @@ -40,7 +42,7 @@ typedef struct __llvm_profile_data { uint64_t *const Counters; } __llvm_profile_data; -/* TODO: void __llvm_profile_get_size_for_buffer(void); */ +/* TODO: void __llvm_profile_get_size_for_buffer(void); */ /*! * \brief Write instrumentation data to the given buffer. @@ -57,3 +59,37 @@ const char *__llvm_profile_names_begin(void); const char *__llvm_profile_names_end(void); uint64_t *__llvm_profile_counters_begin(void); uint64_t *__llvm_profile_counters_end(void); + +#define PROFILE_RANGE_SIZE(Range) \ + (__llvm_profile_ ## Range ## _end() - __llvm_profile_ ## Range ## _begin()) + +/*! + * \brief Write instrumentation data to the current file. + * + * Writes to the file with the last name given to \a __llvm_profile_set_filename(), + * or if it hasn't been called, the \c LLVM_PROFILE_FILE environment variable, + * or if that's not set, \c "default.profdata". + */ +int __llvm_profile_write_file(void); + +/*! + * \brief Set the filename for writing instrumentation data. + * + * Sets the filename to be used for subsequent calls to + * \a __llvm_profile_write_file(). + * + * \c Name is not copied, so it must remain valid. Passing NULL resets the + * filename logic to the default behaviour. + */ +void __llvm_profile_set_filename(const char *Name); + +/*! \brief Register to write instrumentation data to file at exit. */ +int __llvm_profile_register_write_file_atexit(void); + +/*! \brief Get the magic token for the file format. */ +uint64_t __llvm_profile_get_magic(void); + +/*! \brief Get the version of the file format. */ +uint64_t __llvm_profile_get_version(void); + +#endif /* PROFILE_INSTRPROFILING_H__ */ |

