summaryrefslogtreecommitdiff
path: root/lib/profile
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-05-20 05:15:42 +0000
committerXinliang David Li <davidxl@google.com>2016-05-20 05:15:42 +0000
commit66836a0621154a301fea7f6efc6a78f23b8de645 (patch)
treea0e97f485225e34f169e5d818d0782c27eedacf4 /lib/profile
parent879099e2a5a07bcda897cdacad2e75d7fd03374b (diff)
[profile] PROF_ERR, PROF_WARN
1) Move common prefix to the macro def 2) Introduced PROF_WARN 3) Make error message unconditionally printed out. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@270185 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile')
-rw-r--r--lib/profile/InstrProfilingFile.c6
-rw-r--r--lib/profile/InstrProfilingPort.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/profile/InstrProfilingFile.c b/lib/profile/InstrProfilingFile.c
index a2057e83a..571195613 100644
--- a/lib/profile/InstrProfilingFile.c
+++ b/lib/profile/InstrProfilingFile.c
@@ -228,13 +228,13 @@ int __llvm_profile_write_file(void) {
GetEnvHook = &getenv;
/* Check the filename. */
if (!__llvm_profile_CurrentFilename) {
- PROF_ERR("LLVM Profile: Failed to write file : %s\n", "Filename not set");
+ PROF_ERR("Failed to write file : %s\n", "Filename not set");
return -1;
}
/* Check if there is llvm/runtime version mismatch. */
if (GET_VERSION(__llvm_profile_get_version()) != INSTR_PROF_RAW_VERSION) {
- PROF_ERR("LLVM Profile: runtime and instrumentation version mismatch : "
+ PROF_ERR("Runtime and instrumentation version mismatch : "
"expected %d, but get %d\n",
INSTR_PROF_RAW_VERSION,
(int)GET_VERSION(__llvm_profile_get_version()));
@@ -244,7 +244,7 @@ int __llvm_profile_write_file(void) {
/* Write the file. */
rc = writeFileWithName(__llvm_profile_CurrentFilename);
if (rc)
- PROF_ERR("LLVM Profile: Failed to write file \"%s\": %s\n",
+ PROF_ERR("Failed to write file \"%s\": %s\n",
__llvm_profile_CurrentFilename, strerror(errno));
return rc;
}
diff --git a/lib/profile/InstrProfilingPort.h b/lib/profile/InstrProfilingPort.h
index aeb0021c6..9ce054efd 100644
--- a/lib/profile/InstrProfilingPort.h
+++ b/lib/profile/InstrProfilingPort.h
@@ -70,8 +70,10 @@
#endif
#define PROF_ERR(Format, ...) \
- if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS")) \
- fprintf(stderr, Format, __VA_ARGS__);
+ fprintf(stderr, "LLVM Profile Error: " Format, __VA_ARGS__);
+
+#define PROF_WARN(Format, ...) \
+ fprintf(stderr, "LLVM Profile Warning: " Format, __VA_ARGS__);
#if defined(__FreeBSD__)