unsigned statcache_hits;
/* write cache counters */
- unsigned writecache_read_hits;
- unsigned writecache_abutted_writes;
+ unsigned writecache_allocations;
+ unsigned writecache_deallocations;
+ unsigned writecache_cached_reads;
unsigned writecache_total_writes;
+ unsigned writecache_init_writes;
+ unsigned writecache_abutted_writes;
unsigned writecache_non_oplock_writes;
unsigned writecache_direct_writes;
- unsigned writecache_init_writes;
- unsigned writecache_flushed_writes[SAMBA_NUM_FLUSH_REASONS];
- unsigned writecache_num_perfect_writes;
- unsigned writecache_num_write_caches;
- unsigned writecache_allocated_write_caches;
+ unsigned writecache_cached_writes;
+ unsigned writecache_perfect_writes;
+ unsigned writecache_flush_reason_seek;
+ unsigned writecache_flush_reason_read;
+ unsigned writecache_flush_reason_readraw;
+ unsigned writecache_flush_reason_write;
+ unsigned writecache_flush_reason_oplock;
+ unsigned writecache_flush_reason_close;
+ unsigned writecache_flush_reason_sync;
+ unsigned writecache_flush_reason_sizechange;
};
extern struct profile_stats *profile_p;
memcpy(data, wcp->data + (pos - wcp->offset), n);
- DO_PROFILE_INC(writecache_read_hits);
+ DO_PROFILE_INC(writecache_cached_reads);
return True;
}
*/
if (n) {
+ DO_PROFILE_INC(writecache_cached_writes);
if (wcp->data_size) {
DO_PROFILE_INC(writecache_abutted_writes);
} else {
memcpy(wcp->data+wcp->data_size, data, n);
if (wcp->data_size == 0) {
wcp->offset = pos;
- DO_PROFILE_INC(writecache_num_write_caches);
}
wcp->data_size += n;
return;
}
- DO_PROFILE_DEC(writecache_allocated_write_caches);
+ DO_PROFILE_INC(writecache_deallocations);
allocated_write_caches--;
SMB_ASSERT(wcp->data_size == 0);
memset(wcp->data, '\0', wcp->alloc_size );
fsp->wcp = wcp;
- DO_PROFILE_INC(writecache_allocated_write_caches);
+ DO_PROFILE_INC(writecache_allocations);
allocated_write_caches++;
DEBUG(10,("setup_write_cache: File %s allocated write cache size %lu\n",
data_size = wcp->data_size;
wcp->data_size = 0;
- DO_PROFILE_DEC_INC(writecache_num_write_caches,writecache_flushed_writes[reason]);
+ switch (reason) {
+ case SAMBA_SEEK_FLUSH:
+ DO_PROFILE_INC(writecache_flush_reason_seek);
+ break;
+ case SAMBA_READ_FLUSH:
+ DO_PROFILE_INC(writecache_flush_reason_read);
+ break;
+ case SAMBA_WRITE_FLUSH:
+ DO_PROFILE_INC(writecache_flush_reason_write);;
+ break;
+ case SAMBA_READRAW_FLUSH:
+ DO_PROFILE_INC(writecache_flush_reason_readraw);
+ break;
+ case SAMBA_OPLOCK_RELEASE_FLUSH:
+ DO_PROFILE_INC(writecache_flush_reason_oplock);
+ break;
+ case SAMBA_CLOSE_FLUSH:
+ DO_PROFILE_INC(writecache_flush_reason_close);
+ break;
+ case SAMBA_SYNC_FLUSH:
+ DO_PROFILE_INC(writecache_flush_reason_sync);
+ break;
+ case SAMBA_SIZECHANGE_FLUSH:
+ DO_PROFILE_INC(writecache_flush_reason_sizechange);
+ break;
+ default:
+ break;
+ }
DEBUG(9,("flushing write cache: fd = %d, off=%.0f, size=%u\n",
fsp->fh->fd, (double)wcp->offset, (unsigned int)data_size));
if(data_size == wcp->alloc_size) {
- DO_PROFILE_INC(writecache_num_perfect_writes);
+ DO_PROFILE_INC(writecache_perfect_writes);
}
ret = real_write_file(NULL, fsp, wcp->data, wcp->offset, data_size);
profile_p->statcache_hits);
profile_separator("Write Cache");
- d_printf("read_hits: %u\n",
- profile_p->writecache_read_hits);
- d_printf("abutted_writes: %u\n",
- profile_p->writecache_abutted_writes);
+ d_printf("allocations: %u\n",
+ profile_p->writecache_allocations);
+ d_printf("deallocations: %u\n",
+ profile_p->writecache_deallocations);
+ d_printf("cached_reads: %u\n",
+ profile_p->writecache_cached_reads);
d_printf("total_writes: %u\n",
profile_p->writecache_total_writes);
+ d_printf("init_writes: %u\n",
+ profile_p->writecache_init_writes);
+ d_printf("abutted_writes: %u\n",
+ profile_p->writecache_abutted_writes);
d_printf("non_oplock_writes: %u\n",
profile_p->writecache_non_oplock_writes);
d_printf("direct_writes: %u\n",
profile_p->writecache_direct_writes);
- d_printf("init_writes: %u\n",
- profile_p->writecache_init_writes);
- d_printf("flushed_writes[SEEK]: %u\n",
- profile_p->writecache_flushed_writes[SAMBA_SEEK_FLUSH]);
- d_printf("flushed_writes[READ]: %u\n",
- profile_p->writecache_flushed_writes[SAMBA_READ_FLUSH]);
- d_printf("flushed_writes[WRITE]: %u\n",
- profile_p->writecache_flushed_writes[SAMBA_WRITE_FLUSH]);
- d_printf("flushed_writes[READRAW]: %u\n",
- profile_p->writecache_flushed_writes[SAMBA_READRAW_FLUSH]);
- d_printf("flushed_writes[OPLOCK_RELEASE]: %u\n",
- profile_p->writecache_flushed_writes[SAMBA_OPLOCK_RELEASE_FLUSH]);
- d_printf("flushed_writes[CLOSE]: %u\n",
- profile_p->writecache_flushed_writes[SAMBA_CLOSE_FLUSH]);
- d_printf("flushed_writes[SYNC]: %u\n",
- profile_p->writecache_flushed_writes[SAMBA_SYNC_FLUSH]);
- d_printf("flushed_writes[SIZECHANGE]: %u\n",
- profile_p->writecache_flushed_writes[SAMBA_SIZECHANGE_FLUSH]);
- d_printf("num_perfect_writes: %u\n",
- profile_p->writecache_num_perfect_writes);
- d_printf("num_write_caches: %u\n",
- profile_p->writecache_num_write_caches);
- d_printf("allocated_write_caches: %u\n",
- profile_p->writecache_allocated_write_caches);
+ d_printf("cached_writes: %u\n",
+ profile_p->writecache_cached_writes);
+ d_printf("perfect_writes: %u\n",
+ profile_p->writecache_perfect_writes);
+ d_printf("flush_reason_seek: %u\n",
+ profile_p->writecache_flush_reason_seek);
+ d_printf("flush_reason_read: %u\n",
+ profile_p->writecache_flush_reason_read);
+ d_printf("flush_reason_readraw: %u\n",
+ profile_p->writecache_flush_reason_readraw);
+ d_printf("flush_reason_write: %u\n",
+ profile_p->writecache_flush_reason_write);
+ d_printf("flush_reason_oplock: %u\n",
+ profile_p->writecache_flush_reason_oplock);
+ d_printf("flush_reason_close: %u\n",
+ profile_p->writecache_flush_reason_close);
+ d_printf("flush_reason_sync: %u\n",
+ profile_p->writecache_flush_reason_sync);
+ d_printf("flush_reason_sizechange: %u\n",
+ profile_p->writecache_flush_reason_sizechange);
profile_separator("SMB Calls");
d_printf("mkdir_count: %u\n",