#include <common/sessiond-comm/sessiond-comm.h>
#include "channel.h"
+#include "lttng-sessiond.h"
#include "kernel.h"
#include "ust-ctl.h"
#include "utils.h"
goto error;
}
+ /*
+ * Invalid subbuffer size if it's lower then the page size.
+ */
+ if (attr->attr.subbuf_size < page_size) {
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
+
if (!attr->attr.num_subbuf ||
(attr->attr.num_subbuf & (attr->attr.num_subbuf - 1))) {
ret = LTTNG_ERR_INVALID;
/* Validate buffer type. */
switch (type) {
case LTTNG_BUFFER_PER_PID:
- if (attr->attr.subbuf_size <
- default_get_ust_pid_channel_subbuf_size()) {
- ret = LTTNG_ERR_INVALID;
- goto error;
- }
break;
case LTTNG_BUFFER_PER_UID:
- if (attr->attr.subbuf_size <
- default_get_ust_uid_channel_subbuf_size()) {
- ret = LTTNG_ERR_INVALID;
- goto error;
- }
break;
default:
ret = LTTNG_ERR_BUFFER_NOT_SUPPORTED;
*/
extern int apps_cmd_notify_pipe[2];
+/*
+ * Populated when the daemon starts with the current page size of the system.
+ */
+extern long page_size;
+
int sessiond_set_thread_pollset(struct lttng_poll_event *events, size_t size);
int sessiond_check_thread_quit_pipe(int fd, uint32_t events);
*/
static int app_socket_timeout;
+/* Set in main() with the current page size. */
+long page_size;
+
static
void setup_consumerd_path(void)
{
setup_consumerd_path();
+ page_size = sysconf(_SC_PAGESIZE);
+ if (page_size < 0) {
+ PERROR("sysconf _SC_PAGESIZE");
+ page_size = LONG_MAX;
+ WARN("Fallback page size to %ld", page_size);
+ }
+
/* Parse arguments */
progname = argv[0];
if ((ret = parse_args(argc, argv)) < 0) {