<div dir="ltr">We can simply document it. In other words, user is not expected  to use ":<num>" or ",<num>" as file suffix for profile data.  <div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 11, 2015 at 1:45 PM, Justin Bogner <span dir="ltr"><<a href="mailto:mail@justinbogner.com" target="_blank">mail@justinbogner.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">Xinliang David Li <<a href="mailto:davidxl@google.com">davidxl@google.com</a>> writes:<br>
> On Tue, Nov 10, 2015 at 2:36 PM, Diego Novillo <<a href="mailto:dnovillo@google.com">dnovillo@google.com</a>> wrote:<br>
>> On Tue, Nov 10, 2015 at 3:07 PM, David Li <<a href="mailto:davidxl@google.com">davidxl@google.com</a>> wrote:<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<br>
>>> %p/Inputs/weight-sample-bar.proftext %p/Inputs/weight-sample-foo.proftext<br>
>>> -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>
>>><br>
>><br>
>> But then what happens if one of the files is specified without ":WEIGHT"?<br>
>> Should we complain about it?  Should we assume MAX(other weights)?<br>
><br>
> The default is 1 of course.<br>
><br>
>> I'm not sure I'm completely convinced that file1:W1 file2:W2 is better<br>
>> than --weights=W1,W2.  What if ':' is part of the filename?  I know, seems<br>
>> like a stretch.  I'm not actually arguing against it.  I mostly find it a<br>
>> bit odd.<br>
><br>
> : is just a suggestion, you can use coma to separate it.<br>
><br>
> pros:<br>
><br>
> 1) the weight and file name are always 'together'. Think about a long list<br>
> of files -- having a separate list option make it harder to associate and<br>
> and  can not really skip the default weight of 1, e.g<br>
> -W10,1,1,1,1,1,1,1,1,1,20<br>
> 2) there is no need for an additional option<br>
> 3) the implementation is simpler and requires fewer code.<br>
><br>
> cons:<br>
> I don't see any real cons -- except that you find it weird -- but why?<br>
<br>
</div></div>The biggest con is probably ambiguity. Using a comma isn't really any<br>
better than using a colon here, both are perfectly valid in filenames.<br>
I guess it's probably not likely that anyone has a file named foo and a<br>
file named foo:10 and wants to use foo with a weight of 10, but the code<br>
will certainly have to deal with that case if we're attaching the<br>
weights to the filenames.<br>
</blockquote></div><br></div>