<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Use string configuration options to configure logging modes"
   href="https://bugs.llvm.org/show_bug.cgi?id=36790">36790</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Use string configuration options to configure logging modes
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>XRay
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Runtime
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dberris@google.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>dberris@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently, the xray runtime implementations use a brittle struct-based
configuration system for controlling the options available to a particular
mode. This doesn't scale well and is hard to control dynamically.

Ideally we should be using the flag parsing mechanisms already in the
sanitizer_common library, so that all logging modes should just be configurable
using strings that get parsed as flags. This also allows for easily configuring
these at runtime.

Proposed steps for implementing this change:

1) Implement an alternative means of initialising logging implementations. Call
the function something like `__xray_log_configure_mode(const char* mode, const
char *options, size_t size)`.

2) Allow logging modes to install a configuration handler, different from the
initialisation handler.

Optional steps:

3) Deprecate the initialisation handler registration/API (i.e. mark
`__xray_log_init(...)` as deprecated).

4) Implement an ABI version checker, to prepare for updating the XRayLogImpl
struct (similar to what ASan does).

5) Change the XRayLogImpl struct definition to new layout covering mode
configuration, and in-memory buffer processing.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>