Changeset 0a6638f for lib/trace.c
- Timestamp:
- 02/20/06 18:36:13 (16 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, 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:
- 5b91b48
- Parents:
- 8ee7caa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/trace.c
rdf338b3 r0a6638f 331 331 */ 332 332 333 structlibtrace_out_t *trace_create_output(const char *uri) {333 libtrace_out_t *trace_create_output(const char *uri) { 334 334 struct libtrace_out_t *libtrace = malloc(sizeof(struct libtrace_out_t)); 335 335 … … 382 382 assert( libtrace->fifo); 383 383 free(scan); 384 libtrace->started=false; 384 385 return libtrace; 385 386 } … … 403 404 404 405 libtrace->started=true; 406 return 0; 407 } 408 409 int trace_start_output(libtrace_out_t *libtrace) 410 { 411 assert(libtrace); 412 if (libtrace->format->start_output) { 413 int ret=libtrace->format->start_output(libtrace); 414 if (ret < 0) { 415 return ret; 416 } 417 } 418 419 libtrace->started=false; 405 420 return 0; 406 421 } … … 495 510 libtrace_packet_t *trace_create_packet() { 496 511 libtrace_packet_t *packet = calloc(1,sizeof(libtrace_packet_t)); 497 /* This used to malloc a packet! Why do we need to malloc a packet 498 * if we're doing zero copy? 499 */ 512 packet->buf_control=PACKET; 500 513 return packet; 501 514 } … … 525 538 assert(libtrace->started && "BUG: You must call libtrace_start() before trace_read_packet()\n"); 526 539 assert(packet); 540 assert((packet->buf_control==PACKET || packet->buf_control==EXTERNAL)&& 541 "BUG: You must allocate a packet using packet_create()"); 527 542 528 543 /* Store the trace we are reading from into the packet opaque … … 1555 1570 * @param errcode either an Econstant from libc, or a LIBTRACE_ERROR 1556 1571 * @param msg a plaintext error message 1572 * @internal 1557 1573 */ 1558 1574 void trace_set_err(int errcode,const char *msg,...)
Note: See TracChangeset
for help on using the changeset viewer.