Changeset 9e7c502


Ignore:
Timestamp:
01/29/16 11:17:44 (6 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
pfring
Children:
9b9c279
Parents:
93c9aff (diff), b24d186 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'origin/libtrace4' into pfring

Location:
lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lib/libtrace_int.h

    rf72e13d r9e7c502  
    383383#define LIBTRACE_STAT_MAGIC 0x41
    384384
    385 void trace_fin_packet(libtrace_packet_t *packet);
     385void trace_fin_packet(libtrace_packet_t *packet, int updatetrace);
    386386void libtrace_zero_thread(libtrace_thread_t * t);
    387387void store_first_packet(libtrace_t *libtrace, libtrace_packet_t *packet, libtrace_thread_t *t);
  • lib/trace.c

    rf72e13d r9e7c502  
    557557        /* Finish the last packet we read - for backwards compatibility */
    558558        if (libtrace->last_packet)
    559                 trace_fin_packet(libtrace->last_packet);
     559                trace_fin_packet(libtrace->last_packet, 1);
    560560        assert(libtrace->last_packet == NULL);
    561561
     
    703703        /* Finish any the last packet we read - for backwards compatibility */
    704704        if (libtrace->last_packet)
    705                 trace_fin_packet(libtrace->last_packet);
     705                trace_fin_packet(libtrace->last_packet, 1);
    706706        assert(libtrace->last_packet == NULL);
    707707
     
    854854 * use trace_destroy_packet() for those diabolical purposes.
    855855 */
    856 void trace_fin_packet(libtrace_packet_t *packet) {
     856void trace_fin_packet(libtrace_packet_t *packet, int updatetrace) {
    857857        if (packet)
    858858        {
     
    866866                }
    867867
    868                 if (packet->trace) {
     868                if (updatetrace && packet->trace) {
    869869                        pthread_mutex_lock(&packet->trace->libtrace_lock);
    870870                        if (packet->trace->last_packet == packet)
     
    918918                 */
    919919                if (packet->trace == libtrace)
    920                         trace_fin_packet(packet);
     920                        trace_fin_packet(packet, 0);
    921921                do {
    922922                        size_t ret;
     
    941941                                if (filtret == 0) {
    942942                                        ++libtrace->filtered_packets;
    943                                         trace_fin_packet(packet);
     943                                        trace_fin_packet(packet, 0);
    944944                                        continue;
    945945                                }
     
    13201320
    13211321        /* Free the last packet */
    1322         trace_fin_packet(packet);
     1322        trace_fin_packet(packet, 0);
    13231323       
    13241324        /* Store the trace we are reading from into the packet opaque
  • lib/trace_parallel.c

    rd8b05b7 rb24d186  
    421421                dup = trace_copy_packet(pkt);
    422422                /* Release the external buffer */
    423                 trace_fin_packet(pkt);
     423                trace_fin_packet(pkt, 1);
    424424                /* Copy the duplicated packet over the existing */
    425425                memcpy(pkt, dup, sizeof(libtrace_packet_t));
     
    480480                if (trace->perpkt_cbs->message_packet)
    481481                        *packet = (*trace->perpkt_cbs->message_packet)(trace, t, trace->global_blob, t->user_data, *packet);
    482                 trace_fin_packet(*packet);
     482                trace_fin_packet(*packet, 0);
    483483        } else {
    484484                assert((*packet)->error == READ_TICK);
     
    12731273                        packets[i] = tmp;
    12741274                } else {
    1275                         trace_fin_packet(packets[i]);
     1275                        trace_fin_packet(packets[i], 0);
    12761276                }
    12771277        }
     
    13061306        if (libtrace->format->pread_packets) {
    13071307                int ret;
     1308                /*
    13081309                for (i = 0; i < (int) nb_packets; ++i) {
    13091310                        assert(i[packets]);
     
    13151316                        }
    13161317                }
     1318                */
    13171319                do {
    13181320                        ret=libtrace->format->pread_packets(libtrace, t,
     
    25512553        assert(packet);
    25522554        /* Always release any resources this might be holding */
    2553         trace_fin_packet(packet);
     2555        trace_fin_packet(packet, 0);
    25542556        libtrace_ocache_free(&libtrace->packet_freelist, (void **) &packet, 1, 1);
    25552557}
Note: See TracChangeset for help on using the changeset viewer.