diff --git a/src/libraries/tests.proj b/src/libraries/tests.proj index 77e53d7c06e4d3..6c222ac05cbd12 100644 --- a/src/libraries/tests.proj +++ b/src/libraries/tests.proj @@ -57,7 +57,6 @@ - diff --git a/src/mono/sample/wasm/browser-eventpipe/main.js b/src/mono/sample/wasm/browser-eventpipe/main.js index 2d5b99e8560c9e..51b638b21bf4a9 100644 --- a/src/mono/sample/wasm/browser-eventpipe/main.js +++ b/src/mono/sample/wasm/browser-eventpipe/main.js @@ -1,25 +1,5 @@ import createDotnetRuntime from "./dotnet.js"; -function downloadData(dataURL, filename) { - // make an `` link and click on it to trigger a download with the given name - const elt = document.createElement('a'); - elt.download = filename; - elt.href = dataURL; - - document.body.appendChild(elt); - - elt.click(); - - document.body.removeChild(elt); -} - -function makeTimestamp() { - // ISO date string, but with : and . replaced by - - const t = new Date(); - const s = t.toISOString(); - return s.replace(/[:.]/g, '-'); -} - const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) async function doWork(startWork, stopWork, getIterationsDone) { @@ -56,31 +36,7 @@ async function doWork(startWork, stopWork, getIterationsDone) { function getOnClickHandler(startWork, stopWork, getIterationsDone) { return async function () { - let sessions = MONO.diagnostics.getStartupSessions(); - - if (typeof (sessions) !== "object" || sessions.length === "undefined") - console.error("expected an array of sessions, got ", sessions); - let eventSession = null; - if (sessions.length !== 0) { - if (sessions.length != 1) - console.error("expected one startup session, got ", sessions); - eventSession = sessions[0]; - console.debug("eventSession state is ", eventSession._state); // ooh protected member access - } - - const ret = await doWork(startWork, stopWork, getIterationsDone); - - if (eventSession !== null) { - eventSession.stop(); - - const filename = "dotnet-wasm-" + makeTimestamp() + ".nettrace"; - - const blob = eventSession.getTraceBlob(); - const uri = URL.createObjectURL(blob); - downloadData(uri, filename); - } - - console.debug("sample onclick handler done"); + await doWork(startWork, stopWork, getIterationsDone); } } diff --git a/src/mono/sample/wasm/browser-mt-eventpipe/Makefile b/src/mono/sample/wasm/browser-mt-eventpipe/Makefile deleted file mode 100644 index 8fddd8371b830e..00000000000000 --- a/src/mono/sample/wasm/browser-mt-eventpipe/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -TOP=../../../../.. - -include ../wasm.mk - -ifneq ($(AOT),) -override MSBUILD_ARGS+=/p:RunAOTCompilation=true -endif - -PROJECT_NAME=Wasm.Browser.ThreadsEP.Sample.csproj - -run: run-browser diff --git a/src/mono/sample/wasm/browser-mt-eventpipe/Program.cs b/src/mono/sample/wasm/browser-mt-eventpipe/Program.cs deleted file mode 100644 index 8683f673d92ef1..00000000000000 --- a/src/mono/sample/wasm/browser-mt-eventpipe/Program.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; -using System.Collections.Generic; -using System.Threading; -using System.Runtime.Versioning; - -namespace Sample -{ - public class Test - { - public static void Main(string[] args) - { - Console.WriteLine ("Hello, World!"); - } - - [MethodImpl(MethodImplOptions.NoInlining)] - [SupportedOSPlatform("browser")] // ask the analyzer to warn if we use APIs not supported on browser-wasm - public static int TestMeaning() - { - List myList = new List{ 1, 2, 3, 4 }; - Console.WriteLine(myList); - - Thread t = new Thread(new ThreadStart(ThreadFuncTest)); - t.Start(); - - for (int i = 0; i < 5; i++) - { - Console.WriteLine("Main Thread is doing stuff too... " + i.ToString()); - Thread.Sleep(100); - GC.Collect(); - } - - return 42; - } - - public static void ThreadFuncTest() - { - Console.WriteLine("Hello from another thread"); - - for (int i = 0; i < 5; i++) - { - Console.WriteLine("Sleeping from another thread: " + i.ToString()); - Thread.Sleep(100); - GC.Collect(); - } - } - } -} diff --git a/src/mono/sample/wasm/browser-mt-eventpipe/Wasm.Browser.ThreadsEP.Sample.csproj b/src/mono/sample/wasm/browser-mt-eventpipe/Wasm.Browser.ThreadsEP.Sample.csproj deleted file mode 100644 index 514d8ca176e915..00000000000000 --- a/src/mono/sample/wasm/browser-mt-eventpipe/Wasm.Browser.ThreadsEP.Sample.csproj +++ /dev/null @@ -1,42 +0,0 @@ - - - true - main.js - true - embedded - 1 - true - true - $(ExecXHarnessCmd) wasm test-browser --app=. --browser=Chrome $(XHarnessBrowserPathArg) --html-file=index.html --output-directory=$(XHarnessOutput) -- $(MSBuildProjectName).dll - true - - - - - - - - - <_SampleProject>Wasm.Browser.ThreadsEP.Sample.csproj - - - - - true - - - - - - - - - - - - - diff --git a/src/mono/sample/wasm/browser-mt-eventpipe/index.html b/src/mono/sample/wasm/browser-mt-eventpipe/index.html deleted file mode 100644 index e3b30951b6571e..00000000000000 --- a/src/mono/sample/wasm/browser-mt-eventpipe/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - Sample event pipe - - - - - - - - - Answer to the Ultimate Question of Life, the Universe, and Everything is : - - - - - \ No newline at end of file diff --git a/src/mono/sample/wasm/browser-mt-eventpipe/main.js b/src/mono/sample/wasm/browser-mt-eventpipe/main.js deleted file mode 100644 index a3c863349ae5cb..00000000000000 --- a/src/mono/sample/wasm/browser-mt-eventpipe/main.js +++ /dev/null @@ -1,63 +0,0 @@ -import createDotnetRuntime from "./dotnet.js"; - -function wasm_exit(exit_code, reason) { - /* Set result in a tests_done element, to be read by xharness in runonly CI test */ - const tests_done_elem = document.createElement("label"); - tests_done_elem.id = "tests_done"; - tests_done_elem.innerHTML = exit_code.toString(); - if (exit_code) tests_done_elem.style.background = "red"; - document.body.appendChild(tests_done_elem); - - if (reason) console.error(reason); - console.log(`WASM EXIT ${exit_code}`); -} - -function Uint8ToString(u8a) { - var CHUNK_SZ = 0x8000; - var c = []; - for (var i = 0; i < u8a.length; i += CHUNK_SZ) { - c.push(String.fromCharCode.apply(null, u8a.subarray(i, i + CHUNK_SZ))); - } - return c.join(""); -} - -async function main() { - const { MONO, BINDING, Module, runtimeBuildInfo } = await createDotnetRuntime(() => { - console.log('user code in createDotnetRuntime') - return { - disableDotnet6Compatibility: true, - configSrc: "./mono-config.json", - preInit: () => { console.log('user code Module.preInit') }, - preRun: () => { console.log('user code Module.preRun') }, - onRuntimeInitialized: () => { console.log('user code Module.onRuntimeInitialized') }, - postRun: () => { console.log('user code Module.postRun') }, - } - }); - globalThis.__Module = Module; - globalThis.MONO = MONO; - console.log('after createDotnetRuntime') - - try { - const testMeaning = BINDING.bind_static_method("[Wasm.Browser.ThreadsEP.Sample] Sample.Test:TestMeaning"); - const ret = testMeaning(); - document.getElementById("out").innerHTML = `${ret} as computed on dotnet ver ${runtimeBuildInfo.productVersion}`; - - console.debug(`ret: ${ret}`); - - let exit_code = ret == 42 ? 0 : 1; - Module._mono_wasm_exit(exit_code); - - wasm_exit(exit_code); - } catch (err) { - console.log(`WASM ERROR ${err}`); - - var b = Module.FS.readFile('/trace.nettrace'); - var bits = btoa((Uint8ToString(b))); - - window.open("data:application/octet-stream;base64," + bits); - - wasm_exit(2, err); - } -} - -setTimeout(main, 10000); diff --git a/src/mono/wasm/runtime/diagnostics/browser/file-session.ts b/src/mono/wasm/runtime/diagnostics/browser/file-session.ts deleted file mode 100644 index 0e935eb471066f..00000000000000 --- a/src/mono/wasm/runtime/diagnostics/browser/file-session.ts +++ /dev/null @@ -1,109 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// An EventPipe session object represents a single diagnostic tracing session that is collecting -/// events from the runtime and managed libraries. There may be multiple active sessions at the same time. -/// Each session subscribes to a number of providers and will collect events from the time that start() is called, until stop() is called. -/// Upon completion the session saves the events to a file on the VFS. -/// The data can then be retrieved as Blob. -import { EventPipeSessionID, EventPipeSessionOptions } from "../../types"; -import { EventPipeSessionIDImpl } from "../shared/types"; -import { createEventPipeFileSession } from "../shared/create-session"; -import { Module } from "../../imports"; -import cwraps from "../../cwraps"; - -export interface EventPipeSession { - // session ID for debugging logging only - get sessionID(): EventPipeSessionID; - start(): void; - stop(): void; - getTraceBlob(): Blob; -} - -// internal session state of the JS instance -enum State { - Initialized, - Started, - Done, -} - -/// An EventPipe session that saves the event data to a file in the VFS. -class EventPipeFileSession implements EventPipeSession { - protected _state: State; - private _sessionID: EventPipeSessionIDImpl; - private _tracePath: string; // VFS file path to the trace file - - get sessionID(): bigint { return BigInt(this._sessionID); } - - constructor(sessionID: EventPipeSessionIDImpl, tracePath: string) { - this._state = State.Initialized; - this._sessionID = sessionID; - this._tracePath = tracePath; - console.debug(`MONO_WASM: EventPipe session ${this.sessionID} created`); - } - - start = () => { - if (this._state !== State.Initialized) { - throw new Error(`MONO_WASM: EventPipe session ${this.sessionID} already started`); - } - this._state = State.Started; - start_streaming(this._sessionID); - console.debug(`MONO_WASM: EventPipe session ${this.sessionID} started`); - }; - - stop = () => { - if (this._state !== State.Started) { - throw new Error(`cannot stop an EventPipe session in state ${this._state}, not 'Started'`); - } - this._state = State.Done; - stop_streaming(this._sessionID); - console.debug(`MONO_WASM: EventPipe session ${this.sessionID} stopped`); - }; - - getTraceBlob = () => { - if (this._state !== State.Done) { - throw new Error(`session is in state ${this._state}, not 'Done'`); - } - const data = Module.FS_readFile(this._tracePath, { encoding: "binary" }) as Uint8Array; - return new Blob([data], { type: "application/octet-stream" }); - }; -} - -function start_streaming(sessionID: EventPipeSessionIDImpl): void { - cwraps.mono_wasm_event_pipe_session_start_streaming(sessionID); -} - -function stop_streaming(sessionID: EventPipeSessionIDImpl): void { - cwraps.mono_wasm_event_pipe_session_disable(sessionID); -} - -// a conter for the number of sessions created -let totalSessions = 0; - -export function makeEventPipeSession(options?: EventPipeSessionOptions): EventPipeSession | null { - const defaultRundownRequested = true; - const defaultProviders = ""; // empty string means use the default providers - const defaultBufferSizeInMB = 1; - - const rundown = options?.collectRundownEvents ?? defaultRundownRequested; - const providers = options?.providers ?? defaultProviders; - - // The session trace is saved to a file in the VFS. The file name doesn't matter, - // but we'd like it to be distinct from other traces. - const tracePath = `/trace-${totalSessions++}.nettrace`; - - const sessionOptions = { - rundownRequested: rundown, - providers: providers, - bufferSizeInMB: defaultBufferSizeInMB, - }; - - const success = createEventPipeFileSession(tracePath, sessionOptions); - - if (success === false) - return null; - const sessionID = success; - - return new EventPipeFileSession(sessionID, tracePath); -} - - diff --git a/src/mono/wasm/runtime/diagnostics/browser/session-options-builder.ts b/src/mono/wasm/runtime/diagnostics/browser/session-options-builder.ts deleted file mode 100644 index 5aa76b04ae6e13..00000000000000 --- a/src/mono/wasm/runtime/diagnostics/browser/session-options-builder.ts +++ /dev/null @@ -1,122 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import { EventPipeSessionOptions } from "../../types"; - -export const eventLevel = { - LogAlways: 0, - Critical: 1, - Error: 2, - Warning: 3, - Informational: 4, - Verbose: 5, -} as const; - -export type EventLevel = typeof eventLevel; - -type UnnamedProviderConfiguration = Partial<{ - keywordMask: string | 0; - level: number; - args: string; -}> - -/// The configuration for an individual provider. Each provider configuration has the name of the provider, -/// the level of events to collect, and a string containing a 32-bit hexadecimal mask (without an "0x" prefix) of -/// the "keywords" to filter a subset of the events. The keyword mask may be the number 0 or "" to skips the filtering. -/// See https://docs.microsoft.com/en-us/dotnet/core/diagnostics/well-known-event-providers for a list of known providers. -/// Additional providers may be added by applications or libraries that implement an EventSource subclass. -/// See https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.tracing.eventsource?view=net-6.0 -/// -/// Some providers also have an "args" string in an arbitrary format. For example the EventSource providers that -/// include EventCounters have a "EventCounterIntervalSec=NNN" argument that specified how often the counters of -/// the event source should be polled. -export interface ProviderConfiguration extends UnnamedProviderConfiguration { - name: string; -} - -const runtimeProviderName = "Microsoft-Windows-DotNETRuntime"; -const runtimePrivateProviderName = "Microsoft-Windows-DotNETRuntimePrivate"; -const sampleProfilerProviderName = "Microsoft-DotNETCore-SampleProfiler"; - -const runtimeProviderDefault: ProviderConfiguration = { - name: runtimeProviderName, - keywordMask: "4c14fccbd", - level: eventLevel.Verbose, -}; - -const runtimePrivateProviderDefault: ProviderConfiguration = { - name: runtimePrivateProviderName, - keywordMask: "4002000b", - level: eventLevel.Verbose, -}; - -const sampleProfilerProviderDefault: ProviderConfiguration = { - name: sampleProfilerProviderName, - keywordMask: "0", - level: eventLevel.Verbose, -}; - -/// A helper class to create EventPipeSessionOptions -export class SessionOptionsBuilder { - private _rundown?: boolean; - private _providers: ProviderConfiguration[]; - /// Create an empty builder. Prefer to use SessionOptionsBuilder.Empty - constructor() { - this._providers = []; - } - /// Gets a builder with no providers. - static get Empty(): SessionOptionsBuilder { return new SessionOptionsBuilder(); } - /// Gets a builder with default providers and rundown events enabled. - /// See https://docs.microsoft.com/en-us/dotnet/core/diagnostics/eventpipe#trace-using-environment-variables - static get DefaultProviders(): SessionOptionsBuilder { - return this.Empty.addRuntimeProvider().addRuntimePrivateProvider().addSampleProfilerProvider(); - } - /// Change whether to collect rundown events. - /// Certain providers may need rundown events to be collected in order to provide useful diagnostic information. - setRundownEnabled(enabled: boolean): SessionOptionsBuilder { - this._rundown = enabled; - return this; - } - /// Add a provider configuration to the builder. - addProvider(provider: ProviderConfiguration): SessionOptionsBuilder { - this._providers.push(provider); - return this; - } - /// Add the Microsoft-Windows-DotNETRuntime provider. Use override options to change the event level or keyword mask. - /// The default is { keywordMask: "4c14fccbd", level: eventLevel.Verbose } - addRuntimeProvider(overrideOptions?: UnnamedProviderConfiguration): SessionOptionsBuilder { - const options = { ...runtimeProviderDefault, ...overrideOptions }; - this._providers.push(options); - return this; - } - /// Add the Microsoft-Windows-DotNETRuntimePrivate provider. Use override options to change the event level or keyword mask. - /// The default is { keywordMask: "4002000b", level: eventLevel.Verbose} - addRuntimePrivateProvider(overrideOptions?: UnnamedProviderConfiguration): SessionOptionsBuilder { - const options = { ...runtimePrivateProviderDefault, ...overrideOptions }; - this._providers.push(options); - return this; - } - /// Add the Microsoft-DotNETCore-SampleProfiler. Use override options to change the event level or keyword mask. - // The default is { keywordMask: 0, level: eventLevel.Verbose } - addSampleProfilerProvider(overrideOptions?: UnnamedProviderConfiguration): SessionOptionsBuilder { - const options = { ...sampleProfilerProviderDefault, ...overrideOptions }; - this._providers.push(options); - return this; - } - /// Create an EventPipeSessionOptions from the builder. - build(): EventPipeSessionOptions { - const providers = this._providers.map(p => { - const name = p.name; - const keywordMask = "" + (p?.keywordMask ?? ""); - const level = p?.level ?? eventLevel.Verbose; - const args = p?.args ?? ""; - const maybeArgs = args != "" ? `:${args}` : ""; - return `${name}:${keywordMask}:${level}${maybeArgs}`; - }); - return { - collectRundownEvents: this._rundown, - providers: providers.join(",") - }; - } -} - diff --git a/src/mono/wasm/runtime/diagnostics/index.ts b/src/mono/wasm/runtime/diagnostics/index.ts index 68f79ed9f0163e..4987795e001677 100644 --- a/src/mono/wasm/runtime/diagnostics/index.ts +++ b/src/mono/wasm/runtime/diagnostics/index.ts @@ -4,83 +4,20 @@ import monoWasmThreads from "consts:monoWasmThreads"; import type { DiagnosticOptions, - EventPipeSessionOptions, -} from "../types"; +} from "./shared/types"; import { is_nullish } from "../types"; import type { VoidPtr } from "../types/emscripten"; import { getController, startDiagnosticServer } from "./browser/controller"; import * as memory from "../memory"; -export type { ProviderConfiguration } from "./browser/session-options-builder"; -import { - eventLevel, EventLevel, - SessionOptionsBuilder, -} from "./browser/session-options-builder"; -import { EventPipeSession, makeEventPipeSession } from "./browser/file-session"; - -export interface Diagnostics { - eventLevel: EventLevel; - SessionOptionsBuilder: typeof SessionOptionsBuilder; - - createEventPipeSession(options?: EventPipeSessionOptions): EventPipeSession | null; - getStartupSessions(): (EventPipeSession | null)[]; -} - -let startup_session_configs: EventPipeSessionOptions[] = []; -let startup_sessions: (EventPipeSession | null)[] | null = null; // called from C on the main thread export function mono_wasm_event_pipe_early_startup_callback(): void { if (monoWasmThreads) { - if (startup_session_configs === null || startup_session_configs.length == 0) { - return; - } - console.debug("MONO_WASM: diagnostics: setting startup sessions based on startup session configs", startup_session_configs); - startup_sessions = startup_session_configs.map(config => createAndStartEventPipeSession(config)); - startup_session_configs = []; - } -} - - -function createAndStartEventPipeSession(options: (EventPipeSessionOptions)): EventPipeSession | null { - const session = makeEventPipeSession(options); - if (session === null) { - return null; - } - session.start(); - - return session; -} - -function getDiagnostics(): Diagnostics { - if (monoWasmThreads) { - return { - /// An enumeration of the level (higher value means more detail): - /// LogAlways: 0, - /// Critical: 1, - /// Error: 2, - /// Warning: 3, - /// Informational: 4, - /// Verbose: 5, - eventLevel: eventLevel, - /// A builder for creating an EventPipeSessionOptions instance. - SessionOptionsBuilder: SessionOptionsBuilder, - /// Creates a new EventPipe session that will collect trace events from the runtime and managed libraries. - /// Use the options to control the kinds of events to be collected. - /// Multiple sessions may be created and started at the same time. - createEventPipeSession: makeEventPipeSession, - getStartupSessions(): (EventPipeSession | null)[] { - return Array.from(startup_sessions || []); - }, - }; - } else { - return undefined as unknown as Diagnostics; + return; } } -/// APIs for working with .NET diagnostics from JavaScript. -export const diagnostics: Diagnostics = getDiagnostics(); - // Initialization flow /// * The runtime calls configure_diagnostics with options from MonoConfig /// * We start the diagnostic server which connects to the host and waits for some configurations (an IPC CollectTracing command) @@ -96,21 +33,16 @@ let diagnosticsServerEnabled = false; let diagnosticsInitialized = false; -export async function mono_wasm_init_diagnostics(opts: "env" | DiagnosticOptions): Promise { +export async function mono_wasm_init_diagnostics(): Promise { if (diagnosticsInitialized) return; if (!monoWasmThreads) { - console.warn("MONO_WASM: ignoring diagnostics options because this runtime does not support diagnostics", opts); + console.warn("MONO_WASM: ignoring diagnostics options because this runtime does not support diagnostics"); return; } else { - let options: DiagnosticOptions | null; - if (opts === "env") { - options = diagnostic_options_from_environment(); - if (!options) - return; - } else { - options = opts; - } + const options = diagnostic_options_from_environment(); + if (!options) + return; diagnosticsInitialized = true; if (!is_nullish(options?.server)) { if (options.server.connectUrl === undefined || typeof (options.server.connectUrl) !== "string") { @@ -126,8 +58,6 @@ export async function mono_wasm_init_diagnostics(opts: "env" | DiagnosticOptions } } } - const sessions = options?.sessions ?? []; - startup_session_configs.push(...sessions); } } @@ -221,4 +151,3 @@ export function mono_wasm_diagnostic_server_on_runtime_server_init(out_options: } } -export default diagnostics; diff --git a/src/mono/wasm/runtime/diagnostics/shared/types.ts b/src/mono/wasm/runtime/diagnostics/shared/types.ts index af5de7c4729374..ef2526ff8e9809 100644 --- a/src/mono/wasm/runtime/diagnostics/shared/types.ts +++ b/src/mono/wasm/runtime/diagnostics/shared/types.ts @@ -3,3 +3,14 @@ export type EventPipeSessionIDImpl = number; +/// Options to configure EventPipe sessions that will be created and started at runtime startup +export type DiagnosticOptions = { + /// If true, the diagnostic server will be started. If "wait", the runtime will wait at startup until a diagnsotic session connects to the server + server?: DiagnosticServerOptions, +} + +/// Options to configure the diagnostic server +export type DiagnosticServerOptions = { + connectUrl: string, // websocket URL to connect to. + suspend: string | boolean, // if true, the server will suspend the app when it starts until a diagnostic tool tells the runtime to resume. +} diff --git a/src/mono/wasm/runtime/startup.ts b/src/mono/wasm/runtime/startup.ts index 051c0a796c5e87..c26bdf352a0bb3 100644 --- a/src/mono/wasm/runtime/startup.ts +++ b/src/mono/wasm/runtime/startup.ts @@ -330,7 +330,7 @@ async function mono_wasm_after_user_runtime_initialized(): Promise { } // for Blazor, init diagnostics after their "onRuntimeInitalized" sets env variables, but before their postRun callback (which calls mono_wasm_load_runtime) if (MonoWasmThreads) { - await mono_wasm_init_diagnostics("env"); + await mono_wasm_init_diagnostics(); } if (runtimeHelpers.diagnosticTracing) console.debug("MONO_WASM: Initializing mono runtime"); @@ -540,7 +540,7 @@ async function _apply_configuration_from_args() { mono_wasm_init_coverage_profiler(config.coverageProfilerOptions); // for non-Blazor, init diagnostics after environment variables are set if (MonoWasmThreads) { - await mono_wasm_init_diagnostics("env"); + await mono_wasm_init_diagnostics(); } } diff --git a/src/mono/wasm/runtime/types.ts b/src/mono/wasm/runtime/types.ts index e11d7efe6a36f6..271edd7f14595f 100644 --- a/src/mono/wasm/runtime/types.ts +++ b/src/mono/wasm/runtime/types.ts @@ -111,7 +111,7 @@ export interface AssetEntry extends ResourceRequest { export type AssetBehaviours = "resource" // load asset as a managed resource assembly - | "assembly" // load asset as a managed assembly + | "assembly" // load asset as a managed assembly | "pdb" // load asset as a managed debugging information | "heap" // store asset into the native heap | "icu" // load asset as an ICU data archive @@ -159,30 +159,6 @@ export type CoverageProfilerOptions = { sendTo?: string // should be in the format ::, default: 'WebAssembly.Runtime::DumpCoverageProfileData' (DumpCoverageProfileData stores the data into INTERNAL.coverage_profile_data.) } -/// Options to configure EventPipe sessions that will be created and started at runtime startup -export type DiagnosticOptions = { - /// An array of sessions to start at runtime startup - sessions?: EventPipeSessionOptions[], - /// If true, the diagnostic server will be started. If "wait", the runtime will wait at startup until a diagnsotic session connects to the server - server?: DiagnosticServerOptions, -} - -/// Options to configure the event pipe session -/// The recommended method is to MONO.diagnostics.SesisonOptionsBuilder to create an instance of this type -export interface EventPipeSessionOptions { - /// Whether to collect additional details (such as method and type names) at EventPipeSession.stop() time (default: true) - /// This is required for some use cases, and may allow some tools to better understand the events. - collectRundownEvents?: boolean; - /// The providers that will be used by this session. - /// See https://docs.microsoft.com/en-us/dotnet/core/diagnostics/eventpipe#trace-using-environment-variables - providers: string; -} - -/// Options to configure the diagnostic server -export type DiagnosticServerOptions = { - connectUrl: string, // websocket URL to connect to. - suspend: string | boolean, // if true, the server will suspend the app when it starts until a diagnostic tool tells the runtime to resume. -} // how we extended emscripten Module export type DotnetModule = EmscriptenModule & DotnetModuleConfig;