|
|
| version 1.15, 2023/02/25 15:55:00 | version 1.15.22.1, 2026/05/19 15:47:47 |
|---|---|
| Line 15 intptr_t Kill[1]; | Line 15 intptr_t Kill[1]; |
| #ifdef AIO_SUPPORT | #ifdef AIO_SUPPORT |
| struct iovec iv[3], wiv[3], riv[3]; | struct iovec iv[3], wiv[3], riv[3]; |
| #endif | #endif |
| volatile uint64_t total; | |
| void *event(sched_task_t *arg) | void *event(sched_task_t *arg) |
| { | { |
| Line 158 void *sigt(sched_task_t *arg) | Line 159 void *sigt(sched_task_t *arg) |
| taskExit(arg, NULL); | taskExit(arg, NULL); |
| } | } |
| static void* | |
| prof(void *task, void *stage) | |
| { | |
| sched_task_t *t = task; | |
| struct timespec ts; | |
| static volatile uint64_t ns; | |
| clock_gettime(CLOCK_MONOTONIC, &ts); | |
| if (!stage) | |
| ns = (uint64_t) ts.tv_sec * 1000000000LL + ts.tv_nsec; | |
| else { | |
| ns = (uint64_t) ts.tv_sec * 1000000000LL + ts.tv_nsec - ns; | |
| printf("Task ran for %lu ns: id=%p type=%d call=%p -> #%ld\n", ns, | |
| TASK_ID(t), TASK_TYPE(t), TASK_FUNC(t), TASK_RET(t)); | |
| total += ns; | |
| } | |
| return NULL; | |
| } | |
| int | int |
| main(int argc, char **argv) | main(int argc, char **argv) |
| { | { |
| Line 202 main(int argc, char **argv) | Line 224 main(int argc, char **argv) |
| return 1; | return 1; |
| } | } |
| if (argc > 1) | |
| ROOT_PROFILING(root, prof); | |
| if (!schedTimer(root, timer, (void*) (intptr_t) ts.tv_sec, ts, NULL, 0)) { | if (!schedTimer(root, timer, (void*) (intptr_t) ts.tv_sec, ts, NULL, 0)) { |
| printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); | printf("Error:: #%d - %s\n", sched_GetErrno(), sched_GetError()); |
| return 4; | return 4; |
| Line 333 main(int argc, char **argv) | Line 358 main(int argc, char **argv) |
| close(fd); | close(fd); |
| close(f); | close(f); |
| if (argc > 1) | |
| printf("Total spend of time for all tasks = %lu\n", total); | |
| return 0; | return 0; |
| } | } |