<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/87447>87447</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Bug] llvm-cov export dooes not respect SOURCES filter
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          zilun-wang
      </td>
    </tr>
</table>

<pre>
    I am using LLVM version 18.0.0 on the Debian system. 
I was trying to use llvm-cov to export the coverage report for chromium. Considering that the project is huge and I only need to get coverage reports for specific directories, I used the SOURCES filter in my command. 
However, I found the filter doesn't work. 

The command I used is as follows:
`llvm-cov export --format=lcov --instr-profile=[PathToProfdata] [PathToBinary] [PathOfSources]`
I also used `--dump-collected-paths` to ensure the [PathOfSources] is correct and indeed found.
But when I ran the command, I got a lcov report of all the source files, which should not happen.

In addition, I also tried using text (json) format. But the condition is even worse; the process consumed too much memory and finally got stuck. 
My PC has 32GB RAM and 50GB swap space, which are all consumed. So I believe llvm-cov export doesn't respect the SOURCES filter for both json and lcov formats.

P.S. I understand that the document requires to use `--sources=[PathOfSources]` to define the SOURCES. But I tried both, and they all didn't work. And I found when using `--sources=[PathOfSources]`, the `--dump-collected-paths` option cannot identify the [PathOfSources].

I have been stuck on this problem for several days, but I still cannot address it. Although I found some previous related issues  (#54769 and #54806) , they seem not clearly explained or addressed. 

Look forward for your feedback.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVVuP2zYT_TX0y8CCLMm3Bz-s19_mM5BFFtm07xQ5kpilOCovdtRfX5CS95KmRV9siOBczplzhtw51RrEA1sf2fq04MF3ZA9_Kh3M8spNu6hJjocz8B6CU6aFz59_f4QLWqfIwGqX5VkOZMB3CCesFTfgRuexz4DlJ5bfneHKHXg7xmBPEByC1pd-KegSv_HHQNaneEEXtLxFsJjOGrIgOku9Cn0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