示例#1
0
文件: Program.cs 项目: yyjdelete/Tx
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine(
                    @"Usage: SynCtr [option]

Options are:
    Playback   - use Playback to copy ETW events into heap-allocated C# objects, and then Rx query
    Raw        - Rx query on EtwNativeEvent-s, which is lower level in Tx (no copying to typed objects)
    Imperative - use imperative code, over EtwNativeEvent-s
    Unsafe     - use wrapper that accesses data in the ETW buffer by pointer, like TraceEvent
                 note ETW can overwrite these buffers at unpredictable moment");
                return;
            }

            Baseline.StartSession();

            switch (args[0])
            {
            case "Playback":
                ListenWithQuery();
                break;

            case "Raw":
                RxRaw.ListenWintQueryOnEtwNativeEvent();
                break;

            case "Imperative":
                Baseline.ListenWithImperativeCode();
                break;

            case "Unsafe":
                RxRaw.ListenWintUnsafeClass();
                break;

            default:
                throw new Exception("Unknown option " + args[0]);
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine(
                    @"Usage: SynCtr [option]

Options are:
    Playback   - use playback and Rx query
    Raw        - Rx query on EtwNativeEvent-s (co copy to typed objects)
    Imperative - use imperative code, over EtwNativeEvent-s");
                return;
            }

            Baseline.StartSession();

            switch (args[0])
            {
            case "Playback":
                ListenWithQuery();
                break;

            case "Raw":
                RxRaw.ListenWintQueryOnEtwNativeEvent();
                break;

            case "Imperative":
                Baseline.ListenWithImperativeCode();
                break;

            case "Unsafe":
                RxRaw.ListenWintUnsafeClass();
                break;

            default:
                throw new Exception("Unknown option " + args[0]);
            }
        }