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

    <tr>
        <th>Summary</th>
        <td>
            Extracting multiple `.fdata` files at once with `perf2bolt`
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          ljgermain
      </td>
    </tr>
</table>

<pre>
    Is it possible to extract multiple `.fdata` files from a single `.data` performance profile with `perf2bolt` at once? In my current workflow, I have to run `perf2bolt` for every library in a profile that I want to optimize, but this doesn't reuse the performance events gathered for the previous iterations and has to restart the gathering from the very beginning each time.

This seems unnecessarily inefficient, since it should be entirely theoretically possible for data to be gathered and processed for multiple libraries at once in one invocation. It also probably wears out my SSD, since I gather really large profiles with branch-sampling and `perf2bolt` fills up `/tmp` on every iteration of processing.

I'm not sure if a way to do this exists already or not, but if it doesn't this is what I propose more concretely:

Turning this (N steps of performance event gathering, for each file; scales terribly): `perf2bolt -p=foo.data bar.so -o bar.fdata && perf2bolt -p=baz.data biz.so -o biz.fdata`

Into this (One step of performance event gathering, for all files; scales really well): `perf2bolt -p=foo.data bar.so,baz.so -o bar.fdata,baz.fdata`

The final syntax may be different, this is just an illustration (paths are allowed to contain commas).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMVU1v4zgM_TXKhWjgKB-NDz50phsgl93DzB-gbTpWV5YMkU7q_voFHSfZdhaLOdmQSPG9xycKmd0pEBVm-81sXxc4SBtT4d9OlDp0YVHGeiyODE6gj8yu9AQSgd4lYSXQDV5c7wnMLls2NQqaXQaN88TQpNgBArtwmgNu-z2lJqYOQ0XQp6jhcHHSapDu2TJ60UAUiKEisz7AMUA3QjWkREHgEtPfjY8XY7_DEVo8T6jSEH45ookJ6ExpBO_KhGkEFwDvZaVFgSNcMIieEHtxnfsgPbccBKR1DHUkD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