dotnet/runtime · error · Exception

event does not have a symbol

Error message

{eventNode} event does not have a symbol

What it means

Raised by generateLttngHeader() in genLttngProvider.py when iterating over event nodes and an event element lacks a 'symbol' attribute. The symbol attribute names the event and is used to generate the TRACEPOINT_EVENT_INSTANCE macro call. Without it, the generated C code would be invalid.

Solutions

  1. Find the <event> element in the manifest that lacks a 'symbol' attribute (the error shows the DOM element repr which includes line information).
  2. Add a unique symbol attribute to the event element, e.g., symbol="MyNewEvent".
  3. Ensure every <event> element has a non-empty symbol matching the naming convention used by other events.

Example fix

<!-- before: event without symbol -->
<event value="99" level="win:Informational" template="t:MyEvent" />

<!-- after: add symbol attribute -->
<event symbol="MyNewEvent" value="99" level="win:Informational" template="t:MyEvent" />
Defensive patterns

Strategy: validation

Validate before calling

import xml.dom.minidom as DOM

def validate_event_symbols(manifest_path: str) -> list:
    """Return list of event elements missing a symbol attribute."""
    tree = DOM.parse(manifest_path)
    missing = []
    for i, event in enumerate(tree.getElementsByTagName('event')):
        symbol = event.getAttribute('symbol')
        if not symbol:
            missing.append(f"Event #{i} (value={event.getAttribute('value')}) has no symbol attribute")
    return missing

Type guard

null

Try / catch

try:
    generateLttngHeader(providerName, allTemplates, eventNodes, runtimeFlavor)
except Exception as e:
    if 'does not have a symbol' in str(e):
        print(f"Manifest error: an <event> element is missing its 'symbol' attribute.")
        print("Add symbol=\"EventName\" to every <event> element in the manifest.")
    raise

Prevention

When it happens

Trigger: Triggered at line 282-283 when eventNode.getAttribute('symbol') returns an empty/falsy string. The code checks 'if not eventName' and raises with eventNode (the DOM element) as the message prefix. Note: the message formats eventNode directly, which will show the XML element's repr, not a human-readable name — a minor diagnostic weakness.

Common situations: A developer adds an <event> element to the manifest but forgets the symbol attribute. The symbol attribute is present but empty (symbol=""). An XML editing error or merge conflict drops the attribute.

Related errors


AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10). Data as JSON: /api/errors/cef897c01a15541b. Report an issue: GitHub.

Appendix: source

Thrown at src/coreclr/scripts/genLttngProvider.py:283

#define T_TRACEPOINT_INSTANCE(name) \\
TRACEPOINT_EVENT_INSTANCE(\\
""")
    lTTngHdr.append("    " + providerName + ",\\\n")
    lTTngHdr.append("    emptyTemplate,\\\n")

    lTTngHdr.append("""    name ,\\
    TP_ARGS()\\
)""")
#end of empty template
# create the event instance in headers
    lTTngHdr.append("\n")

    for eventNode in eventNodes:
        eventName    = eventNode.getAttribute('symbol');
        templateName = eventNode.getAttribute('template');

        if not eventName :
            raise Exception(eventNode + " event does not have a symbol")
        if not templateName:
            lTTngHdr.append("T_TRACEPOINT_INSTANCE(")
            lTTngHdr.append(eventName +")\n")
            continue

        subevent = templateName.replace(templateName,'')
        lTTngHdr.append(templateName)
        lTTngHdr.append("T_TRACEPOINT_INSTANCE(")
        lTTngHdr.append(eventName + subevent + ")\n")

    lTTngHdr.append("\n#endif /* LTTNG_CORECLR_H")
    lTTngHdr.append(providerName + " */\n")
    lTTngHdr.append("#include <lttng/tracepoint-event.h>")

    return ''.join(lTTngHdr)


def generateMethodBody(template, providerName, eventName, runtimeFlavor):

View on GitHub (pinned to 60108ba66e)