Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling multithread analysis #495

Merged
merged 3 commits into from
Oct 11, 2021

Conversation

eddynaka
Copy link
Contributor

@eddynaka eddynaka commented Sep 30, 2021

In this change I'm enabling multithreading analysis, updating sarif-sdk submodules to the latest version, which contains the relevant changes to enable multithreading + hashing.

The multithreading starts reading files as an IEnumerable and adds those files to the processing channels.
If hashing is enabled, it would prevent doing the same analysis twice.

@eddynaka eddynaka marked this pull request as ready for review October 8, 2021 14:01
@@ -153,7 +153,7 @@ private AnalysisSummary ExtractAnalysisSummary(SarifLog sarifLog, AnalyzeOptions
NormalizedPath = string.Join(";", options.TargetFileSpecifiers.Select(p => System.IO.Path.GetDirectoryName(p)).Distinct()),
SymbolPath = options.SymbolsPath,
FileAnalyzed = artifacts.Count,
// FileNotAnalyzed =
// FileNotAnalyzed =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// FileNotAnalyzed =

do we want to keep this line

PropertiesDictionary configData = policy.GetProperty(MitigatedCompilers);
foreach (string key in configData.Keys)
{
var machine = (MachineFamily)Enum.Parse(typeof(MachineFamily), key); // Neaten this up.
compilerData.Add(machine, CreateSortedVersionDictionary((PropertiesDictionary)configData[key]));
compilerData.TryAdd(machine, CreateSortedVersionDictionary((PropertiesDictionary)configData[key]));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TryAdd

do we need AddOrUpdate()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think so.

Once the first thread or first analysis pass in the compilerData, the object would not be null and that path wouldn't pass anymore.

Copy link
Collaborator

@shaopeng-gh shaopeng-gh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@eddynaka eddynaka merged commit 9051841 into main Oct 11, 2021
@eddynaka eddynaka deleted the users/ednakamu/enabling-multithread-analysis branch October 11, 2021 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants