Skip to content

Instantly share code, notes, and snippets.

@jdu2600
Created July 26, 2019 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdu2600/a0898230dcb212c5e670a4d6fc0c4ad7 to your computer and use it in GitHub Desktop.
Save jdu2600/a0898230dcb212c5e670a4d6fc0c4ad7 to your computer and use it in GitHub Desktop.
ETW SysCallAddress and ProcessorNumber
using System;
using Microsoft.Diagnostics.Tracing.Session;
using Microsoft.Diagnostics.Tracing.Parsers.Kernel;
using Microsoft.Diagnostics.Tracing.Parsers;
namespace SysCallAddress
{
class Program
{
static void Main(string[] args)
{
var session = new TraceEventSession("SysCallAddress");
session.EnableKernelProvider(KernelTraceEventParser.Keywords.SystemCall);
session.Source.Kernel.PerfInfoSysClEnter += delegate (SysCallEnterTraceData data)
{
Console.WriteLine("ProcessorNumber:{0} SysCallAddress:0x{1:X}", data.ProcessorNumber, data.SysCallAddress);
};
session.Source.Process();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment