<div dir="ltr">Thanks! I like the wording.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 23, 2016 at 1:08 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: Mon May 23 15:08:58 2016<br>
New Revision: 270483<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=270483&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=270483&view=rev</a><br>
Log:<br>
[profile] clean up runtime warnings.<br>
<br>
 o make warning message more meaningful to users.<br>
 o add suggestion to fix the problem<br>
 o limit the max number of output.<br>
<br>
<br>
<br>
Modified:<br>
    compiler-rt/trunk/lib/profile/InstrProfilingValue.c<br>
<br>
Modified: compiler-rt/trunk/lib/profile/InstrProfilingValue.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingValue.c?rev=270483&r1=270482&r2=270483&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingValue.c?rev=270483&r1=270482&r2=270483&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/profile/InstrProfilingValue.c (original)<br>
+++ compiler-rt/trunk/lib/profile/InstrProfilingValue.c Mon May 23 15:08:58 2016<br>
@@ -71,6 +71,8 @@ __llvm_get_function_addr(const __llvm_pr<br>
  */<br>
<br>
 static int hasStaticCounters = 1;<br>
+static int OutOfNodesWarnings = 0;<br>
+#define MAX_VP_WARNS 10<br>
<br>
 static int allocateValueProfileCounters(__llvm_profile_data *Data) {<br>
   uint64_t NumVSites = 0;<br>
@@ -102,9 +104,11 @@ static ValueProfNode *allocateOneNode(__<br>
     return (ValueProfNode *)calloc(1, sizeof(ValueProfNode));<br>
<br>
   Node = COMPILER_RT_PTR_FETCH_ADD(ValueProfNode, CurrentVNode, 1);<br>
-  if (Node >= EndVNode) {<br>
-    PROF_WARN("Running out of nodes: site_%d@func_%" PRIu64<br>
-              ", value=%" PRIu64 " \n", Index, Data->NameRef, Value);<br>
+  if (Node >= EndVNode && (OutOfNodesWarnings ++ < MAX_VP_WARNS)) {<br>
+    PROF_WARN("Unable to track new values: %s. "<br>
+              " Consider using option -mllvm -vp-counters-per-site=<n> to allocate more"<br>
+              " value profile counters at compile time. \n",<br>
+              "Running out of static counters");<br>
     return 0;<br>
   }<br>
   return Node;<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>