|
1 | 1 | // Licensed to the .NET Foundation under one or more agreements.
|
2 | 2 | // The .NET Foundation licenses this file to you under the MIT license.
|
3 | 3 |
|
4 |
| -import type { CharPtr, VoidPtr } from "./types/emscripten"; |
5 |
| - |
6 | 4 | import { ENVIRONMENT_IS_WEB, mono_assert, runtimeHelpers } from "./globals";
|
7 | 5 | import { MonoMethod, AOTProfilerOptions, BrowserProfilerOptions, LogProfilerOptions } from "./types/internal";
|
8 | 6 | import { profiler_c_functions as cwraps } from "./cwraps";
|
@@ -46,7 +44,14 @@ export function mono_wasm_init_browser_profiler (options: BrowserProfilerOptions
|
46 | 44 | export function mono_wasm_init_log_profiler (options: LogProfilerOptions): void {
|
47 | 45 | mono_assert(runtimeHelpers.emscriptenBuildOptions.enableLogProfiler, "Log profiler is not enabled, please use <WasmProfilers>log;</WasmProfilers> in your project file.");
|
48 | 46 | mono_assert(options.takeHeapshot, "Log profiler is not enabled, the takeHeapshot method must be defined in LogProfilerOptions.takeHeapshot");
|
49 |
| - cwraps.mono_wasm_profiler_init_log( (options.configuration || "log:alloc,output=output.mlpd") + `,take-heapshot-method=${options.takeHeapshot}`); |
| 47 | + if (!options.configuration) { |
| 48 | + options.configuration = "log:alloc,output=output.mlpd"; |
| 49 | + } |
| 50 | + if (options.takeHeapshot) { |
| 51 | + cwraps.mono_wasm_profiler_init_log(`${options.configuration},take-heapshot-method=${options.takeHeapshot}`); |
| 52 | + } else { |
| 53 | + cwraps.mono_wasm_profiler_init_log(options.configuration); |
| 54 | + } |
50 | 55 | }
|
51 | 56 |
|
52 | 57 | export const enum MeasuredBlock {
|
@@ -114,24 +119,3 @@ export function mono_wasm_profiler_record (method: MonoMethod, start: number): v
|
114 | 119 | }
|
115 | 120 | globalThis.performance.measure(methodName, options);
|
116 | 121 | }
|
117 |
| - |
118 |
| -/* eslint-disable @typescript-eslint/no-unused-vars */ |
119 |
| -export function ds_rt_websocket_create (urlPtr :CharPtr):number { |
120 |
| - throw new Error("TODO"); |
121 |
| -} |
122 |
| - |
123 |
| -export function ds_rt_websocket_send (client_socket :number, buffer:VoidPtr, bytes_to_write:number):number { |
124 |
| - throw new Error("TODO"); |
125 |
| -} |
126 |
| - |
127 |
| -export function ds_rt_websocket_poll (client_socket :number):number { |
128 |
| - throw new Error("TODO"); |
129 |
| -} |
130 |
| - |
131 |
| -export function ds_rt_websocket_recv (client_socket :number, buffer:VoidPtr, bytes_to_read:number):number { |
132 |
| - throw new Error("TODO"); |
133 |
| -} |
134 |
| - |
135 |
| -export function ds_rt_websocket_close (client_socket :number):number { |
136 |
| - throw new Error("TODO"); |
137 |
| -} |
0 commit comments