[Analyzer Proposal]: Check for correct event ID passed to `EventSource.WriteEvent` based on the `System.Diagnostics.Tracing.EventAttribute`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 47/100
Línea de trabajo
Read the EventSource validation path in src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs, especially the method linked in the issue, and examine existing Roslyn analyzer patterns in the repository. Determine how to validate that WriteEvent receives the ID declared by EventAttribute, then define completion as covering the proposed analyzer and removing the runtime IL inspection. The issue does not name analyzer files or tests, so locate those before estimating the implementation.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Today, EventSource does a best effort check at runtime (by inspecting the IL body of the method) that event methods of the following shape pass the matching event ID to their attribute:
[Event(1)]
public void OnInterestingEvent()
{
if (IsEnabled()) { WriteEvent(1,...); }
}
This means that we're inspecting the IL body of each method on event source enablement:
This also means that we carry this around in all of our apps if any event source format is supported (ETW, eventpipe, etc).
I propose that we move this validation into an analyzer and remove it from the runtime validation. Since it's already best effort, it is a good fit for a Roslyn analyzer.
- Lenguaje dominante
- C#
- Estrellas
- 18.4k
- Forks
- 5.8k
- Merge medio
- 2 d 12 h
- PR fusionados (30 d)
- 581
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotnet/runtime
-
area-System.Collections untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/runtime#137167 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Incorrect loop bound in SizeOptIListSelectIterator.ToListPosiblemente ocupada @equmagg la tomó hace 2 días. Abiertoarea-System.Collections untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
dotnet/runtime#137126 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
DbTransaction.SupportsSavepoints docs say Release/ReleaseAsync are expected to throw, but they are no-ops by designPosiblemente ocupada @alaricd la tomó hace 3 días. Abiertoarea-System.Transactions untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dotnet/runtime#137040 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
FileSystemGlobbing: Matcher throws ArgumentOutOfRangeException when the rootDir is the same value as the filePosiblemente ocupada @makazeu la tomó hace 4 días. Abiertoarea-Extensions-FileSystem
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/runtime#136989 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Configuration binder source generator emits unqualified List<T> when binding arrays without implicit usingsPosiblemente ocupada @makazeu la tomó hace 4 días. Abiertoarea-Extensions-Configuration bug source-generator
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dotnet/runtime#136972 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de dotnet/runtime
Issues similares
-
Assert.That on a null non-generic IEnumerable throws ArgumentNullException, so IsNull() cannot passAbiertobug P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
area/automation area/sdk kind/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
unoplatform/uno.templates#2406 ·
Los mantenedores suelen responder en 1 día
-
bug frontend ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
agentic-workflows
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
documentation trivial
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día