Ignore:
Timestamp:
06/26/18 18:05:08 (3 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
cachetimestamps, develop, master, rc-4.0.4, ringdecrementfix, ringperformance
Children:
95ca714
Parents:
528a27c
Message:

Add new trace_flush_output() to public API

Can be used to force a libtrace output to dump any buffered output
to disk immediately.

Note that if the file is compressed or the output trace format
requires a trailer, the flushed file will still not be properly
readable afterwards as this will not result in any trailers
being written. You'll still have to close the file for that.

Mainly this is useful for ensuring that output file sizes grow
over time in situations where the amount of output is relatively
small, rather than staying stuck at 0 bytes until we either reach
1MB of output or the file is closed. For instance, you could have
a timer that calls trace_flush_output() every 30 seconds so that
the output file size will grow if any packets were written in the
last 30 seconds.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_legacy.c

    r2c457ec r32ee9b2  
    523523        NULL,                           /* fin_packet */
    524524        NULL,                           /* write_packet */
     525        NULL,                           /* flush_output */
    525526        legacyatm_get_link_type,        /* get_link_type */
    526527        NULL,                           /* get_direction */
     
    567568        NULL,                           /* fin_packet */
    568569        NULL,                           /* write_packet */
     570        NULL,                           /* flush_output */
    569571        legacyeth_get_link_type,        /* get_link_type */
    570572        NULL,                           /* get_direction */
     
    611613        NULL,                           /* fin_packet */
    612614        NULL,                           /* write_packet */
     615        NULL,                           /* flush_output */
    613616        legacypos_get_link_type,        /* get_link_type */
    614617        NULL,                           /* get_direction */
     
    655658        NULL,                           /* fin_packet */
    656659        NULL,                           /* write_packet */
     660        NULL,                           /* flush_output */
    657661        legacynzix_get_link_type,       /* get_link_type */
    658662        NULL,                           /* get_direction */
Note: See TracChangeset for help on using the changeset viewer.