Skip to content

Commit 25e943a

Browse files
committed
rundown for stack traces
1 parent a95f3cd commit 25e943a

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

src/mono/browser/runtime/diag/client-commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function commandSampleProfiler () {
9393
return commandCollectTracing2({
9494
circularBufferMB: 256,
9595
format: 1,
96-
requestRundown: false,
96+
requestRundown: true,
9797
providers: [
9898
{
9999
keywords: [

src/mono/sample/wasm/browser-eventpipe/Program.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System;
5+
using System.Threading.Tasks;
56
using System.Runtime.InteropServices.JavaScript;
67
using System.Runtime.InteropServices;
78
using System.Diagnostics.Tracing;
@@ -52,11 +53,31 @@ public static int Main(string[] args)
5253
internal static void SayHi()
5354
{
5455
WasmHelloEventSource.Instance.StartHello(counter);
55-
WasmHelloEventSource.Instance.CountCall();
5656
Console.WriteLine("Hi from C#!");
57+
for(int i = 0; i < 100000; i++)
58+
{
59+
WasmHelloEventSource.Instance.CountCall();
60+
}
5761
counter++;
62+
Console.WriteLine("Hello from C#!");
5863
WasmHelloEventSource.Instance.StopHello(counter, "counter"+counter);
5964
}
65+
66+
[JSExport]
67+
internal static Task SayHiAsync()
68+
{
69+
WasmHelloEventSource.Instance.StartHello(counter);
70+
Console.WriteLine("Hi from C#!");
71+
for(int i = 0; i < 100000; i++)
72+
{
73+
WasmHelloEventSource.Instance.CountCall();
74+
}
75+
counter++;
76+
Console.WriteLine("Hello from C#!");
77+
WasmHelloEventSource.Instance.StopHello(counter, "counter"+counter);
78+
79+
return Task.CompletedTask;
80+
}
6081
}
6182

6283

src/mono/sample/wasm/browser-eventpipe/main.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ try {
1818
//.withEnvironmentVariable("DOTNET_DiagnosticPorts", "download:gcdump")
1919
//.withEnvironmentVariable("DOTNET_DiagnosticPorts", "download:counters")
2020
.withEnvironmentVariable("DOTNET_DiagnosticPorts", "download:samples")
21-
.withEnvironmentVariable("MONO_LOG_LEVEL", "debug")
22-
.withEnvironmentVariable("MONO_LOG_MASK", "all")
21+
//.withEnvironmentVariable("MONO_LOG_LEVEL", "debug")
22+
//.withEnvironmentVariable("MONO_LOG_MASK", "all")
2323
.withElementOnExit()
2424
.withExitOnUnhandledError()
2525
.create();
@@ -34,6 +34,7 @@ try {
3434
const config = getConfig();
3535
const exports = await getAssemblyExports(config.mainAssemblyName);
3636
const sayHi = exports.Sample.Test.SayHi;
37+
const sayHiAsync = exports.Sample.Test.SayHiAsync;
3738

3839
document.querySelector("#hello-button").addEventListener("click", () => {
3940
try {
@@ -43,11 +44,15 @@ try {
4344
}
4445
});
4546

46-
setTimeout(() => {
47-
sayHi();
48-
}, 1000);
47+
sayHi();
48+
sayHiAsync();
4949

5050
await runMain();
51+
52+
setInterval(async () => {
53+
sayHi();
54+
await sayHiAsync();
55+
}, 0);
5156
}
5257
catch (err) {
5358
exit(2, err);

src/native/eventpipe/ds-ipc-pal-websocket.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,12 @@ ipc_alloc_ws_address (
185185
bool
186186
ds_ipc_pal_init (void)
187187
{
188-
printf("ds_ipc_pal_init\n");
189188
return true;
190189
}
191190

192191
bool
193192
ds_ipc_pal_shutdown (void)
194193
{
195-
printf("ds_ipc_pal_shutdown\n");
196194
return true;
197195
}
198196

@@ -202,8 +200,6 @@ ds_ipc_alloc (
202200
DiagnosticsIpcConnectionMode mode,
203201
ds_ipc_error_callback_func callback)
204202
{
205-
printf("ds_ipc_alloc %s\n", ipc_name);
206-
207203
DiagnosticsIpc *instance = NULL;
208204

209205
instance = ep_rt_object_alloc (DiagnosticsIpc);
@@ -298,8 +294,6 @@ ds_ipc_connect (
298294
ds_ipc_error_callback_func callback,
299295
bool *timed_out)
300296
{
301-
printf("ds_ipc_connect %s\n", ipc->server_url);
302-
303297
EP_ASSERT (ipc != NULL);
304298
EP_ASSERT (timed_out != NULL);
305299

@@ -381,8 +375,6 @@ ipc_stream_read_func (
381375
uint32_t *bytes_read,
382376
uint32_t timeout_ms)
383377
{
384-
printf("ipc_stream_read_func %d\n", bytes_to_read);
385-
386378
EP_ASSERT (object != NULL);
387379
EP_ASSERT (buffer != NULL);
388380
EP_ASSERT (bytes_read != NULL);
@@ -421,8 +413,6 @@ ipc_stream_write_func (
421413
uint32_t *bytes_written,
422414
uint32_t timeout_ms)
423415
{
424-
printf("ipc_stream_write_func %d\n", bytes_to_write);
425-
426416
EP_ASSERT (object != NULL);
427417
EP_ASSERT (buffer != NULL);
428418
EP_ASSERT (bytes_written != NULL);

0 commit comments

Comments
 (0)