public bool InstrumentClass(string assemblyName, string className) { if (string.IsNullOrEmpty(assemblyName) || string.IsNullOrEmpty(className)) { return(false); } var matchingExclusionFilters = ExclusionFilters.GetMatchingFiltersForAssemblyName(assemblyName); if (matchingExclusionFilters.Any(exclusionFilter => exclusionFilter.ClassName == ".*")) { return(false); } if (matchingExclusionFilters .Where(exclusionFilter => exclusionFilter.ClassName != ".*") .Any(exclusionFilter => exclusionFilter.IsMatchingClassName(className))) { return(false); } var matchingInclusionFilters = InclusionFilters.GetMatchingFiltersForAssemblyName(assemblyName); if (matchingInclusionFilters.Any(inclusionFilter => inclusionFilter.IsMatchingClassName(className))) { return(true); } return(false); }
private bool ExcludeProcessOrAssembly(string processName, string assemblyName, out IList <AssemblyAndClassFilter> matchingExclusionFilters) { matchingExclusionFilters = ExclusionFilters.GetMatchingFiltersForAssemblyName(assemblyName); return(matchingExclusionFilters.Any( exclusionFilter => exclusionFilter.ClassName == ".*" && (exclusionFilter.IsMatchingProcessName(processName)))); }
public bool UseAssembly(string assemblyName) { var matchingExclusionFilters = ExclusionFilters.GetMatchingFiltersForAssemblyName(assemblyName); if (matchingExclusionFilters.Any(exclusionFilter => exclusionFilter.ClassName == ".*")) { return(false); } if (matchingExclusionFilters.Any(exclusionFilter => exclusionFilter.ClassName != ".*")) { return(true); } var matchingInclusionFilters = InclusionFilters.GetMatchingFiltersForAssemblyName(assemblyName); if (matchingInclusionFilters.Any()) { return(true); } return(false); }
/// <summary> /// Decides whether an assembly should be included in the instrumentation /// </summary> /// <param name="processName">The name of the process being profiled</param> /// <param name="assemblyName">the name of the assembly under profile</param> /// <remarks>All assemblies matching either the inclusion or exclusion filter should be included /// as it is the class that is being filtered within these unless the class filter is *</remarks> public bool UseAssembly(string processName, string assemblyName) { processName = Path.GetFileNameWithoutExtension(processName); var matchingExclusionFilters = ExclusionFilters.GetMatchingFiltersForAssemblyName(assemblyName); if (matchingExclusionFilters.Any(exclusionFilter => exclusionFilter.ClassName == ".*" && exclusionFilter.IsMatchingProcessName(processName))) { return(false); } if (matchingExclusionFilters.Any(exclusionFilter => exclusionFilter.ClassName != ".*")) { return(true); } var matchingInclusionFilters = InclusionFilters.GetMatchingFiltersForAssemblyName(assemblyName); if (matchingInclusionFilters.Any()) { return(true); } return(false); }