X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fchannel.c;h=88480c4b4e7b78fd63a2edc744618eadba0c36bc;hb=8d5841ea483139d3ab2f2b4dd39263dad63832b1;hp=f35410e3ae3fe85c1a7b05e87d3c25e5865795ae;hpb=da9d9d9c356b75f54a55b6691759269d5ebfd5cf;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/channel.c b/src/bin/lttng-sessiond/channel.c index f35410e3a..88480c4b4 100644 --- a/src/bin/lttng-sessiond/channel.c +++ b/src/bin/lttng-sessiond/channel.c @@ -214,9 +214,16 @@ int channel_kernel_create(struct ltt_kernel_session *ksession, attr = defattr; } + /* + * Set the overwrite mode for this channel based on the session + * type unless the client explicitly overrides the channel mode. + */ + if (attr->attr.overwrite == DEFAULT_CHANNEL_OVERWRITE) { + attr->attr.overwrite = !!ksession->snapshot_mode; + } + + /* Enforce mmap output for snapshot sessions. */ if (ksession->snapshot_mode) { - /* Force channel attribute for snapshot mode. */ - attr->attr.overwrite = 1; attr->attr.output = LTTNG_EVENT_MMAP; } @@ -318,9 +325,16 @@ int channel_ust_create(struct ltt_ust_session *usess, } } + /* + * Set the overwrite mode for this channel based on the session + * type unless the client explicitly overrides the channel mode. + */ + if (attr->attr.overwrite == DEFAULT_CHANNEL_OVERWRITE) { + attr->attr.overwrite = !!usess->snapshot_mode; + } + + /* Enforce mmap output for snapshot sessions. */ if (usess->snapshot_mode) { - /* Force channel attribute for snapshot mode. */ - attr->attr.overwrite = 1; attr->attr.output = LTTNG_EVENT_MMAP; }