Changeset f258932
- Timestamp:
- 09/16/11 10:14:11 (10 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:
- 2cf2c2d
- Parents:
- 24ca459
- Location:
- lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/ior-thread.c
r948ed9a rf258932 59 59 /* 1MB Buffer */ 60 60 #define BUFFERSIZE (1024*1024) 61 #define BUFFERS 562 61 63 62 extern io_source_t thread_source; … … 72 71 struct state_t { 73 72 /* The collection of buffers (or slices) */ 74 struct buffer_t buffer[BUFFERS];73 struct buffer_t *buffer; 75 74 /* The index of the buffer to read into next */ 76 75 int in_buffer; … … 151 150 152 151 /* Move on to the next buffer */ 153 buffer=(buffer+1) % BUFFERS;152 buffer=(buffer+1) % max_buffers; 154 153 155 154 } while(running); … … 177 176 state->source = &thread_source; 178 177 178 DATA(state)->buffer = (struct buffer_t *)malloc(sizeof(struct buffer_t) * max_buffers); 179 179 DATA(state)->in_buffer = 0; 180 180 DATA(state)->offset = 0; … … 245 245 INBUFFER(state).state = EMPTY; 246 246 pthread_cond_signal(&DATA(state)->space_avail); 247 newbuffer = (newbuffer+1) % BUFFERS;247 newbuffer = (newbuffer+1) % max_buffers; 248 248 DATA(state)->offset = 0; 249 249 } -
lib/wandio.c
ra8d184f rf258932 56 56 int force_directio_read = 0; 57 57 unsigned int use_threads = -1; 58 unsigned int max_buffers = 50; 58 59 59 60 uint64_t read_waits = 0; … … 83 84 else if (strncmp(option,"threads=",8) == 0) 84 85 use_threads = atoi(option+8); 86 else if (strncmp(option,"buffers=",8) == 0) 87 max_buffers = atoi(option+8); 85 88 else { 86 89 fprintf(stderr,"Unknown libtraceio debug option '%s'\n", option); -
lib/wandio.h
r948ed9a rf258932 294 294 extern uint64_t read_waits; 295 295 extern unsigned int use_threads; 296 extern unsigned int max_buffers; 296 297 /* @} */ 297 298
Note: See TracChangeset
for help on using the changeset viewer.