private Expectation(string methodName, Type returnType, IEnumerable <Parameter> parameters, CaptureOptions captureOptions) { _methodName = methodName; _returnType = returnType; _parameters = parameters; Options = captureOptions; }
private IPerMethodAdapter <T> Profile <TReturn> ( Expression <Func <T, TReturn> > target, CaptureOptions captureOptions, Action <CaptureOptions, DateTime, IInvocation> enqueueAction ) { MethodCallExpression expression = null; switch (target.Body) { case MemberExpression memberExpression: Profile(memberExpression, captureOptions, enqueueAction); return(this); case UnaryExpression unaryExpression: expression = unaryExpression.Operand as MethodCallExpression; break; } expression = expression ?? target.Body as MethodCallExpression; Profile(expression, captureOptions, enqueueAction); return(this); }
public IPerMethodAdapter <T> Profile(Expression <Func <T, Task> > target, CaptureOptions captureOptions = CaptureOptions.Default) { return (Profile ( target, captureOptions, BuildDelegateForAsynchronousAction() )); }
public static Expectation FromInvocation(IInvocation invocation, CaptureOptions captureOptions) { return(new Expectation ( invocation.MethodInvocationTarget.Name, invocation.MethodInvocationTarget.ReturnType, invocation.Arguments.Select(Parameter.MatchExact), captureOptions )); }
static int RunOptionsAndReturnExitCode(CaptureOptions options) { InitCamera(); Login(options.IP, options.Port, options.UserName, options.Password); Capture(options.OutFile); Logout(options.IP, options.Port); CleanUpCamera(); StopCloseConsoleOnDebug(); return((int)iLastErr); }
public IPerMethodAdapter <T> Profile(Expression <Action <T> > target, CaptureOptions captureOptions = CaptureOptions.Default) { Profile ( target.Body as MethodCallExpression, captureOptions, BuildDelegateForSynchronousAction() ); return(this); }
// Matching https://github.com/baldurk/renderdoc/blob/master/renderdoc/api/app/renderdoc_app.h public RenderDocManager(string logFilePath = null) { var finalLogFilePath = FindAvailablePath((logFilePath ?? Assembly.GetEntryAssembly().Location)); var reg = Registry.ClassesRoot.OpenSubKey("CLSID\\" + RenderdocClsid + "\\InprocServer32"); if (reg == null) { return; } var path = reg.GetValue(null) != null?reg.GetValue(null).ToString() : null; if (string.IsNullOrEmpty(path) || !File.Exists(path)) { return; } // Preload the library before using the DLLImport var ptr = LoadLibrary(path); if (ptr == IntPtr.Zero) { return; } // Make sure that the code is compatible with the current installed version. if (RENDERDOC_API_VERSION != RENDERDOC_GetAPIVersion()) { return; } RENDERDOC_SetLogFile(finalLogFilePath); var focusToggleKey = KeyButton.eKey_F11; RENDERDOC_SetFocusToggleKeys(ref focusToggleKey, 1); var captureKey = KeyButton.eKey_F12; RENDERDOC_SetCaptureKeys(ref captureKey, 1); var options = new CaptureOptions(); RENDERDOC_SetCaptureOptions(ref options); int socketPort = 0; RENDERDOC_InitRemoteAccess(ref socketPort); //RENDERDOC_MaskOverlayBits() }
// Matching https://github.com/baldurk/renderdoc/blob/master/renderdoc/api/app/renderdoc_app.h public RenderDocManager(string logFilePath = null) { var finalLogFilePath = FindAvailablePath((logFilePath ?? Assembly.GetEntryAssembly().Location)); var reg = Registry.ClassesRoot.OpenSubKey("CLSID\\" + RenderdocClsid + "\\InprocServer32"); if (reg == null) { return; } var path = reg.GetValue(null) != null ? reg.GetValue(null).ToString() : null; if (string.IsNullOrEmpty(path) || !File.Exists(path)) { return; } // Preload the library before using the DLLImport var ptr = LoadLibrary(path); if (ptr == IntPtr.Zero) { return; } // Make sure that the code is compatible with the current installed version. if (RENDERDOC_API_VERSION != RENDERDOC_GetAPIVersion()) { return; } RENDERDOC_SetLogFile(finalLogFilePath); var focusToggleKey = KeyButton.eKey_F11; RENDERDOC_SetFocusToggleKeys(ref focusToggleKey, 1); var captureKey = KeyButton.eKey_F12; RENDERDOC_SetCaptureKeys(ref captureKey, 1); var options = new CaptureOptions(); RENDERDOC_SetCaptureOptions(ref options); int socketPort = 0; RENDERDOC_InitRemoteAccess(ref socketPort); //RENDERDOC_MaskOverlayBits() }
private void Profile ( MemberExpression expression, CaptureOptions captureOptions, Action <CaptureOptions, DateTime, IInvocation> enqueueAction ) { Expectations .Add ( ( Expectation .FromMemberAccessExpression ( expression, captureOptions ), enqueueAction ) ); }
internal static ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions options) { if (IsFlowSuppressed()) { return(null); } bool flag = CaptureOptions.None != (options & CaptureOptions.IgnoreSyncCtx); bool flag2 = CaptureOptions.None != (options & CaptureOptions.OptimizeDefaultCase); ExecutionContext executionContextNoCreate = System.Threading.Thread.CurrentThread.GetExecutionContextNoCreate(); System.Security.SecurityContext context2 = System.Security.SecurityContext.Capture(executionContextNoCreate, ref stackMark); System.Threading.HostExecutionContext context3 = HostExecutionContextManager.CaptureHostExecutionContext(); System.Threading.SynchronizationContext context4 = null; if ((executionContextNoCreate != null) && !flag) { context4 = (executionContextNoCreate._syncContext == null) ? null : executionContextNoCreate._syncContext.CreateCopy(); } System.Runtime.Remoting.Messaging.LogicalCallContext context5 = null; if (((executionContextNoCreate != null) && (executionContextNoCreate._logicalCallContext != null)) && executionContextNoCreate.LogicalCallContext.HasInfo) { context5 = (System.Runtime.Remoting.Messaging.LogicalCallContext)executionContextNoCreate.LogicalCallContext.Clone(); } if (((flag2 && (context2 == null)) && ((context3 == null) && (context4 == null))) && ((context5 == null) || !context5.HasInfo)) { return(s_dummyDefaultEC); } ExecutionContext context6 = new ExecutionContext { SecurityContext = context2 }; if (context6.SecurityContext != null) { context6.SecurityContext.ExecutionContext = context6; } context6._hostExecutionContext = context3; context6._syncContext = context4; context6.LogicalCallContext = context5; context6.isNewCapture = true; return(context6); }
internal static ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions options) { if (IsFlowSuppressed()) { return null; } bool flag = CaptureOptions.None != (options & CaptureOptions.IgnoreSyncCtx); bool flag2 = CaptureOptions.None != (options & CaptureOptions.OptimizeDefaultCase); ExecutionContext executionContextNoCreate = System.Threading.Thread.CurrentThread.GetExecutionContextNoCreate(); System.Security.SecurityContext context2 = System.Security.SecurityContext.Capture(executionContextNoCreate, ref stackMark); System.Threading.HostExecutionContext context3 = HostExecutionContextManager.CaptureHostExecutionContext(); System.Threading.SynchronizationContext context4 = null; if ((executionContextNoCreate != null) && !flag) { context4 = (executionContextNoCreate._syncContext == null) ? null : executionContextNoCreate._syncContext.CreateCopy(); } System.Runtime.Remoting.Messaging.LogicalCallContext context5 = null; if (((executionContextNoCreate != null) && (executionContextNoCreate._logicalCallContext != null)) && executionContextNoCreate.LogicalCallContext.HasInfo) { context5 = (System.Runtime.Remoting.Messaging.LogicalCallContext) executionContextNoCreate.LogicalCallContext.Clone(); } if (((flag2 && (context2 == null)) && ((context3 == null) && (context4 == null))) && ((context5 == null) || !context5.HasInfo)) { return s_dummyDefaultEC; } ExecutionContext context6 = new ExecutionContext { SecurityContext = context2 }; if (context6.SecurityContext != null) { context6.SecurityContext.ExecutionContext = context6; } context6._hostExecutionContext = context3; context6._syncContext = context4; context6.LogicalCallContext = context5; context6.isNewCapture = true; return context6; }
private static extern void RENDERDOC_SetCaptureOptions(ref CaptureOptions opts);
public static Expectation FromMethodCallExpression(MethodCallExpression expression, CaptureOptions captureOptions) { return(new Expectation ( expression.Method.Name, expression.Method.ReturnType, expression.Arguments.Select(ToParameter).ToArray(), captureOptions )); }
private static extern void RENDERDOC_SetCaptureOptions(ref CaptureOptions opts);
public static Expectation FromMemberAccessExpression(MemberExpression expression, CaptureOptions captureOptions) { var propertyInfo = (PropertyInfo)expression.Member; return(new Expectation ( propertyInfo.GetMethod.Name, propertyInfo.PropertyType, new List <Parameter>(), captureOptions )); }
[System.Security.SecurityCritical] // auto-generated static internal ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions options) { ExecutionContext.Reader ecCurrent = Thread.CurrentThread.GetExecutionContextReader(); // check to see if Flow is suppressed if (ecCurrent.IsFlowSuppressed) return null; // // Attempt to capture context. There may be nothing to capture... // #if FEATURE_IMPERSONATION || FEATURE_COMPRESSEDSTACK // capture the security context SecurityContext secCtxNew = SecurityContext.Capture(ecCurrent, ref stackMark); #endif // #if FEATURE_IMPERSONATION || FEATURE_COMPRESSEDSTACK #if FEATURE_CAS_POLICY // capture the host execution context HostExecutionContext hostCtxNew = HostExecutionContextManager.CaptureHostExecutionContext(); #endif // FEATURE_CAS_POLICY #if FEATURE_SYNCHRONIZATIONCONTEXT SynchronizationContext syncCtxNew = null; #endif LogicalCallContext logCtxNew = null; if (!ecCurrent.IsNull) { // capture the [....] context if (0 == (options & CaptureOptions.IgnoreSyncCtx)) syncCtxNew = (ecCurrent.SynchronizationContext == null) ? null : ecCurrent.SynchronizationContext.CreateCopy(); #endif // #if FEATURE_SYNCHRONIZATIONCONTEXT // copy over the Logical Call Context if (ecCurrent.LogicalCallContext.HasInfo) logCtxNew = ecCurrent.LogicalCallContext.Clone(); } // // If we didn't get anything but defaults, and we're allowed to return the // dummy default EC, don't bother allocating a new context. // if (0 != (options & CaptureOptions.OptimizeDefaultCase) && #if FEATURE_IMPERSONATION || FEATURE_COMPRESSEDSTACK secCtxNew == null && #endif #if FEATURE_CAS_POLICY hostCtxNew == null && #endif // FEATURE_CAS_POLICY #if FEATURE_SYNCHRONIZATIONCONTEXT syncCtxNew == null && #endif // #if FEATURE_SYNCHRONIZATIONCONTEXT (logCtxNew == null || !logCtxNew.HasInfo)) { return s_dummyDefaultEC; } // // Allocate the new context, and fill it in. // ExecutionContext ecNew = new ExecutionContext(); #if FEATURE_IMPERSONATION || FEATURE_COMPRESSEDSTACK ecNew.SecurityContext = secCtxNew; if (ecNew.SecurityContext != null) ecNew.SecurityContext.ExecutionContext = ecNew; #endif #if FEATURE_CAS_POLICY ecNew._hostExecutionContext = hostCtxNew; #endif // FEATURE_CAS_POLICY #if FEATURE_SYNCHRONIZATIONCONTEXT ecNew._syncContext = syncCtxNew; #endif // #if FEATURE_SYNCHRONIZATIONCONTEXT ecNew.LogicalCallContext = logCtxNew; ecNew.isNewCapture = true; return ecNew; }
[System.Security.SecurityCritical] // auto-generated static internal ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions options) { ExecutionContext.Reader ecCurrent = Thread.CurrentThread.GetExecutionContextReader(); // check to see if Flow is suppressed if (ecCurrent.IsFlowSuppressed) { return(null); } // // Attempt to capture context. There may be nothing to capture... // #if FEATURE_IMPERSONATION || FEATURE_COMPRESSEDSTACK // capture the security context SecurityContext secCtxNew = SecurityContext.Capture(ecCurrent, ref stackMark); #endif // #if FEATURE_IMPERSONATION || FEATURE_COMPRESSEDSTACK #if FEATURE_CAS_POLICY // capture the host execution context HostExecutionContext hostCtxNew = HostExecutionContextManager.CaptureHostExecutionContext(); #endif // FEATURE_CAS_POLICY #if FEATURE_SYNCHRONIZATIONCONTEXT SynchronizationContext syncCtxNew = null; #endif LogicalCallContext logCtxNew = null; if (!ecCurrent.IsNull) { #if FEATURE_SYNCHRONIZATIONCONTEXT // capture the [....] context if (0 == (options & CaptureOptions.IgnoreSyncCtx)) { syncCtxNew = (ecCurrent.SynchronizationContext == null) ? null : ecCurrent.SynchronizationContext.CreateCopy(); } #endif // #if FEATURE_SYNCHRONIZATIONCONTEXT // copy over the Logical Call Context if (ecCurrent.LogicalCallContext.HasInfo) { logCtxNew = ecCurrent.LogicalCallContext.Clone(); } } // // If we didn't get anything but defaults, and we're allowed to return the // dummy default EC, don't bother allocating a new context. // if (0 != (options & CaptureOptions.OptimizeDefaultCase) && #if FEATURE_IMPERSONATION || FEATURE_COMPRESSEDSTACK secCtxNew == null && #endif #if FEATURE_CAS_POLICY hostCtxNew == null && #endif // FEATURE_CAS_POLICY #if FEATURE_SYNCHRONIZATIONCONTEXT syncCtxNew == null && #endif // #if FEATURE_SYNCHRONIZATIONCONTEXT (logCtxNew == null || !logCtxNew.HasInfo)) { return(s_dummyDefaultEC); } // // Allocate the new context, and fill it in. // ExecutionContext ecNew = new ExecutionContext(); #if FEATURE_IMPERSONATION || FEATURE_COMPRESSEDSTACK ecNew.SecurityContext = secCtxNew; if (ecNew.SecurityContext != null) { ecNew.SecurityContext.ExecutionContext = ecNew; } #endif #if FEATURE_CAS_POLICY ecNew._hostExecutionContext = hostCtxNew; #endif // FEATURE_CAS_POLICY #if FEATURE_SYNCHRONIZATIONCONTEXT ecNew._syncContext = syncCtxNew; #endif // #if FEATURE_SYNCHRONIZATIONCONTEXT ecNew.LogicalCallContext = logCtxNew; ecNew.isNewCapture = true; return(ecNew); }
internal static ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions options) { return(Capture((options & CaptureOptions.IgnoreSyncCtx) == 0, false)); }
internal static ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions options) { // For References sources compatibility only return(null); }
public UInt32 ExecuteAndInject(string app, string workingDir, string cmdLine, EnvironmentModification[] env, string logfile, CaptureOptions opts) { if (m_Remote == null) { return(StaticExports.ExecuteAndInject(app, workingDir, cmdLine, env, logfile, opts)); } else { UInt32 ret = 0; lock (m_Remote) { ret = m_Remote.ExecuteAndInject(app, workingDir, cmdLine, env, opts); } return(ret); } }
internal static ExecutionContext Capture (ref StackCrawlMark stackMark, CaptureOptions options) { return Capture ((options & CaptureOptions.IgnoreSyncCtx) == 0, false); }
public PerInstanceAdapter(IProcessProfilerEvents eventProcessor, CaptureOptions captureOptions = CaptureOptions.Default) : base(eventProcessor) { _captureOptions = captureOptions; }
internal static ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions captureOptions) { return Capture(); }
internal static ExecutionContext Capture (ref StackCrawlMark stackMark, CaptureOptions options) { // For References sources compatibility only return null; }
internal static ExecutionContext Capture(ref StackCrawlMark stackMark, CaptureOptions captureOptions) { return(Capture()); }
public IPerMethodAdapter <T> Profile <TReturn>(Expression <Func <T, TReturn> > target, CaptureOptions captureOptions = CaptureOptions.Default) { return (Profile ( target, captureOptions, BuildDelegateForSynchronousFunc() )); }