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

    <tr>
        <th>Summary</th>
        <td>
            llvm-profdata should show more detailed error message.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm-tools
      </td>
    </tr>

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

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

<pre>
    If an error encountered when merging raw profile, it doesn't give more details than it should.
```
$ llvm-profdata merge -sparse base_unittests.profraw -o base_unittests.profdata
warning: base_unittests.profraw: malformed instrumentation profile data
error: no profile can be merged
```
By looking at the code, there are many places error `instrprof_error::malformed` is created with different error messages (e.g. number of value profile kinds is invalid", "function name is empty", etc), but llvm-profdata doesn't show the detailed error message.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1kttu2zAMhp_GvhFiKLIdNxe-aFcM2BMM2E1BW7StTYdMhwR5-1F2mq5bC8iwBIoff_7i4OS1_zYxsAy9d56hHV2yET1KdlnQMoN-VnZmHi7s5N2kNBbiC1ORSYfBFqKLbFZnZMZ5ZBIjKB1YXIhId8LikpZVwZ8L_lgc-G1tR9Ewrc9ml7ESIqy1kO3CCXxANkDAl2RVjBhiqPKtLGLnPork_A17AW9JcFE_fkLIEQN6ct5Qk8qG6JNBGyEqZ197ZG_A1ZicZN09OlJ7A26C5YfdPV2Zdu5Xtg4i-UE5Tq7W0Z6cAvoM2Cs7aRgx3Oyn9FVQrvPyWpjWXS9dYCqw0SPE_EQqLkyqaSKkjTeIwRBgJmYhHrCaK2aTGdAzN7Ez6IT3LkidDBmnLAWULITIAuk3JTuudlgwmG-gOcXrLY5xLMQx74YU_3nCt6Ggp7-sfW8zQWLfqatK7PeHA--6rqmbUva1PNZHKKOKGvv30G2KNuJfY_Y_MnndLzGeQnZNfKU1k0FpqEZn6JCpt1-G_8Qx0lGFkDDQpu0Er8ulr_cTdnLcj2LqsOl4PR0bydsHaHnTtrIrNQyoQ1-0T-TISovO6ZDtaZ9L1QsuBH_Yd6LmddtUU7dvAMSh4XsxdJIXDUdD-qucWjk_l35reEhzoKBWeVrvQQhBzRZxrUd8SHFxvv-BvxPY76lc9fer-D_eKUko">