- Timestamp:
- 03/05/15 15:44:30 (6 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- ab3fa18
- Parents:
- b023181
- Location:
- lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/combiner_ordered.c
rd994324 r62b3c4e 60 60 /* Get the minimum queue and then do stuff */ 61 61 libtrace_result_t r; 62 libtrace_generic_t gt = {.res = &r}; 62 63 63 64 ASSERT_RET (libtrace_deque_pop_front(&queues[min_queue], (void *) &r), == 1); 64 trace->reporter(trace, &r, NULL);65 trace->reporter(trace, MESSAGE_RESULT, gt, &trace->reporter_thread); 65 66 66 67 // We expect the key we read +1 now , todo put expected in our storage area -
lib/combiner_sorted.c
rd994324 r62b3c4e 58 58 for (a = 0; a < libtrace_vector_get_size(&queues[0]); ++a) { 59 59 libtrace_result_t r; 60 ASSERT_RET (libtrace_vector_get(&queues[0], a, (void *) &r), == 1); 61 trace->reporter(trace, &r, NULL); 60 libtrace_generic_t gt = {.res = &r}; 61 ASSERT_RET (libtrace_vector_get(&queues[0], a, (void *) &r), == 1); 62 trace->reporter(trace, MESSAGE_RESULT, gt, &trace->reporter_thread); 62 63 } 63 64 libtrace_vector_empty(&queues[0]); -
lib/combiner_unordered.c
rd994324 r62b3c4e 34 34 while (libtrace_deque_get_size(v) != 0) { 35 35 libtrace_result_t r; 36 libtrace_generic_t gt = {.res = &r}; 36 37 ASSERT_RET (libtrace_deque_pop_front(v, (void *) &r), == 1); 37 trace->reporter(trace, &r, NULL);38 trace->reporter(trace, MESSAGE_RESULT, gt, &trace->reporter_thread); 38 39 } 39 40 } -
lib/libtrace.h.in
r0ec8a7c r62b3c4e 3461 3461 /*@}*/ 3462 3462 3463 typedef struct libtrace_result_t libtrace_result_t; 3463 3464 /** 3464 3465 * A collection of types for convenience used in place of a … … 3471 3472 void *ptr; 3472 3473 libtrace_packet_t *pkt; 3474 libtrace_result_t *res; 3473 3475 3474 3476 /* C99 Integer types */ … … 3517 3519 3518 3520 /** Structure holding information about a result */ 3519 typedefstruct libtrace_result_t {3521 struct libtrace_result_t { 3520 3522 uint64_t key; 3521 3523 libtrace_generic_t value; 3522 3524 int type; 3523 } libtrace_result_t;3525 }; 3524 3526 #define RESULT_NORMAL 0 3525 3527 #define RESULT_PACKET 1 … … 3546 3548 libtrace_generic_t data, 3547 3549 libtrace_thread_t *sender); 3548 typedef void (*fn_reporter)(libtrace_t* trace, libtrace_result_t *r, libtrace_message_t *m); 3550 typedef void (*fn_reporter)(libtrace_t* trace, 3551 int mesg_code, 3552 libtrace_generic_t data, 3553 libtrace_thread_t *sender); 3549 3554 typedef uint64_t (*fn_hasher)(const libtrace_packet_t* packet, void *data); 3550 3555 … … 3619 3624 enum libtrace_messages { 3620 3625 MESSAGE_PACKET, 3626 MESSAGE_RESULT, 3621 3627 MESSAGE_STARTING, 3622 3628 MESSAGE_RESUMING, -
lib/trace_parallel.c
r0ec8a7c r62b3c4e 1035 1035 ASSERT_RET(pthread_mutex_unlock(&trace->libtrace_lock), == 0); 1036 1036 1037 message.code = MESSAGE_STARTING; 1038 message.sender = t; 1039 (*trace->reporter)(trace, NULL, &message); 1040 message.code = MESSAGE_RESUMING; 1041 (*trace->reporter)(trace, NULL, &message); 1037 (*trace->reporter)(trace, MESSAGE_STARTING, (libtrace_generic_t) {0}, t); 1038 (*trace->reporter)(trace, MESSAGE_RESUMING, (libtrace_generic_t) {0}, t); 1042 1039 1043 1040 while (!trace_finished(trace)) { … … 1056 1053 assert(trace->combiner.pause); 1057 1054 trace->combiner.pause(trace, &trace->combiner); 1058 message.code = MESSAGE_PAUSING; 1059 message.sender = t; 1060 (*trace->reporter)(trace, NULL, &message); 1055 (*trace->reporter)(trace, MESSAGE_PAUSING, (libtrace_generic_t) {0}, t); 1061 1056 trace_thread_pause(trace, t); 1062 message.code = MESSAGE_RESUMING; 1063 (*trace->reporter)(trace, NULL, &message); 1057 (*trace->reporter)(trace, MESSAGE_RESUMING, (libtrace_generic_t) {0}, t); 1064 1058 break; 1065 1066 (*trace->reporter)(trace, NULL, &message);1059 default: 1060 (*trace->reporter)(trace, message.code, message.additional, message.sender); 1067 1061 } 1068 1062 } … … 1072 1066 1073 1067 // GOODBYE 1074 message.code = MESSAGE_PAUSING; 1075 message.sender = t; 1076 (*trace->reporter)(trace, NULL, &message); 1077 message.code = MESSAGE_STOPPING; 1078 (*trace->reporter)(trace, NULL, &message); 1068 (*trace->reporter)(trace, MESSAGE_PAUSING, (libtrace_generic_t) {0}, t); 1069 (*trace->reporter)(trace, MESSAGE_STOPPING, (libtrace_generic_t) {0}, t); 1079 1070 1080 1071 thread_change_state(trace, &trace->reporter_thread, THREAD_FINISHED, true);
Note: See TracChangeset
for help on using the changeset viewer.