X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=1396cd9bbe846559ee345f6488fdd3808ac84ae1;hp=973ea7993076b04fb1ab71d87e182efcad8f45fa;hb=e316aad5fbbe3782872083cb68dfdd58bccea811;hpb=10a8a2237343699e3923d87e24dbf2d7fe225377 diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 973ea7993..1396cd9bb 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -2,21 +2,21 @@ * Copyright (C) 2011 - Julien Desfossez * Mathieu Desnoyers * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; only version 2 - * of the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2 only, + * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#define __USE_LINUX_IOCTL_DEFS #include #include "kernel-ctl.h" @@ -187,3 +187,16 @@ int kernctl_put_subbuf(int fd) { return ioctl(fd, RING_BUFFER_PUT_SUBBUF); } + +/* Set the stream_id */ +int kernctl_set_stream_id(int fd, unsigned long *stream_id) +{ + return ioctl(fd, RING_BUFFER_SET_STREAM_ID, stream_id); +} + +/* Get the offset of the stream_id in the packet header */ +int kernctl_get_net_stream_id_offset(int fd, unsigned long *offset) +{ + return ioctl(fd, LTTNG_KERNEL_STREAM_ID_OFFSET, offset); + +}