X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fsorter%2Fcommon.h;h=74e648d62c0b4e40923a5e162a3a77bca9b9c22a;hb=ddffc1e06a78085524bec742aef746c2cc5bd131;hp=8affa6300c34a8504e7c3016360bd05feba97bbf;hpb=6d00600fd0121cd3361843ca803fab0b2b76a7d8;p=libucw.git diff --git a/lib/sorter/common.h b/lib/sorter/common.h index 8affa630..74e648d6 100644 --- a/lib/sorter/common.h +++ b/lib/sorter/common.h @@ -18,11 +18,12 @@ extern uns sorter_debug; extern u64 sorter_bufsize; #define SORT_TRACE(x...) do { if (sorter_trace) log(L_DEBUG, x); } while(0) -#define SORT_XTRACE(x...) do { if (sorter_trace > 1) log(L_DEBUG, x); } while(0) +#define SORT_XTRACE(level, x...) do { if (sorter_trace >= level) log(L_DEBUG, x); } while(0) enum sort_debug { SORT_DEBUG_NO_PRESORT = 1, SORT_DEBUG_NO_JOIN = 2, + SORT_DEBUG_KEEP_BUCKETS = 4, }; struct sort_bucket; @@ -91,4 +92,8 @@ struct fastbuf *sbuck_read(struct sort_bucket *b); struct fastbuf *sbuck_write(struct sort_bucket *b); void sbuck_swap_out(struct sort_bucket *b); +#define F_SIZE(x) ({ byte buf[16]; format_size(buf, x); buf; }) +#define F_BSIZE(b) F_SIZE(sbuck_size(b)) +void format_size(byte *buf, u64 x); + #endif