-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 8176148: Linux RNG perf testing and improvements
+ Enable measurements of Linux RNG system + Make various performance improvements to defer costly calls into JitterEntropy until they are strictly required, and reduce cost of calls when they are made. Related work items: #42441472, #42441492
- Loading branch information
1 parent
2ef5a91
commit 07a5bf9
Showing
15 changed files
with
335 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// rngforkdetection.c | ||
// Defines fork detection functions using getpid system call and a global variable. | ||
// | ||
// Copyright (c) Microsoft Corporation. Licensed under the MIT license. | ||
// | ||
|
||
#include "precomp.h" | ||
#include <unistd.h> | ||
|
||
pid_t g_pid = 0; | ||
|
||
// Sets the initial pid | ||
VOID | ||
SYMCRYPT_CALL | ||
SymCryptRngForkDetectionInit() | ||
{ | ||
g_pid = getpid(); | ||
} | ||
|
||
// Returns true if pid has changed since init or last call | ||
BOOLEAN | ||
SYMCRYPT_CALL | ||
SymCryptRngForkDetect() | ||
{ | ||
BOOLEAN forkDetected = FALSE; | ||
pid_t currPid = getpid(); | ||
|
||
if( currPid != g_pid ) | ||
{ | ||
forkDetected = TRUE; | ||
g_pid = currPid; | ||
} | ||
|
||
return forkDetected; | ||
} |
Oops, something went wrong.