Use the new functions for default subbuf sizes
[lttng-tools.git] / src / bin / lttng-sessiond / trace-kernel.c
index 7789d6c208a09fa8aa1fec59f7b5f2f6816bcecc..3df39ecab24c5931a3274991bb03966758d584cc 100644 (file)
@@ -1,19 +1,18 @@
 /*
  * Copyright (C)  2011 - David Goulet <david.goulet@polymtl.ca>
  *
- * 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 _GNU_SOURCE
@@ -229,6 +228,8 @@ struct ltt_kernel_event *trace_kernel_create_event(struct lttng_event *ev)
        return lke;
 
 error:
+       free(lke);
+       free(attr);
        return NULL;
 }
 
@@ -252,7 +253,7 @@ struct ltt_kernel_metadata *trace_kernel_create_metadata(char *path)
 
        /* Set default attributes */
        chan->attr.overwrite = DEFAULT_CHANNEL_OVERWRITE;
-       chan->attr.subbuf_size = DEFAULT_METADATA_SUBBUF_SIZE;
+       chan->attr.subbuf_size = default_get_metadata_subbuf_size();
        chan->attr.num_subbuf = DEFAULT_METADATA_SUBBUF_NUM;
        chan->attr.switch_timer_interval = DEFAULT_CHANNEL_SWITCH_TIMER;
        chan->attr.read_timer_interval = DEFAULT_CHANNEL_READ_TIMER;
@@ -271,6 +272,8 @@ struct ltt_kernel_metadata *trace_kernel_create_metadata(char *path)
        return lkm;
 
 error:
+       free(lkm);
+       free(chan);
        return NULL;
 }
 
This page took 0.023719 seconds and 4 git commands to generate.