@@ -10,9 +10,9 @@ Subject: [PATCH] enable log profiler
10
10
src/mono/mono/profiler/CMakeLists.txt | 7 +++++++
11
11
src/mono/mono/profiler/helper.c | 6 ++++++
12
12
src/mono/mono/profiler/log.c | 18 +++++++++++++++++-
13
- src/mono/wasm /runtime/profiler.ts | 9 +++++++--
14
- src/mono/wasm /runtime/startup.ts | 6 +++++-
15
- src/mono/wasm /runtime/types/internal.ts | 5 +++++
13
+ src/mono/browser /runtime/profiler.ts | 9 +++++++--
14
+ src/mono/browser /runtime/startup.ts | 6 +++++-
15
+ src/mono/browser /runtime/types/internal.ts | 5 +++++
16
16
9 files changed, 51 insertions(+), 5 deletions(-)
17
17
18
18
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props
@@ -170,17 +170,17 @@ index 1aa33e9c40e..eff4aef5de0 100644
170
170
MONO_API void
171
171
mono_profiler_init_log (const char *desc);
172
172
173
- diff --git a/src/mono/wasm /runtime/profiler.ts b/src/mono/wasm /runtime/profiler.ts
173
+ diff --git a/src/mono/browser /runtime/profiler.ts b/src/mono/browser /runtime/profiler.ts
174
174
index da627b50ec4..c2e4db95746 100644
175
- --- a/src/mono/wasm /runtime/profiler.ts
176
- +++ b/src/mono/wasm /runtime/profiler.ts
175
+ --- a/src/mono/browser /runtime/profiler.ts
176
+ +++ b/src/mono/browser /runtime/profiler.ts
177
177
@@ -1,8 +1,8 @@
178
178
// Licensed to the .NET Foundation under one or more agreements.
179
179
// The .NET Foundation licenses this file to you under the MIT license.
180
180
181
- - import { ENVIRONMENT_IS_WEB, linkerEnableAotProfiler, linkerEnableBrowserProfiler, mono_assert, runtimeHelpers } from "./globals";
181
+ - import { ENVIRONMENT_IS_WEB, mono_assert, runtimeHelpers } from "./globals";
182
182
- import { MonoMethod, AOTProfilerOptions, BrowserProfilerOptions } from "./types/internal";
183
- + import { ENVIRONMENT_IS_WEB, linkerEnableAotProfiler, linkerEnableBrowserProfiler, mono_assert, Module, runtimeHelpers } from "./globals";
183
+ + import { ENVIRONMENT_IS_WEB, mono_assert, Module, runtimeHelpers } from "./globals";
184
184
+ import { MonoMethod, AOTProfilerOptions, BrowserProfilerOptions, LogProfilerOptions } from "./types/internal";
185
185
import { profiler_c_functions as cwraps } from "./cwraps";
186
186
import { utf8ToString } from "./strings";
@@ -195,12 +195,12 @@ index da627b50ec4..c2e4db95746 100644
195
195
+ Module.ccall("mono_wasm_load_profiler_log", null, ["string"], [options.configuration]);
196
196
+ }
197
197
\ No newline at end of file
198
- diff --git a/src/mono/wasm /runtime/startup.ts b/src/mono/wasm /runtime/startup.ts
198
+ diff --git a/src/mono/browser /runtime/startup.ts b/src/mono/browser /runtime/startup.ts
199
199
index e9eee44f0de..3f867a9741e 100644
200
- --- a/src/mono/wasm /runtime/startup.ts
201
- +++ b/src/mono/wasm /runtime/startup.ts
200
+ --- a/src/mono/browser /runtime/startup.ts
201
+ +++ b/src/mono/browser /runtime/startup.ts
202
202
@@ -9,7 +9,7 @@ import { disableLegacyJsInterop, ENVIRONMENT_IS_PTHREAD, exportedRuntimeAPI, INT
203
- import cwraps, { init_c_exports } from "./cwraps";
203
+ import cwraps, { init_c_exports, threads_c_functions as tcwraps } from "./cwraps";
204
204
import { mono_wasm_raise_debug_event, mono_wasm_runtime_ready } from "./debug";
205
205
import { toBase64StringImpl } from "./base64";
206
206
- import { mono_wasm_init_aot_profiler, mono_wasm_init_browser_profiler } from "./profiler";
@@ -216,13 +216,13 @@ index e9eee44f0de..3f867a9741e 100644
216
216
+ mono_wasm_init_log_profiler(runtimeHelpers.config.logProfilerOptions);
217
217
+ }
218
218
+
219
- // Threads early are not supported with memory snapshot. See below how we enable them later.
220
- // Please disable startupMemoryCache in order to be able to diagnose or pause runtime startup.
221
- if (MonoWasmThreads && !runtimeHelpers.config.startupMemoryCache) {
222
- diff --git a/src/mono/wasm /runtime/types/internal.ts b/src/mono/wasm /runtime/types/internal.ts
219
+ if (WasmEnableThreads) {
220
+ runtimeHelpers.deputyWorker.thread!.postMessageToWorker({
221
+ type:"deputyThread",
222
+ diff --git a/src/mono/browser /runtime/types/internal.ts b/src/mono/browser /runtime/types/internal.ts
223
223
index f2dba23fe73..3e8e4372d66 100644
224
- --- a/src/mono/wasm /runtime/types/internal.ts
225
- +++ b/src/mono/wasm /runtime/types/internal.ts
224
+ --- a/src/mono/browser /runtime/types/internal.ts
225
+ +++ b/src/mono/browser /runtime/types/internal.ts
226
226
@@ -69,6 +69,7 @@ export function coerceNull<T extends ManagedPointer | NativePointer>(ptr: T | nu
227
227
assets?: AssetEntryInternal[],
228
228
runtimeOptions?: string[], // array of runtime options as strings
@@ -232,8 +232,8 @@ index f2dba23fe73..3e8e4372d66 100644
232
232
waitForDebugger?: number,
233
233
appendElementOnExit?: boolean
234
234
@@ -78,6 +79,10 @@ export type MonoConfigInternal = MonoConfig & {
235
- exitAfterSnapshot?: number
236
- loadAllSatelliteResources ?: boolean
235
+
236
+ jsThreadBlockingMode ?: JSThreadBlockingMode,
237
237
};
238
238
+
239
239
+ export type LogProfilerOptions = {
0 commit comments