<div dir="ltr">Thanks.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 19, 2016 at 10:15 PM, Xinliang David Li via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davidxl<br>
Date: Fri May 20 00:15:42 2016<br>
New Revision: 270185<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=270185&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=270185&view=rev</a><br>
Log:<br>
[profile] PROF_ERR, PROF_WARN<br>
<br>
1) Move common prefix to the macro def<br>
2) Introduced PROF_WARN<br>
3) Make error message unconditionally printed out.<br>
<br>
<br>
Modified:<br>
compiler-rt/trunk/lib/profile/InstrProfilingFile.c<br>
compiler-rt/trunk/lib/profile/InstrProfilingPort.h<br>
compiler-rt/trunk/test/profile/instrprof-error.c<br>
compiler-rt/trunk/test/profile/instrprof-version-mismatch.c<br>
<br>
Modified: compiler-rt/trunk/lib/profile/InstrProfilingFile.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=270185&r1=270184&r2=270185&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=270185&r1=270184&r2=270185&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/profile/InstrProfilingFile.c (original)<br>
+++ compiler-rt/trunk/lib/profile/InstrProfilingFile.c Fri May 20 00:15:42 2016<br>
@@ -228,13 +228,13 @@ int __llvm_profile_write_file(void) {<br>
GetEnvHook = &getenv;<br>
/* Check the filename. */<br>
if (!__llvm_profile_CurrentFilename) {<br>
- PROF_ERR("LLVM Profile: Failed to write file : %s\n", "Filename not set");<br>
+ PROF_ERR("Failed to write file : %s\n", "Filename not set");<br>
return -1;<br>
}<br>
<br>
/* Check if there is llvm/runtime version mismatch. */<br>
if (GET_VERSION(__llvm_profile_get_version()) != INSTR_PROF_RAW_VERSION) {<br>
- PROF_ERR("LLVM Profile: runtime and instrumentation version mismatch : "<br>
+ PROF_ERR("Runtime and instrumentation version mismatch : "<br>
"expected %d, but get %d\n",<br>
INSTR_PROF_RAW_VERSION,<br>
(int)GET_VERSION(__llvm_profile_get_version()));<br>
@@ -244,7 +244,7 @@ int __llvm_profile_write_file(void) {<br>
/* Write the file. */<br>
rc = writeFileWithName(__llvm_profile_CurrentFilename);<br>
if (rc)<br>
- PROF_ERR("LLVM Profile: Failed to write file \"%s\": %s\n",<br>
+ PROF_ERR("Failed to write file \"%s\": %s\n",<br>
__llvm_profile_CurrentFilename, strerror(errno));<br>
return rc;<br>
}<br>
<br>
Modified: compiler-rt/trunk/lib/profile/InstrProfilingPort.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPort.h?rev=270185&r1=270184&r2=270185&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPort.h?rev=270185&r1=270184&r2=270185&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/profile/InstrProfilingPort.h (original)<br>
+++ compiler-rt/trunk/lib/profile/InstrProfilingPort.h Fri May 20 00:15:42 2016<br>
@@ -70,8 +70,10 @@<br>
#endif<br>
<br>
#define PROF_ERR(Format, ...) \<br>
- if (GetEnvHook && GetEnvHook("LLVM_PROFILE_VERBOSE_ERRORS")) \<br>
- fprintf(stderr, Format, __VA_ARGS__);<br>
+ fprintf(stderr, "LLVM Profile Error: " Format, __VA_ARGS__);<br>
+<br>
+#define PROF_WARN(Format, ...) \<br>
+ fprintf(stderr, "LLVM Profile Warning: " Format, __VA_ARGS__);<br>
<br>
#if defined(__FreeBSD__)<br>
<br>
<br>
Modified: compiler-rt/trunk/test/profile/instrprof-error.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-error.c?rev=270185&r1=270184&r2=270185&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-error.c?rev=270185&r1=270184&r2=270185&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/profile/instrprof-error.c (original)<br>
+++ compiler-rt/trunk/test/profile/instrprof-error.c Fri May 20 00:15:42 2016<br>
@@ -1,9 +1,9 @@<br>
// RUN: %clang_profgen -o %t -O3 %s<br>
-// RUN: env LLVM_PROFILE_FILE=%t/ LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s<br>
+// RUN: env LLVM_PROFILE_FILE=%t/ %run %t 1 2>&1 | FileCheck %s<br>
<br>
int main(int argc, const char *argv[]) {<br>
if (argc < 2)<br>
return 1;<br>
return 0;<br>
}<br>
-// CHECK: LLVM Profile: Failed to write file<br>
+// CHECK: LLVM Profile Error: Failed to write file<br>
<br>
Modified: compiler-rt/trunk/test/profile/instrprof-version-mismatch.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-version-mismatch.c?rev=270185&r1=270184&r2=270185&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-version-mismatch.c?rev=270185&r1=270184&r2=270185&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/profile/instrprof-version-mismatch.c (original)<br>
+++ compiler-rt/trunk/test/profile/instrprof-version-mismatch.c Fri May 20 00:15:42 2016<br>
@@ -1,5 +1,5 @@<br>
// RUN: %clang_profgen -o %t -O3 %s<br>
-// RUN: env LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s<br>
+// RUN: %run %t 1 2>&1 | FileCheck %s<br>
<br>
// override the version variable with a bogus version:<br>
unsigned long long __llvm_profile_raw_version = 10000;<br>
@@ -8,4 +8,4 @@ int main(int argc, const char *argv[]) {<br>
return 1;<br>
return 0;<br>
}<br>
-// CHECK: LLVM Profile: runtime and instrumentation version mismatch<br>
+// CHECK: LLVM Profile Error: Runtime and instrumentation version mismatch<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>