Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
4817 commits
Select commit Hold shift + click to select a range
70999d8
[wasm] add new interop to the console template (#72375)
alinpahontu2912 Jul 21, 2022
e092687
Fix x86 GCStress race with indirect calls before epilogs (#72592)
jakobbotsch Jul 21, 2022
6ac841d
Fix minor triple slash comment (#72569)
tarekgh Jul 21, 2022
ed5080a
Fix accidentally removed Add in TypeSpec.AddModifier (#72605)
stephentoub Jul 21, 2022
6c33d4f
Fix TwoServerInstances_OnceDisposed_Throws test for non-overlapped I/…
stephentoub Jul 21, 2022
c2f07f6
Improve RegexCharClass.Analyze for sets with subtraction (#72328)
stephentoub Jul 21, 2022
0b1c61e
Disable NamedPipeTest_ServerInOut_ClientInOut_Synchronous test config…
stephentoub Jul 21, 2022
5b8d9eb
Sleep infinitely on secondary crashing threads (#72618)
jkotas Jul 21, 2022
5044106
Assert compiler diagnostics in UpgradeToRegexGeneratorAnalyzerTests a…
Youssef1313 Jul 21, 2022
0a7d601
Add ease of use helpers in X.509
bartonjs Jul 21, 2022
d700ce9
[wasm] bump npm packages, fix lint errors (#72600)
pavelsavara Jul 21, 2022
f7d7b55
[RateLimiting] Fix test race with timer (#72118)
BrennanConroy Jul 21, 2022
c895d95
[mono] Pass the pending exception correctly from interp_runtime_invok…
vargaz Jul 21, 2022
24f3234
Allow not finding attribute data for more cases that we don't care ab…
jkoritzinsky Jul 21, 2022
bac2229
Avoid AsyncLocal read in Activity.set_Current when CurrentChanged isn…
stephentoub Jul 21, 2022
2f02f12
Support for RequiresAttributeMismatch testing (#72496)
tlakollo Jul 21, 2022
cd24e18
Clarified documentation regarding building the Core_Root. (#72560)
ivdiazsa Jul 21, 2022
63692cd
Revert "Always use live host (#71725)" (#72628)
agocke Jul 21, 2022
5b0baa9
[mono][aot] Pass -mattr=crc32 to opt/llc when sse4.2 is enabled and u…
vargaz Jul 21, 2022
b2e1633
[main] Update dependencies from dotnet/arcade (#72178)
dotnet-maestro[bot] Jul 21, 2022
743f083
Sync shared code from aspnetcore (#72588)
github-actions[bot] Jul 21, 2022
746fc5f
[mono][aot] Don't fail AOT for methods referencing fnptr classes. (#7…
vargaz Jul 21, 2022
a8ef21c
Disable NoStapledOcsp test on Debian 10 for now. (#72634)
bartonjs Jul 22, 2022
0e7432f
amend the LoongArch64-ABI for GCstress and NullableObject. (#72573)
shushanhf Jul 22, 2022
44be09d
Clear list in Enumerable.Chunk prior to yielding (#72637)
stephentoub Jul 22, 2022
c0b9416
Correct nullable annotation on ICustomTypeDescriptor.GetConverter (#7…
eerhardt Jul 22, 2022
8d5c303
Port the doc changes to source (#72638)
tarekgh Jul 22, 2022
4cadf9a
[wasm] Return int from console template (#72623)
radekdoulik Jul 22, 2022
20dd6ea
Add GCDescs in front of MethodTable to dumps (#72658)
Jul 22, 2022
d5d9d52
Fix HttpConnectionPool timers race on disposal (#72615)
CarnaViire Jul 22, 2022
0c32267
Fixes overwrite of last captured managed stack frame address in Event…
lateralusX Jul 22, 2022
a5e678d
Simplify AppModel addToProject settings (#72072)
agocke Jul 22, 2022
ea2c907
Additional tests for Generics in System.Text.Json.SourceGeneration (#…
pos777 Jul 22, 2022
cbe29e8
Fix #72614. (#72630)
eiriktsarpalis Jul 22, 2022
ed5aa3d
[QUIC] Support for OpenSSL build of MsQuic on Windows (Attempt 2) (#7…
rzikm Jul 22, 2022
db6cf45
Fix potential out-of-bounds array accesses in System.Data.Operators (…
stephentoub Jul 22, 2022
e1764aa
Templates outputs ejs instead of cjs (#71951)
yamachu Jul 22, 2022
8c71651
Delete ConservativelyReportedRegion and CallingConventionConverterHel…
jkotas Jul 22, 2022
41def7c
[NativeAOT] Some cleanup of assembly helpers in hijack area. (#72542)
VSadov Jul 22, 2022
555a791
Add `UnscopedRefAttribute` (#72499)
AaronRobinsonMSFT Jul 22, 2022
434fe75
HTTP/3 Improved message for failing QUIC connection (#72374)
iuliaco Jul 22, 2022
a969c53
Remove wrong cgroups assert (#72372)
janvorli Jul 22, 2022
0fbdb1e
Fix Globalization tests (#72653)
LakshanF Jul 22, 2022
8eeb4df
Bump Intellisense package version to Preview6 (#72631)
carlossanlop Jul 22, 2022
a8e3e7d
PipeReaderStream.ReadInternal throws AggregateException unexpectedly …
pedrobsaila Jul 22, 2022
391d143
Disable failing System.Text.Json tests on Android x86 and on Browser …
simonrozsival Jul 22, 2022
885207f
Add missing nullability annotation in CodeDom (#72532)
DustinCampbell Jul 22, 2022
bca7f94
Fix DivRem bug (#72115)
dakersnar Jul 22, 2022
574fd3a
Disable ThrowDuringProcessLog_ShutsDownGracefully test (#72680)
eerhardt Jul 22, 2022
fce6549
Add support for static default interface methods (#72661)
MichalStrehovsky Jul 22, 2022
a68ab4a
Change PipeStream's sync I/O cancellation support to avoid blocking C…
stephentoub Jul 22, 2022
5a073b2
Utilize new C# support for nameof in attributes in same signature (#7…
stephentoub Jul 22, 2022
c59b517
Add X509AuthorityKeyIdentifierExtension
bartonjs Jul 22, 2022
768500c
Tighten nullable annotations on RegistryKey.GetValue (#72679)
stephentoub Jul 22, 2022
7eaa6d1
Support ICU on Windows Server 2019 (#72656)
tarekgh Jul 22, 2022
5097317
Respect ForceUTF8Encoding when encoding an X500DN
vcsjones Jul 22, 2022
463efbb
Fix debugger funceval deadlock (#72179)
noahfalk Jul 22, 2022
04ff6c1
Add markdown readme for Microsoft.Extensions.DependencyModel (#72660)
MSDN-WhiteKnight Jul 23, 2022
4735fd7
Include libnethost.pdb in implementation packages (#72688)
elinor-fung Jul 23, 2022
1e1e86d
`LibraryImport` generator `AllowUnsafeBlocks` diagnostic (#72650)
AaronRobinsonMSFT Jul 23, 2022
d5b718f
Fix ClonedServer_ActsAsOriginalServer test (#72698)
stephentoub Jul 23, 2022
44397be
Improve reliability of WarningsAsErrors replacement (#72070)
GrabYourPitchforks Jul 23, 2022
02ee890
Update some more dependencies pulling in Newtonsoft.Json 9.0.1 (#72662)
jakobbotsch Jul 23, 2022
cbfc549
Improve performance of RegistryKey.GetValue (#66918)
stephentoub Jul 23, 2022
2bcf0f7
Delete lvVerTypeInfo (#71597)
SingleAccretion Jul 23, 2022
c624626
Consolidate importer spilling code (#72291)
SingleAccretion Jul 23, 2022
f0e7a68
[main] Update dependencies from dotnet/linker (#72597)
dotnet-maestro[bot] Jul 23, 2022
9d6396d
Fix typos (#72709)
am11 Jul 24, 2022
93f0512
[QUIC] Return connection dispose in H3loopback connection (#72713)
ManickaP Jul 24, 2022
50c0291
[main] Update dependencies from dotnet/arcade (#72672)
dotnet-maestro[bot] Jul 24, 2022
f4b9bac
Fix nativeaot arm64 build on macOS (#72733)
am11 Jul 24, 2022
c22f7f8
Revert "Consolidate importer spilling code (#72291)" (#72738)
jkotas Jul 24, 2022
c9c27d4
Avoid unnecessary return val copying in tailcall-via-help (#72720)
jakobbotsch Jul 24, 2022
b5fd812
Fixed stress error System.Exception: Completed unexpectedly (#72734)
ManickaP Jul 24, 2022
9f68db2
Replace a static readonly in[] in System.Data.Common (#72743)
stephentoub Jul 24, 2022
214ca6d
Avoid some unnecessary static readonly arrays (#72727)
stephentoub Jul 24, 2022
02ffbcd
Avoid transformation from multiplication to left shift in case of 64 …
alhad-deshpande Jul 25, 2022
7ec4304
Fix ReflectionCachesUpdateHandler_CachesCleared test in aggressive tr…
eerhardt Jul 25, 2022
9a0b8f3
[mono] Include dynamic methods in stacktrace (#72732)
BrzVlad Jul 25, 2022
60cfaec
Fix ARM64 Unix debugging (#72735)
hoyosjs Jul 25, 2022
6bbaed4
[wasm][debugger] Fix test regressions (#72751)
radical Jul 25, 2022
98d3841
Revert "Detect truncated GZip streams (#61768)" (#72742)
stephentoub Jul 25, 2022
a1468ed
Ensure `GetCorElementType` returns value type for enums on Mono runti…
mathieubourgeois Jul 25, 2022
a0cd16e
Fix SendAsync_GetWithInvalidHostHeader_ThrowsException (#72779)
rzikm Jul 25, 2022
d98066f
Expands a list of always trimmed mobile+web CA with few recently adde…
marek-safar Jul 25, 2022
b4991a5
Localized file check-in by OneLocBuild Task: Build definition ID 679:…
dotnet-bot Jul 25, 2022
dfd6efc
TryAddWithoutValidation ViaHeaderValue (#72741)
feiyun0112 Jul 25, 2022
91d15ff
JIT: teach VN to fold type comparisons (#72136)
AndyAyersMS Jul 25, 2022
f078ca9
Include EventLog.Messages in WindowsDesktop pack (#72280)
ViktorHofer Jul 25, 2022
283d6e6
[mono][llvm] Fix generation of LLVM IR for OP_SSE_CVTII. (#72731)
vargaz Jul 25, 2022
c9d7854
Enable NJulianRuleTest (#72707)
tarekgh Jul 25, 2022
9a461ad
Delete dead code from and fix `getSIMDStructFromField` (#71226)
SingleAccretion Jul 25, 2022
7aaa279
[wasm-ep] Implement DiagnosticServer and startup sessions for WebAsse…
lambdageek Jul 25, 2022
309ab38
fix project references, transient dependency doesn't work great on wi…
pavelsavara Jul 25, 2022
16f13eb
Dispose of IncrementalHash in CmsSigner
vcsjones Jul 25, 2022
f175438
when building on Ubuntu, avoid warning on shlibdeps libSystem.IO.Comp…
mirespace Jul 25, 2022
e83493e
Improve String.EndsWith for OrdinalIgnoreCase (#72750)
EgorBo Jul 25, 2022
fb1d318
Enable NI_Vector256_Create on AVX1 (#72522)
EgorBo Jul 25, 2022
5e91aa4
Re-enable the ability to use in-build signing (#72690)
mmitche Jul 25, 2022
bbdd837
[iOS] Enable Diagnostics.Tracing tests (#72545)
steveisok Jul 25, 2022
193fd53
JIT: add more inlining bail out checks (#72795)
AndyAyersMS Jul 25, 2022
ed2a5a1
[wasm] Move some defaults out of the templates (#72626)
lewing Jul 25, 2022
a660c0f
Fix MemoryCache test failures due to race (#72821)
danmoseley Jul 26, 2022
75476f9
Represent field RVA data with a dedicated node (#72826)
MichalStrehovsky Jul 26, 2022
d9da50c
Bail second pass redirection after catch in thread abort on Unix (#72…
hoyosjs Jul 26, 2022
b5de033
Fix HttpListenerRequestUriBuilder.GetPath's search for `?` (#72794)
stephentoub Jul 26, 2022
5166975
JIT: Fix creating small-typed LCL_VAR nodes in fgMakeTemp (#72771)
jakobbotsch Jul 26, 2022
86a7742
Removing the PublishAot check from the SDK (#72820)
LakshanF Jul 26, 2022
73374e8
[wasm] improve startup (#72275)
pavelsavara Jul 26, 2022
336317a
Emit warning instead of an error in package compat (#72518)
ViktorHofer Jul 26, 2022
e893232
[iOS] Enable System.Data.Common tests (#72554)
mdh1418 Jul 26, 2022
c118395
Fix running HTTP stress tests on local docker (#72844)
CarnaViire Jul 26, 2022
faebe45
Remove Http3RequestStream from _activeRequest when response is read/a…
rzikm Jul 26, 2022
2a2edc8
[wasm] optimize WebSocket perf for small buffers (#72800)
pavelsavara Jul 26, 2022
124ba53
Make RateLimiterOptions follow Options pattern (#72530)
wtgodbe Jul 26, 2022
fefb910
Clarify the purpose of the official discord (#72861)
MichalPetryka Jul 26, 2022
edb30e7
Add CertificateRevocationListBuilder
bartonjs Jul 26, 2022
dcf40dd
Fix missing shifting of Match._textxx fields (#72728)
stephentoub Jul 26, 2022
f4cb6ac
Add analyzer support to validate the stateless marshaller shapes (#72…
jkoritzinsky Jul 26, 2022
dbb97ca
Fix for #70007, fallback to old implementation if optimized way fails…
schuettecarsten Jul 26, 2022
8fc7be6
System.Text.Json - Emit XML comments for public source-generated APIs…
JakeYallop Jul 26, 2022
39d82c9
[QUIC] Remove connection state from QuicStream (#72599)
ManickaP Jul 26, 2022
cea17b2
Consolidate importer spilling code V2 (#72744)
SingleAccretion Jul 26, 2022
33d033d
Enable the ConvertToLibraryImport diagnostic by default (#72819)
jkoritzinsky Jul 26, 2022
cb046e5
Enabling some tests back onto the Interpreted engine (#72639)
joperezr Jul 26, 2022
1d08472
Change RegexGenerator to produce limited implementation for C# < 11 (…
stephentoub Jul 26, 2022
ccb9c26
Add pod names into the area-owners.json file to support querying by p…
jeffhandley Jul 26, 2022
d9887e5
Finds logger field in related types (#71308)
SteveDunn Jul 26, 2022
cc7ccfd
Fix Idna Test (#72817)
tarekgh Jul 26, 2022
1729ca6
Tear down pending HTTP connection when the originating request comple…
antonfirsov Jul 26, 2022
da46270
Make TypeBuilder.CreateType return non nullable (#72180)
JosieBigler Jul 26, 2022
0be6c64
Fix EncryptDecrypt test (#72874)
danmoseley Jul 26, 2022
aa5ff31
[wasm] Add `runtime-wasm-perf` pipeline (#72119)
radical Jul 26, 2022
f652b24
Add missing case in PruneLowerPriorityThanNullability (#72871)
olsaarik Jul 26, 2022
891cc3a
Simplify UpgradeToRegexGenerator (#72538)
Youssef1313 Jul 26, 2022
14ad0e1
Fix undisposed RegistryKeys in Microsoft.Win32.Registry tests (#72117)
stephentoub Jul 27, 2022
3c25f59
Avoid a couple theoretical reorderings in ManualResetValueTaskSourceC…
stephentoub Jul 27, 2022
1f98974
Fix Enumerable.Chunk throughput regression (#72811)
stephentoub Jul 27, 2022
fbced1b
[iOS] Fix ZipPackage_CreateWithFileAccessWrite test (#72850)
steveisok Jul 27, 2022
c421a7c
[iOS] Skip test suites that take too long to build on helix (#72849)
steveisok Jul 27, 2022
3ddc2c4
Add [Shared] to two CodeFixProviders (#72885)
stephentoub Jul 27, 2022
e125acf
Change issue number (#72863)
simonrozsival Jul 27, 2022
2c31641
Exclude JIT/opt/ValueNumbering/TypeTestFolding from crossgen2 testing…
AndyAyersMS Jul 27, 2022
8abc251
Update upstream ref for arm fp unwind support (#71857)
am11 Jul 27, 2022
75cc8fa
Add a test that ensures we are using SubtleCrypto in WASM crypto test…
eerhardt Jul 27, 2022
c4a8c8a
Delete DelegateInvokeThunk (#72903)
jkotas Jul 27, 2022
f90028c
Redisable GetAndSet_AreThreadSafe_AndUpdatesNeverLeavesNullValues tes…
danmoseley Jul 27, 2022
4f54504
Don't create mismatched block copies in `cpblk` import (#71160)
SingleAccretion Jul 27, 2022
b01f4a8
[main] Update dependencies from 8 repositories (#72448)
dotnet-maestro[bot] Jul 27, 2022
60e5f40
Localized file check-in by OneLocBuild Task: Build definition ID 679:…
dotnet-bot Jul 27, 2022
35d1171
[mini] Emit a null check using MONO_EMIT_NEW_CHECK_THIS for GetArrayD…
lambdageek Jul 27, 2022
ac48faa
Add missing System.Net docs (#72459)
stephentoub Jul 27, 2022
c867be6
enable https://github.com/dotnet/runtime/issues/53957 and https://git…
pavelsavara Jul 27, 2022
7b435cf
Enable GitHub_35821 (#72900)
kunalspathak Jul 27, 2022
7177b9d
JIT: Avoid removing multi-use boxes (#72842)
jakobbotsch Jul 27, 2022
3367b35
Fix a couple of issues when using textual PGO input (#72773)
jakobbotsch Jul 27, 2022
2725510
Re-enable throwinnestedtrycatch_il_r test (#72901)
kunalspathak Jul 27, 2022
56a1cf4
Bump timeout for "CoreCLR Tools Unit Tests Linux x64 checked" (#72928)
akoeplinger Jul 27, 2022
96b4b53
Remove InvalidOperationException when reading system properties from …
ericstj Jul 27, 2022
b416ee7
Fix the NJulianRuleTest when running with libc check builds (#72893)
tarekgh Jul 27, 2022
97f5a04
Disable ReadAsync_CancelPendingValueTask_ThrowsCancellationException …
rzikm Jul 27, 2022
d7d0e42
[wasm] Modify workload to pick threading runtime packs (#72412)
steveisok Jul 27, 2022
fc7577b
Add BuildCrlDistributionPointExtension
bartonjs Jul 27, 2022
a92bd72
Add support for int keyed dictionaries to configuration binder (#71609)
beppemarazzi Jul 27, 2022
c21ae04
[Mono][Arm64] Instrinsify methods for Vector4 on Arm64 (#72124)
fanyang-mono Jul 27, 2022
cd7db35
CMake support in VS open folder for coreclr (#70285)
huoyaoyuan Jul 27, 2022
dd98eac
Disable CrlBuilderTests.BuildEmptyRsaPss on Android
bartonjs Jul 27, 2022
d944592
Make revocation tests use CRLBuilder when it can instead of its own copy
bartonjs Jul 27, 2022
ada5503
Add SqlTypes apis for SqlClient (#72724)
Wraith2 Jul 27, 2022
111100b
Remove a few hardcoded instances of "net7.0" (#72950)
akoeplinger Jul 27, 2022
e96cfa9
Fixed HWIntrinsic reflection bug with `NextCallReturnAddress` intrins…
TIHan Jul 28, 2022
b0090d0
Rename [RegexGenerator] to [GeneratedRegex] (#72434)
am11 Jul 28, 2022
950f407
Disable tests that wait for compaction (#72954)
danmoseley Jul 28, 2022
34ea135
Add memory fences to ByRefAssignRef on Unix ARM64 (#72919)
MichalStrehovsky Jul 28, 2022
79d1988
[wasm][wbt] Test that `dotnet.js` could be run from any current direc…
yamachu Jul 28, 2022
426c959
Bump timeout on ARM64 NativeAOT legs (#72974)
MichalStrehovsky Jul 28, 2022
490d3ce
Minor cleanup in MethodDesc::GetPrecompiledCode (#72963)
hoyosjs Jul 28, 2022
9390088
Add extra Module.ModuleHandle test (#72875)
marek-safar Jul 28, 2022
d365ff2
Implement ControlledExecution API (#71661)
AntonLapounov Jul 28, 2022
8fdec7f
[wasm] remove support for CommonJS (#72865)
pavelsavara Jul 28, 2022
ee4e890
#53624 enable test suites in maccatalyst (#72445)
mkhamoyan Jul 28, 2022
97749c0
[wasm] Wasm.Build.Tests: Use Chrome on windows, instead of V8 (#72983)
radical Jul 28, 2022
9dfc922
Localized file check-in by OneLocBuild Task: Build definition ID 679:…
dotnet-bot Jul 28, 2022
d641668
Fix evaluate expression of mutidimensional array. (#72964)
thaystg Jul 28, 2022
b31a48a
Fix SslStress docker build (#72940)
antonfirsov Jul 28, 2022
b0766a9
[wasm][debugger] Added support for getting members of static structur…
ilonatommy Jul 28, 2022
0cd410b
[libs][mono] Enable diagnostics_tracing runtime component in Android …
mdh1418 Jul 28, 2022
e6723a3
JIT: Skip Min/Max optimization when SSE2 is not enabled (#72991)
jakobbotsch Jul 28, 2022
50d69de
Enable tests disabled by issue 36882 (#72931)
lateralusX Jul 28, 2022
a8789a6
Fix race when receiving HEADERS and RST_STREAM in rapid succession. (…
rzikm Jul 28, 2022
8e1c9c1
[mono][jit] Use MONO_CLASS_IS_SIMD () in more places to fix running w…
vargaz Jul 28, 2022
11e3d1b
Fix `ldelem[a]/stelem/cpobj/ldobj/stobj <pointer type>` import (#71679)
SingleAccretion Jul 28, 2022
812ad81
HTTP/3 Made alt-used show only on alt-svc redirect (#72669)
iuliaco Jul 28, 2022
1e01aa1
Annoating Net.Quic & Net.Security libraries to be AOT safe (#72791)
LakshanF Jul 28, 2022
e7c83f1
Use the common path for lowering single-reg SIMD returns (#72944)
SingleAccretion Jul 28, 2022
ad58ce5
Added remaining APIs to complete NativeMemory set (#72960)
sakno Jul 28, 2022
cf3bf7a
Update the CustomMarshallerAttributeFixer to support adding missing m…
jkoritzinsky Jul 28, 2022
35b8617
Avoid promoting in sweep_in_plan when we already decided not to promo…
cshung Jul 28, 2022
ef7c980
Do not embed result type in VN for scalar hw intrinsics (#72895)
kunalspathak Jul 28, 2022
07ebba1
[wasm][debugger] Fix assert when passing an invalid array to runtime.…
thaystg Jul 28, 2022
d7c8bc1
[wasm] reduce legacy interop usage (#72021)
pavelsavara Jul 28, 2022
bda5557
Add support for specifying Kerberos package on Linux/macOS (in additi…
filipnavara Jul 28, 2022
74bd485
Remove some debug code (#72985)
AaronRobinsonMSFT Jul 28, 2022
8294512
JIT: Disqualify methods with modifiable `this` from OSR. (#72877)
AndyAyersMS Jul 29, 2022
7d1e1af
Get more libraries tests running with NativeAOT (#72917)
MichalStrehovsky Jul 29, 2022
1c055bb
Run more test on NativeAOT Linux (#72832)
MichalStrehovsky Jul 29, 2022
cc7edab
Implementation of opcode OP_GC_SAFE_POINT for ppc64le (#72997)
alhad-deshpande Jul 29, 2022
2781e17
Fixing the per object hard limit support for regions (#72229)
cshung Jul 29, 2022
b6115b0
Unblock tests blocked on 70012 (#73044)
MichalStrehovsky Jul 29, 2022
9b63001
Make JSON support required properties (#72937)
krwq Jul 29, 2022
5331568
[NativeAOT] Fix assert in Thread.SpinWait(0) (#73033)
VSadov Jul 29, 2022
7ca4d6f
Fix UnsupportedOSPlatformAttribute usage in System.Net.NetworkInforma…
rzikm Jul 29, 2022
c734a8e
[wasm-ep] diagnostic server IPC fixups (#72859)
lambdageek Jul 29, 2022
20b42d5
re-enable tests for 66421 (#73052)
krwq Jul 29, 2022
44f1c1e
Localized file check-in by OneLocBuild Task: Build definition ID 679:…
dotnet-bot Jul 29, 2022
992cf8c
Define __cpuid{ex} only when there's no builtin one (#73065)
am11 Jul 29, 2022
222da17
[wasm] `JSImport` generator `AllowUnsafeBlocks` diagnostic (#72996)
pavelsavara Jul 29, 2022
c0d16fa
recursive generic fix (#73071)
VSadov Jul 29, 2022
f03470b
Refactor root-level serialization logic and polymorphic value handlin…
eiriktsarpalis Jul 29, 2022
de25ece
Fix crc32 issues found in #62692 (#73005)
EgorBo Jul 29, 2022
865802a
Fix incremental XxHash32/XxHash64 (#69185)
froce Jul 29, 2022
32f3646
Update ConvertToLibraryImport analyzer and fixer to limit false-posit…
jkoritzinsky Jul 29, 2022
a01aea9
Add stateful marshaller support to the CustomMarshallerAttributeAnaly…
jkoritzinsky Jul 29, 2022
4cd3e78
Add EH filters for generic catch(T) blocks (#72721)
EgorBo Jul 29, 2022
d30ab11
Disable NJulianRuleTest on Android (#73030)
tarekgh Jul 29, 2022
1dc6524
Appropriately free temporary values on EC import
bartonjs Jul 29, 2022
1f0571e
Annotate System.Linq.Queryable with RDC (#72899)
agocke Jul 30, 2022
0ba3d31
Move System.ValueType.s_seed into System.Runtime.CompilerServices.Run…
gregg-miskelly Jul 30, 2022
9481422
Add retry to symlink test (#73042)
danmoseley Jul 30, 2022
aa8489c
Implement test checking whether CET is active (#71509)
trylek Jul 30, 2022
17a4eca
Remove undefined behavior for address of null reference (#73113)
AaronRobinsonMSFT Jul 31, 2022
ec5e8b5
[GC] Handle objects from frozen segments in GCHeap::IsEphemeral (#73110)
EgorBo Jul 31, 2022
eead714
[Android] Don't exclude .gz files from assets.zip (#73077)
directhex Jul 31, 2022
5e6df13
JIT: have jit tail call stress avoid creating loops in some cases (#7…
AndyAyersMS Jul 31, 2022
85beaec
30% optimization of `DateTime.GetDate()`/`.Year/.Month/.Day/.DayOfYea…
SergeiPavlov Jul 31, 2022
13b4bb7
Add documentation for hot/cold splitting (#73029)
Jul 31, 2022
d07b800
Add TPN entry for Date/Time processing algorithm (#73128)
danmoseley Jul 31, 2022
3605700
Update CLRConfig knob description (#73133)
AaronRobinsonMSFT Aug 1, 2022
508fef5
Enable more libraries tests (#73104)
MichalStrehovsky Aug 1, 2022
75abdd4
Fix assert in NativeAOT when handling data flow on compiler generated…
vitek-karas Aug 1, 2022
3b35bc6
Link issue to the RDC attribute on DispatchProxy (#73137)
MichalStrehovsky Aug 1, 2022
cfa4f6f
Add some QuicListener tests (#73072)
rzikm Aug 1, 2022
65af9d0
Add localloc empty stack verification (#73109)
jl0pd Aug 1, 2022
01444f7
[mono][interp] Improve tiering performance (#70649)
BrzVlad Aug 1, 2022
05c6f3d
Add more DataFlow tests from linker to NativeAOT (#72777)
vitek-karas Aug 1, 2022
f1de614
[Unix] Console.ReadKey rewrite (#72193)
adamsitnik Aug 1, 2022
2f78734
Remove cctor from X500NameEncoder (#73115)
vcsjones Aug 1, 2022
8eb5dea
Remove 1024 character limit on ODBC connection strings (#73149)
roji Aug 1, 2022
cfe26ec
Don't hardcode /tmp in named pipe tests, it's not for us on Android (…
directhex Aug 1, 2022
028e556
Make IHostEnvironment.ApplicationName non-nullable (#72945)
eerhardt Aug 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[wasm-ep] Implement DiagnosticServer and startup sessions for WebAsse…
…mbly (dotnet#72482)

Add a diagnostic server for WebAssembly.  Enable by building the runtime with `/p:WasmEnablePerfTracing=true` or `/p:WasmEnableThreads=true`.

To configure a project to start the diagnostic server, add this to the .csproj:
```xml
      <WasmExtraConfig Include="diagnostic_options" Value='
{
  "server": { "suspend": false, "connect_url": "ws://localhost:8088/diagnostics" }
}' />
```

The `connect_url` should be a WebSocket url serviced by `dotnet-dsrouter server-websocket` **from this branch** https://github.com/lambdageek/diagnostics/tree/wasm-server

Note that setting `"suspend": true` will hang the browser tab until a diagnostic tool such as `dotnet-trace collect` connects to the dsrouter.

---

Implement creating VFS file based sessions at runtime startup.  Add the following to a .csproj:

```xml
    <WasmExtraConfig Include="diagnostic_options" Value='
{
  "sessions": [ { "collectRundownEvents": "true", "providers": "WasmHello::5:EventCounterIntervalSec=1" } ]
}' />
```

That will create and start one or more EventPipe sessions that will store their results into the VFS.

The startup session can be retrieved via `MONO.diagnostics.getStartupSessions()`.  Each session `s` should be stopped via `s.stop()` and the data can then be extraced in a `Blob` using `s.getTraceBlob()`.

This is orthogonal to the diagnostic server support.  You don't need `dotnet-dsrouter` running on the host.  But you do need access to JavaScript on the main thread.

---

Notes/Issues:

* Tree shaking: I verified that if threads are not available, all the TypeScript diagnostics code is removed.
* Right now the server is not very robust to `dotnet-dsrouter` stopping, or starting after the runtime starts.  The ideal order is to start `dotnet-dsrouter` first, and then open the browser
* Unrelated housekeeping fixes:
   * Tell `wasm.proj` about all the subdirectories with .ts files - makes incremental builds notice changes in subdirectories.
   * Add a rollup `dependencies` property to quiet a warning about `node/buffer`
   * There's a mock implementation of a "websocket" that was used for protocol testing. I verified that tree-shaking removes this in thread-enabled Release builds.
   * Bump `PTHREAD_POOL_SIZE` to `4` and set `PTHREAD_POOL_SIZE_STRICT=2` (returns `EAGAIN` from `pthread_create` if the pool needs to grow).  The previous setting `PTHREAD_POOL_SIZE_STRING=1` (warn and try to grow the pool) seemed to lead to hangs.  Usually that means the main thread is creating a thread and immediately calling `pthread_join` without returning to JS. We should investigate separately.
   * The only implemented diagnostic server commands are `CollectTracing2`, `StopCollecting` and `ResumeRuntime`. None of the `Dump`, `Process` and `Profiler` commands are implemented and the server will crash if it receives them.  It should be relatively straightforward to return a "command unsupported" reply (which would allow clients to gracefully disconnect), but it's not done yet.
* In some error states the runtime kills the browser tab with the following in a terminal window (if Chrome is started from a terminal: `FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory`). This probably means we're hitting a loop somewhere that rapidly exhausts JIT memory, but it's difficult to investigate when the JS console dies, too (happens with chrome stable v103 and chrome beta v104).

Fixes dotnet#69674, contributes to dotnet#72481


---

* [wasm] Enable the tracing component if threading is supported

* add a way to specify EP sessions in the MonoConfig

   Currently not wired up to the runtime

* Add a mechanism to copy startup configs into the runtime and session IDs out

* checkpoint. Do more from JS

The issue is that once we're setting up streaming sessions, we will need to send back a DS IPC reply with the session id before we start streaming.  So it's better to just call back to JS when we start up and setup all the EP sessions from JS so that when we return to C everything is all ready.

* checkpoint: starting a session at startup works

* checkpoint add a controller and a webworker for DS

* checkpoint: diagnostic server

* fix eslint

* [diagnostic_server] wasm-specific fn_table

   We won't be using the native C version

* [wasm-ep] disable DS connect ports in C, too

   we will implement DS in JS

* Start diagnostic server pthread

Clean up some of the old WIP code - we will probably not send configuration strings from the diagnostic server back to the main thread.

* checkpoint: try to start the server

   It doesn't work right now because the MessagePort is not created until the server thread attaches to Mono, which doesn't happen because it's started before Mono.

Also it doesn't yet send a resume event, so the main thread just blocks forever

* Add a mock WebSocket connection to simulate the remote end

   Start the diagnostic server and have it perform the open/advertise steps with the mock.

* wasm-mt: use a PThreadSelf struct instead of a raw MessagePort

* Move all the EP and diagnostic server modules to one directory

* Refactor; remove dead code; rationalize controller

the flow is now:

```
main -{creates pthread}->              server
  .                                      server creates event listener
  .  <-{sends diagnostic MessagePort}-   .
main creates event listener              .
  .  -{posts "start" message}->          .
  .                                      begins server loop
```

after the server loop is running, the main thread will get a "resume_startup" message once the diagnostic server receives the right command from the websocket.

next TODO: the runtime needs to send a "attach to runtime" message which will signal the server that it can attach to the runtime (in native) and start calling EP session creation functions.

* checkpoint: start adding queue from streaming thread to DS thread

We can't set up a shared MessagePort very easily (we need to bounce through the main thread but it probably won't be able to process our message until it's too late).

Also Atomics.waitAsync isn't available on many browsers (Chrome only).

So we use emscripten's dispatch mechanism to trigger an event in the diagnostic thread to wake up and service the streaming thread's queue. Right now the queue is dumb so we trigger on every write.  and also the write is synchronous.

But it's simple to think about and it's implementable.

* [wasm] Incremental build and rollup warnings cleanups

- Add 'node/buffer' as an extrenal dependency. This doesn't do anything except quiet a rollup warning about the import.
- Add all the .ts files, and the tsconfig files (except node_modules) to the rollup inputs, to make sure we re-run rollup when anything changes.

* WIP: work on wiring up DS protocol commands (mock); resume hack

- start adding commands so that we can strt some sessions from DS
- we can't avoid a busy loop in ds_server_wasm_pause_for_diagnostics_monitor.
  we can't make the main thread pause until we get a resume command
  until after we're able to start an EP session (DS client won't send
  a resume command until we send an EP session ID back).  If the DS
  pauses until it can attach to the runtime, and the runtime pauses
  until DS tells it to resume, the main thread pause has to be after
  we get EP and DS initialized.  But that means it can't be async.  So
  we'll just have to busy wait on a condition variable in native.

* WIP: set up a WasmIpcStream, create EP sessions from DS

Seems to create the session, but not seeing write events
yet. possibly due to not flushing?

* WIP: starting to stream works; needs PTHREAD_POOL_SIZE bump

Looks like we can send the initial nettrace header some events.

We're starting more threads, so we need a bigger thread pool.

Also PTHREAD_POOL_SIZE_STRICT=1 (the default - warn if worker pool needs to grow,
but still try to grow it) seems to deadlock the browser-eventpipe
sample.

Set PTHREAD_POOL_SIZE_STRICT=2 (don't try to allocate a worker, make
pthread_create fail with EAGAIN) instead so we get some kind of
exception instead in other circumstances.

Set the pool size to 4.

* cleanup browser-eventpipe sample

* call mono_wasm_event_pipe_early_startup_callback from event_pipe init

  instead of from the rundown_execution_checkpoint_2 function

* if diagnostics server isn't enabled, don't try to initialize it

* checkpoint: start parsing binary commands

* checkpoint: Can parse a CollectTracing2 command and attempt to create a
session!

* [wasm-ep] use the new PromiseController<T>

* get back to the server loop quicker by queueing the parsing in the microtask

* update mock for binary ADVR_V1 message

* sample: don't suspend, and use a mock url

* wasm_ipc_stream: wire up close command

   Use a sentinal "buf" value (-1) to signal that the writer closed the stream

* Send proper OK messages in replies to binary protocol commands

* (testing) turn off the file session for now

* remove em_asm(console.log); simplify wasm EP init

   Just call the EP JS callback directly from native

* remove debug output

* cleanup wasm ipc stream impl

* put diagnostics mocks behind a const flag

* don't build wasm-specific DS if threads are disabled

* refactor and cleanup

- Move the IPC parsing and serialization into separate files
- Try to have one responsibility per class
- update comments and docs

* help treeshaking

verified that all the DS and EP JS code is dropped if monoWasmThreads is false.

* update DS design notes

* use PromiseController in more places

* fix Windows build

* add MONO_WASM prefix to console logging outputs

* improve debug output for DS server

   keep track of open/advertise counts and print them when receiving replies

* bugfix: don't confuse buf_addr for the value stored in it

   the buf_addr is always the same for a given queue. the value in it is what we need to check to see if it's the sentinel value

* fix bug in queue_push_sync main thread detection

* merge fixup

* fix rollup warning when making the crypto worker

* add MONO_WASM: prefix to logging

* make diagnostic server mocking friendlier

   Allow each test project to specify its own mock script.

   Also provide TypeScript declarations for the mocking interfaces

   Also always use binary protocol commands - don't send json for mocks.

* disable mocking in the sample project by default

* fixup after merge

* review feedback

   - improve diagnostics mock README
   - note that mocking just uses ES6 modules, testing with CJS is not supported right now.
   - fix iteration over listeners when dispatching a one-shot event in the EventTargt polyfill
   - use U32 getter in EP session creation
  • Loading branch information
lambdageek authored Jul 25, 2022
commit 7aaa2796c47cfd7e42294e8e0b562f826125ef00
1 change: 1 addition & 0 deletions src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@
<ItemGroup Condition="'$(TargetsBrowser)' == 'true'">
<_MonoCMakeArgs Include="-DFEATURE_PERFTRACING_DISABLE_PERFTRACING_LISTEN_PORTS=1"/>
<_MonoCMakeArgs Include="-DFEATURE_PERFTRACING_DISABLE_DEFAULT_LISTEN_PORT=1"/>
<_MonoCMakeArgs Include="-DFEATURE_PERFTRACING_DISABLE_CONNECT_PORTS=1" />
</ItemGroup>

<!-- Components -->
Expand Down
303 changes: 303 additions & 0 deletions src/mono/mono/component/diagnostics_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,19 @@
#include <mono/utils/mono-publib.h>
#include <mono/utils/mono-compiler.h>
#include <eventpipe/ds-server.h>
#ifdef HOST_WASM
#include <eventpipe/ep-ipc-stream.h>
#include <mono/component/event_pipe-wasm.h>
#include <mono/utils/mono-coop-semaphore.h>
#include <mono/utils/mono-threads-wasm.h>
#include <emscripten/emscripten.h>
#include <emscripten/threading.h>
#endif

static bool
diagnostics_server_available (void);

#if !defined (HOST_WASM) || defined (DISABLE_THREADS)
static MonoComponentDiagnosticsServer fn_table = {
{ MONO_COMPONENT_ITF_VERSION, &diagnostics_server_available },
&ds_server_init,
Expand All @@ -19,6 +28,300 @@ static MonoComponentDiagnosticsServer fn_table = {
&ds_server_disable
};

#else /* !defined (HOST_WASM) || defined (DISABLE_THREADS) */

static bool
ds_server_wasm_init (void);

static bool
ds_server_wasm_shutdown (void);

static void
ds_server_wasm_pause_for_diagnostics_monitor (void);

static void
ds_server_wasm_disable (void);

static MonoComponentDiagnosticsServer fn_table = {
{ MONO_COMPONENT_ITF_VERSION, &diagnostics_server_available },
&ds_server_wasm_init,
&ds_server_wasm_shutdown,
&ds_server_wasm_pause_for_diagnostics_monitor,
&ds_server_wasm_disable,
};

typedef struct _MonoWasmDiagnosticServerOptions {
int32_t suspend; /* set from JS! */
MonoCoopSem suspend_resume;
} MonoWasmDiagnosticServerOptions;

static MonoWasmDiagnosticServerOptions wasm_ds_options;
static pthread_t ds_thread_id;

extern void
mono_wasm_diagnostic_server_on_runtime_server_init (MonoWasmDiagnosticServerOptions *out_options);

EMSCRIPTEN_KEEPALIVE void
mono_wasm_diagnostic_server_resume_runtime_startup (void);

static bool
ds_server_wasm_init (void)
{
/* called on the main thread when the runtime is sufficiently initialized */
mono_coop_sem_init (&wasm_ds_options.suspend_resume, 0);
mono_wasm_diagnostic_server_on_runtime_server_init(&wasm_ds_options);
return true;
}


static bool
ds_server_wasm_shutdown (void)
{
mono_coop_sem_destroy (&wasm_ds_options.suspend_resume);
return true;
}

static void
ds_server_wasm_pause_for_diagnostics_monitor (void)
{
/* wait until the DS receives a resume */
if (wasm_ds_options.suspend) {
/* WISH: it would be better if we split mono_runtime_init_checked() (and runtime
* initialization in general) into two separate functions that we could call from
* JS, and wait for the resume event in JS. That would allow the browser to remain
* responsive.
*
* (We can't pause earlier because we need to start up enough of the runtime that DS
* can call ep_enable_2() and get session IDs back. Which seems to require
* mono_jit_init_version() to be called. )
*
* With the current setup we block the browser UI. Emscripten still processes its
* queued work in futex_wait_busy, so at least other pthreads aren't waiting for us.
* But the user can't interact with the browser tab at all. Even the JS console is
* not displayed.
*/
int res = mono_coop_sem_wait(&wasm_ds_options.suspend_resume, MONO_SEM_FLAGS_NONE);
g_assert (res == 0);
}
}


static void
ds_server_wasm_disable (void)
{
/* DS disable seems to only be called for the AOT compiler, which should never get here on
* HOST_WASM */
g_assert_not_reached ();
}

/* Allocated by mono_wasm_diagnostic_server_create_thread,
* then ownership passed to server_thread.
*/
static char*
ds_websocket_url;

extern void mono_wasm_diagnostic_server_on_server_thread_created (char *websocket_url);

static void*
server_thread (void* unused_arg G_GNUC_UNUSED)
{
g_assert (ds_websocket_url != NULL);
char* ws_url = g_strdup (ds_websocket_url);
g_free (ds_websocket_url);
ds_websocket_url = NULL;
mono_wasm_diagnostic_server_on_server_thread_created (ws_url);
// "exit" from server_thread, but keep the pthread alive and responding to events
emscripten_exit_with_live_runtime ();
}

gboolean
mono_wasm_diagnostic_server_create_thread (const char *websocket_url, pthread_t *out_thread_id)
{
pthread_t thread;

if (!websocket_url)
return FALSE;

g_assert (!ds_websocket_url);
ds_websocket_url = g_strdup (websocket_url);
if (!pthread_create (&thread, NULL, server_thread, NULL)) {
*out_thread_id = thread;
return TRUE;
}
memset(out_thread_id, 0, sizeof(pthread_t));
return FALSE;
}

void
mono_wasm_diagnostic_server_thread_attach_to_runtime (void)
{
ds_thread_id = pthread_self();
MonoThread *thread = mono_thread_internal_attach (mono_get_root_domain ());
mono_thread_set_state (thread, ThreadState_Background);
mono_thread_info_set_flags (MONO_THREAD_INFO_FLAGS_NO_SAMPLE);
/* diagnostic server thread is now in GC Unsafe mode */
}

void
mono_wasm_diagnostic_server_post_resume_runtime (void)
{
if (wasm_ds_options.suspend) {
/* wake the main thread */
mono_coop_sem_post (&wasm_ds_options.suspend_resume);
}
}

#define QUEUE_CLOSE_SENTINEL ((uint8_t*)(intptr_t)-1)

/* single-reader single-writer one-element queue. See
* src/mono/wasm/runtime/diagnostics/server_pthread/stream-queue.ts
*/
typedef struct WasmIpcStreamQueue {
uint8_t *buf; /* or QUEUE_CLOSE_SENTINEL */
int32_t count;
volatile int32_t buf_full;
} WasmIpcStreamQueue;

extern void
mono_wasm_diagnostic_server_stream_signal_work_available (WasmIpcStreamQueue *queue, int32_t current_thread);

static void
queue_wake_reader (void *ptr) {
/* asynchronously invoked on the ds server thread by the writer. */
WasmIpcStreamQueue *q = (WasmIpcStreamQueue *)ptr;
mono_wasm_diagnostic_server_stream_signal_work_available (q, 0);
}

static void
queue_wake_reader_now (WasmIpcStreamQueue *q)
{
// call only from the diagnostic server thread!
mono_wasm_diagnostic_server_stream_signal_work_available (q, 1);
}

static int32_t
queue_push_sync (WasmIpcStreamQueue *q, const uint8_t *buf, uint32_t buf_size, uint32_t *bytes_written)
{
/* to be called on the writing thread */
/* single-writer, so there is no write contention */
q->buf = (uint8_t*)buf;
q->count = buf_size;
/* there's one instance where a thread other than the
* streaming thread is writing: in ep_file_initialize_file
* (called from ep_session_start_streaming), there's a write
* from either the main thread (if the streaming was deferred
* until ep_finish_init is called) or the diagnostic thread if
* the session is started later.
*/
pthread_t cur = pthread_self ();
gboolean will_wait = TRUE;
mono_atomic_store_i32 (&q->buf_full, 1);
if (cur == ds_thread_id) {
queue_wake_reader_now (q);
/* doesn't return until the buffer is empty again; no need to wait */
will_wait = FALSE;
} else {
emscripten_dispatch_to_thread (ds_thread_id, EM_FUNC_SIG_VI, &queue_wake_reader, NULL, q);
}
// wait until the reader reads the value
int r = 0;
if (G_LIKELY (will_wait)) {
gboolean is_browser_thread_inited = FALSE;
gboolean is_browser_thread = FALSE;
while (mono_atomic_load_i32 (&q->buf_full) != 0) {
if (G_UNLIKELY (!is_browser_thread_inited)) {
is_browser_thread = mono_threads_wasm_is_browser_thread ();
is_browser_thread_inited = TRUE;
}
if (G_UNLIKELY (is_browser_thread)) {
/* can't use memory.atomic.wait32 on the main thread, spin instead */
/* this lets Emscripten run queued calls on the main thread */
emscripten_thread_sleep (1);
} else {
r = mono_wasm_atomic_wait_i32 (&q->buf_full, 1, -1);
if (G_UNLIKELY (r == 2)) {
/* timed out with infinite wait?? */
return -1;
}
/* if r == 0 (blocked and woken) or r == 1 (not equal), go around again and check if buf_full is now 0 */
}
}
}
if (bytes_written)
*bytes_written = buf_size;
return 0;
}

typedef struct {
IpcStream stream;
WasmIpcStreamQueue queue;
} WasmIpcStream;

static void
wasm_ipc_stream_free (void *self);
static bool
wasm_ipc_stream_read (void *self, uint8_t *buffer, uint32_t bytes_to_read, uint32_t *bytes_read, uint32_t timeout_ms);
static bool
wasm_ipc_stream_write (void *self, const uint8_t *buffer, uint32_t bytes_to_write, uint32_t *bytes_written, uint32_t timeout_ms);
static bool
wasm_ipc_stream_flush (void *self);
static bool
wasm_ipc_stream_close (void *self);

static IpcStreamVtable wasm_ipc_stream_vtable = {
&wasm_ipc_stream_free,
&wasm_ipc_stream_read,
&wasm_ipc_stream_write,
&wasm_ipc_stream_flush,
&wasm_ipc_stream_close,
};

EMSCRIPTEN_KEEPALIVE IpcStream *
mono_wasm_diagnostic_server_create_stream (void)
{
g_assert (G_STRUCT_OFFSET(WasmIpcStream, queue) == 4); // keep in sync with mono_wasm_diagnostic_server_get_stream_queue
WasmIpcStream *stream = g_new0 (WasmIpcStream, 1);
ep_ipc_stream_init (&stream->stream, &wasm_ipc_stream_vtable);
return &stream->stream;
}

static void
wasm_ipc_stream_free (void *self)
{
g_free (self);
}
static bool
wasm_ipc_stream_read (void *self, uint8_t *buffer, uint32_t bytes_to_read, uint32_t *bytes_read, uint32_t timeout_ms)
{
/* our reader is in JS */
g_assert_not_reached();
}
static bool
wasm_ipc_stream_write (void *self, const uint8_t *buffer, uint32_t bytes_to_write, uint32_t *bytes_written, uint32_t timeout_ms)
{
WasmIpcStream *stream = (WasmIpcStream *)self;
g_assert (timeout_ms == EP_INFINITE_WAIT); // pass it down to the queue if the timeout param starts being used
int r = queue_push_sync (&stream->queue, buffer, bytes_to_write, bytes_written);
return r == 0;
}

static bool
wasm_ipc_stream_flush (void *self)
{
return true;
}

static bool
wasm_ipc_stream_close (void *self)
{
WasmIpcStream *stream = (WasmIpcStream*)self;
// push the special buf value -1 to signal stream close.
int r = queue_push_sync (&stream->queue, QUEUE_CLOSE_SENTINEL, 0, NULL);
return r == 0;
}

#endif /* !defined (HOST_WASM) || defined (DISABLE_THREADS) */

static bool
diagnostics_server_available (void)
{
Expand Down
6 changes: 1 addition & 5 deletions src/mono/mono/component/event_pipe-stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#include "mono/component/event_pipe.h"
#include "mono/component/event_pipe-wasm.h"
#include "mono/metadata/components.h"
#ifdef HOST_WASM
#include <emscripten/emscripten.h>
#endif

static EventPipeSessionID _dummy_session_id;

Expand Down Expand Up @@ -524,12 +521,12 @@ mono_component_event_pipe_init (void)

EMSCRIPTEN_KEEPALIVE gboolean
mono_wasm_event_pipe_enable (const ep_char8_t *output_path,
IpcStream *ipc_stream,
uint32_t circular_buffer_size_in_mb,
const ep_char8_t *providers,
/* EventPipeSessionType session_type = EP_SESSION_TYPE_FILE, */
/* EventPipieSerializationFormat format = EP_SERIALIZATION_FORMAT_NETTRACE_V4, */
/* bool */ gboolean rundown_requested,
/* IpcStream stream = NULL, */
/* EventPipeSessionSycnhronousCallback sync_callback = NULL, */
/* void *callback_additional_data, */
MonoWasmEventPipeSessionID *out_session_id)
Expand All @@ -551,5 +548,4 @@ mono_wasm_event_pipe_session_disable (MonoWasmEventPipeSessionID session_id)
{
g_assert_not_reached ();
}

#endif /* HOST_WASM */
15 changes: 14 additions & 1 deletion src/mono/mono/component/event_pipe-wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#ifdef HOST_WASM

#include <pthread.h>
#include <emscripten.h>

G_BEGIN_DECLS
Expand All @@ -27,12 +28,12 @@ typedef uint32_t MonoWasmEventPipeSessionID;

EMSCRIPTEN_KEEPALIVE gboolean
mono_wasm_event_pipe_enable (const ep_char8_t *output_path,
IpcStream *ipc_stream,
uint32_t circular_buffer_size_in_mb,
const ep_char8_t *providers,
/* EventPipeSessionType session_type = EP_SESSION_TYPE_FILE, */
/* EventPipieSerializationFormat format = EP_SERIALIZATION_FORMAT_NETTRACE_V4, */
/* bool */ gboolean rundown_requested,
/* IpcStream stream = NULL, */
/* EventPipeSessionSycnhronousCallback sync_callback = NULL, */
/* void *callback_additional_data, */
MonoWasmEventPipeSessionID *out_session_id);
Expand All @@ -43,6 +44,18 @@ mono_wasm_event_pipe_session_start_streaming (MonoWasmEventPipeSessionID session
EMSCRIPTEN_KEEPALIVE gboolean
mono_wasm_event_pipe_session_disable (MonoWasmEventPipeSessionID session_id);

EMSCRIPTEN_KEEPALIVE gboolean
mono_wasm_diagnostic_server_create_thread (const char *websocket_url, pthread_t *out_thread_id);

EMSCRIPTEN_KEEPALIVE void
mono_wasm_diagnostic_server_thread_attach_to_runtime (void);

EMSCRIPTEN_KEEPALIVE void
mono_wasm_diagnostic_server_post_resume_runtime (void);

EMSCRIPTEN_KEEPALIVE IpcStream *
mono_wasm_diagnostic_server_create_stream (void);

G_END_DECLS

#endif /* HOST_WASM */
Expand Down
Loading