Merge pull request #166 from gwsystems/154-mem

feat: add memory to sandbox log
main
Sean McBride 4 years ago committed by GitHub
commit 832d3ea465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,16 +0,0 @@
id,function,state,deadline,actual,queued,initializing,runnable,running,blocked,returned
0,lpd1():10000,Complete,50000,1045750,15,0,26,46516,999192,510
1,lpd1():10000,Complete,50000,1077003,4,0,23,76956,1000018,457
2,lpd1():10000,Complete,50000,1122135,4,0,27,121007,1001095,1194
3,lpd1():10000,Complete,50000,1066601,4,0,14,65484,1001097,408
4,lpd1():10000,Complete,50000,1063433,4,0,25,62343,1001061,525
5,lpd2():10001,Complete,50000,1073007,4,0,23,71896,1001082,403
6,lpd2():10001,Complete,50000,1091218,4,0,15,90076,1001122,510
7,lpd2():10001,Complete,50000,1080843,5,0,23,79721,1001093,493
8,lpd2():10001,Complete,50000,1084299,4,0,22,83160,1001111,503
9,lpd2():10001,Complete,50000,1094432,4,0,82,93309,1001036,715
10,lpd4():10002,Complete,50000,1076785,5,0,26,75576,1001177,434
11,lpd4():10002,Complete,50000,1098984,4,0,16,98936,1000026,561
12,lpd4():10002,Complete,50000,1083239,4,0,17,83188,1000029,493
13,lpd4():10002,Complete,50000,1095906,4,0,26,94940,1000935,564
14,lpd4():10002,Complete,50000,1087100,7,0,19,86005,1001067,514
1 id function state deadline actual queued initializing runnable running blocked returned
2 0 lpd1():10000 Complete 50000 1045750 15 0 26 46516 999192 510
3 1 lpd1():10000 Complete 50000 1077003 4 0 23 76956 1000018 457
4 2 lpd1():10000 Complete 50000 1122135 4 0 27 121007 1001095 1194
5 3 lpd1():10000 Complete 50000 1066601 4 0 14 65484 1001097 408
6 4 lpd1():10000 Complete 50000 1063433 4 0 25 62343 1001061 525
7 5 lpd2():10001 Complete 50000 1073007 4 0 23 71896 1001082 403
8 6 lpd2():10001 Complete 50000 1091218 4 0 15 90076 1001122 510
9 7 lpd2():10001 Complete 50000 1080843 5 0 23 79721 1001093 493
10 8 lpd2():10001 Complete 50000 1084299 4 0 22 83160 1001111 503
11 9 lpd2():10001 Complete 50000 1094432 4 0 82 93309 1001036 715
12 10 lpd4():10002 Complete 50000 1076785 5 0 26 75576 1001177 434
13 11 lpd4():10002 Complete 50000 1098984 4 0 16 98936 1000026 561
14 12 lpd4():10002 Complete 50000 1083239 4 0 17 83188 1000029 493
15 13 lpd4():10002 Complete 50000 1095906 4 0 26 94940 1000935 564
16 14 lpd4():10002 Complete 50000 1087100 7 0 19 86005 1001067 514

@ -34,7 +34,7 @@ struct sandbox {
void * linear_memory_start; /* after sandbox struct */ void * linear_memory_start; /* after sandbox struct */
uint32_t linear_memory_size; /* from after sandbox struct */ uint32_t linear_memory_size; /* from after sandbox struct */
uint64_t linear_memory_max_size; uint64_t linear_memory_max_size; /* 4GB */
void * stack_start; void * stack_start;
uint32_t stack_size; uint32_t stack_size;
@ -245,10 +245,15 @@ sandbox_print_perf(struct sandbox *sandbox)
uint32_t blocked_us = sandbox->blocked_duration / runtime_processor_speed_MHz; uint32_t blocked_us = sandbox->blocked_duration / runtime_processor_speed_MHz;
uint32_t returned_us = sandbox->returned_duration / runtime_processor_speed_MHz; uint32_t returned_us = sandbox->returned_duration / runtime_processor_speed_MHz;
fprintf(runtime_sandbox_perf_log, "%lu,%s():%d,%s,%u,%u,%u,%u,%u,%u,%u,%u\n", sandbox->id, /*
* Assumption: A sandbox is never able to free pages. If linear memory management
* becomes more intelligent, then peak linear memory size needs to be tracked
* seperately from current linear memory size.
*/
fprintf(runtime_sandbox_perf_log, "%lu,%s():%d,%s,%u,%u,%u,%u,%u,%u,%u,%u,%u\n", sandbox->id,
sandbox->module->name, sandbox->module->port, sandbox_state_stringify(sandbox->state), sandbox->module->name, sandbox->module->port, sandbox_state_stringify(sandbox->state),
sandbox->module->relative_deadline_us, total_time_us, queued_us, initializing_us, runnable_us, sandbox->module->relative_deadline_us, total_time_us, queued_us, initializing_us, runnable_us,
running_us, blocked_us, returned_us); running_us, blocked_us, returned_us, sandbox->linear_memory_size);
} }
static inline void static inline void

@ -213,8 +213,8 @@ runtime_configure()
printf("Logging Sandbox Performance to: %s\n", runtime_sandbox_perf_log_path); printf("Logging Sandbox Performance to: %s\n", runtime_sandbox_perf_log_path);
runtime_sandbox_perf_log = fopen(runtime_sandbox_perf_log_path, "w"); runtime_sandbox_perf_log = fopen(runtime_sandbox_perf_log_path, "w");
if (runtime_sandbox_perf_log == NULL) { perror("sandbox perf log"); } if (runtime_sandbox_perf_log == NULL) { perror("sandbox perf log"); }
fprintf(runtime_sandbox_perf_log, fprintf(runtime_sandbox_perf_log, "id,function,state,deadline,actual,queued,initializing,runnable,"
"id,function,state,deadline,actual,queued,initializing,runnable,running,blocked,returned\n"); "running,blocked,returned,memory\n");
} }
} }

Loading…
Cancel
Save