{"record":{"id":"cef897c01a15541b","repo":"dotnet/runtime","slug":"eventnode-event-does-not-have-a-symbol","errorCode":null,"errorMessage":"{eventNode} event does not have a symbol","messagePattern":"(.+?) event does not have a symbol","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/coreclr/scripts/genLttngProvider.py","lineNumber":283,"sourceCode":"#define T_TRACEPOINT_INSTANCE(name) \\\\\nTRACEPOINT_EVENT_INSTANCE(\\\\\n\"\"\")\n    lTTngHdr.append(\"    \" + providerName + \",\\\\\\n\")\n    lTTngHdr.append(\"    emptyTemplate,\\\\\\n\")\n\n    lTTngHdr.append(\"\"\"    name ,\\\\\n    TP_ARGS()\\\\\n)\"\"\")\n#end of empty template\n# create the event instance in headers\n    lTTngHdr.append(\"\\n\")\n\n    for eventNode in eventNodes:\n        eventName    = eventNode.getAttribute('symbol');\n        templateName = eventNode.getAttribute('template');\n\n        if not eventName :\n            raise Exception(eventNode + \" event does not have a symbol\")\n        if not templateName:\n            lTTngHdr.append(\"T_TRACEPOINT_INSTANCE(\")\n            lTTngHdr.append(eventName +\")\\n\")\n            continue\n\n        subevent = templateName.replace(templateName,'')\n        lTTngHdr.append(templateName)\n        lTTngHdr.append(\"T_TRACEPOINT_INSTANCE(\")\n        lTTngHdr.append(eventName + subevent + \")\\n\")\n\n    lTTngHdr.append(\"\\n#endif /* LTTNG_CORECLR_H\")\n    lTTngHdr.append(providerName + \" */\\n\")\n    lTTngHdr.append(\"#include <lttng/tracepoint-event.h>\")\n\n    return ''.join(lTTngHdr)\n\n\ndef generateMethodBody(template, providerName, eventName, runtimeFlavor):","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/coreclr/scripts/genLttngProvider.py#L265-L301","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Find the <event> element in the manifest that lacks a 'symbol' attribute (the error shows the DOM element repr which includes line information).","Add a unique symbol attribute to the event element, e.g., symbol=\"MyNewEvent\".","Ensure every <event> element has a non-empty symbol matching the naming convention used by other events."],"exampleFix":"<!-- before: event without symbol -->\n<event value=\"99\" level=\"win:Informational\" template=\"t:MyEvent\" />\n\n<!-- after: add symbol attribute -->\n<event symbol=\"MyNewEvent\" value=\"99\" level=\"win:Informational\" template=\"t:MyEvent\" />","handlingStrategy":"validation","validationCode":"import xml.dom.minidom as DOM\n\ndef validate_event_symbols(manifest_path: str) -> list:\n    \"\"\"Return list of event elements missing a symbol attribute.\"\"\"\n    tree = DOM.parse(manifest_path)\n    missing = []\n    for i, event in enumerate(tree.getElementsByTagName('event')):\n        symbol = event.getAttribute('symbol')\n        if not symbol:\n            missing.append(f\"Event #{i} (value={event.getAttribute('value')}) has no symbol attribute\")\n    return missing","typeGuard":"null","tryCatchPattern":"try:\n    generateLttngHeader(providerName, allTemplates, eventNodes, runtimeFlavor)\nexcept Exception as e:\n    if 'does not have a symbol' in str(e):\n        print(f\"Manifest error: an <event> element is missing its 'symbol' attribute.\")\n        print(\"Add symbol=\\\"EventName\\\" to every <event> element in the manifest.\")\n    raise","preventionTips":["Always include a non-empty 'symbol' attribute on every <event> element.","Add an XML schema check for required attributes before code generation.","Use consistent naming conventions for event symbols.","Validate the manifest with an XML linter that checks for required attributes."],"tags":["lttng","etw","manifest","eventing","coreclr"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}