Changeset 6f8745b


Ignore:
Timestamp:
03/15/10 14:36:54 (11 years ago)
Author:
Perry Lorier <perry@…>
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:
9d6452b
Parents:
b4fd5bc
Message:

Understand more libtraceio debug options.

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/wandio.c

    rb4fd5bc r6f8745b  
    5555int force_directio_write = 0;
    5656int force_directio_read = 0;
    57 int use_threads = 1;
     57unsigned int use_threads = -1;
    5858
    5959uint64_t read_waits = 0;
    6060uint64_t write_waits = 0;
    6161
     62/** Parse an option.
     63 * stats -- Show summary stats
     64 * directwrite -- bypass the diskcache on write
     65 * directread -- bypass the diskcache on read
     66 * nothreads -- Don't use threads
     67 * threads=n -- Use a maximum of 'n' threads for thread farms
     68 */
    6269static void do_option(const char *option)
    6370{
     
    7279        else if (strcmp(option,"nothreads") == 0)
    7380                use_threads = 0;
     81        else if (strncmp(option,"threads=",8) == 0)
     82                use_threads = atoi(option+8);
    7483        else {
    7584                fprintf(stderr,"Unknown libtraceio debug option '%s'\n", option);
     
    194203{
    195204        iow_t *iow;
     205        parse_env();
    196206
    197207        assert ( compression_level >= 0 && compression_level <= 9 );
    198         fprintf(stderr,"Compression level= %d\n",compression_level);
    199         fprintf(stderr,"flags=%d\n",flags);
    200208
    201209        iow=stdio_wopen(filename);
     
    206214        if (compression_level != 0 &&
    207215            (flags & WANDIO_COMPRESS_MASK) == WANDIO_COMPRESS_ZLIB) {
    208                 fprintf(stderr,"GZip compression\n");
    209216                iow = zlib_wopen(iow,compression_level);
    210217        }
     
    213220        else if (compression_level != 0 &&
    214221            (flags & WANDIO_COMPRESS_MASK) == WANDIO_COMPRESS_LZO) {
    215                 fprintf(stderr,"Using LZO\n");
    216222                iow = lzo_wopen(iow,compression_level);
    217223        }
     
    220226        else if (compression_level != 0 &&
    221227            (flags & WANDIO_COMPRESS_MASK) == WANDIO_COMPRESS_BZ2) {
    222                 fprintf(stderr,"BZ compression\n");
    223228                iow = bz_wopen(iow,compression_level);
    224229        }
    225230#endif
    226         else if (compression_level != 0) {
    227                 fprintf(stderr,"Compression %d unavailable\n",flags);
    228         }
    229         else {
    230                 fprintf(stderr,"No compression requested\n");
    231         }
    232231        /* Open a threaded writer */
    233232        if (use_threads)
  • lib/wandio.h

    r5e26f1d r6f8745b  
    3737#include <stdio.h>
    3838#include <inttypes.h>
     39#include <stdbool.h>
    3940
    4041/** @file
     
    290291extern uint64_t write_waits;
    291292extern uint64_t read_waits;
     293extern unsigned int use_threads;
    292294/* @} */
    293295
Note: See TracChangeset for help on using the changeset viewer.