2 * Copyright (C) 2012 - Simon Marchi <simon.marchi@polymtl.ca>
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 size_t default_channel_subbuf_size
;
25 size_t default_metadata_subbuf_size
;
26 size_t default_kernel_channel_subbuf_size
;
27 size_t default_ust_channel_subbuf_size
;
29 static void __attribute__((constructor
)) init_defaults(void)
32 * The libringbuffer won't accept subbuf sizes smaller than the page size.
33 * If the default subbuf size is smaller, replace it by the page size.
35 long page_size
= sysconf(_SC_PAGESIZE
);
41 default_channel_subbuf_size
=
42 max(DEFAULT_CHANNEL_SUBBUF_SIZE
, page_size
);
43 default_metadata_subbuf_size
=
44 max(DEFAULT_METADATA_SUBBUF_SIZE
, page_size
);
45 default_kernel_channel_subbuf_size
=
46 max(DEFAULT_KERNEL_CHANNEL_SUBBUF_SIZE
, page_size
);
47 default_ust_channel_subbuf_size
=
48 max(DEFAULT_UST_CHANNEL_SUBBUF_SIZE
, page_size
);