<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 10, 2015 at 2:36 PM, Diego Novillo <span dir="ltr"><<a href="mailto:dnovillo@google.com" target="_blank">dnovillo@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Nov 10, 2015 at 3:07 PM, David Li <span dir="ltr"><<a href="mailto:davidxl@google.com" target="_blank">davidxl@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
================<br>
Comment at: test/tools/llvm-profdata/weight-sample.test:42<br>
@@ +41,3 @@<br>
+3- Bad merge: foo and bar profiles with too few weight values<br>
+RUN: not llvm-profdata merge --sample --text -weights=2 %p/Inputs/weight-sample-bar.proftext %p/Inputs/weight-sample-foo.proftext -o %t.out 2>&1 | FileCheck %s --check-prefix=ERROR1<br>
+ERROR1: error: Profile weight must be specified for each input file.<br>
----------------<br>
No need for such tests if the weight is always attached to the input file.<br></blockquote><div><br></div></span><div>But then what happens if one of the files is specified without ":WEIGHT"?  Should we complain about it?  Should we assume MAX(other weights)?</div></div></div></div></blockquote><div><br></div><div>The default is 1 of course.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>I'm not sure I'm completely convinced that file1:W1 file2:W2 is better than --weights=W1,W2.  What if ':' is part of the filename?  I know, seems like a stretch.  I'm not actually arguing against it.  I mostly find it a bit odd.</div></div></div></div></blockquote><div><br></div><div>: is just a suggestion, you can use coma to separate it.</div><div><br></div><div><br></div><div>pros:</div><div><br></div><div>1) the weight and file name are always 'together'. Think about a long list of files -- having a separate list option make it harder to associate and and  can not really skip the default weight of 1, e.g -W10,1,1,1,1,1,1,1,1,1,20</div><div>2) there is no need for an additional option</div><div>3) the implementation is simpler and requires fewer code.</div><div><br></div><div>cons:</div><div>I don't see any real cons -- except that you find it weird -- but why?</div><div><br></div><div>David</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="HOEnZb"><font color="#888888"><div></div></font></span></div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br></div><div class="gmail_extra">Diego.</div></font></span></div>
</blockquote></div><br></div></div>