summaryrefslogtreecommitdiff
path: root/vere/pkg/vere/tracy_test.c
blob: ef0f21415a5fcfce43e0d0eb70be0c60702ead8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <stdio.h>
#include <unistd.h>

#ifdef TRACY_ENABLE
#include "tracy/TracyC.h"
#endif

void test_function() {
#ifdef TRACY_ENABLE
    TracyCZone(ctx, 1);
    TracyCZoneName(ctx, "test_function", 13);
#endif
    
    printf("Testing Tracy integration - function called\n");
    
#ifdef TRACY_ENABLE
    TracyCMessageL("Test message from urbit");
#endif
    
    // Simulate some work
    for (int i = 0; i < 1000000; i++) {
        // Some CPU work for Tracy to profile
    }
    
#ifdef TRACY_ENABLE
    TracyCZoneEnd(ctx);
#endif
}

int main() {
    printf("Tracy test starting - connect Tracy profiler to localhost:8086\n");
    printf("Application will run for 10 seconds...\n");
    
    for (int frame = 0; frame < 100; frame++) {
#ifdef TRACY_ENABLE
        TracyCFrameMark;
#endif
        test_function();
        
        // Sleep for 100ms to make frames visible
        usleep(100000);
        
        if (frame % 10 == 0) {
            printf("Frame %d/100\n", frame);
        }
    }
    
    printf("Tracy integration test completed\n");
    return 0;
}