X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Ftracefile-array.c;h=05ce3ad34520c9f09c7bb91fe2b235684c2a106d;hp=a52ccd550823fdeeeaf9f892cbd7e09a74d0959e;hb=505b2d90aa87592186ecc2a119cf67fb3f90d168;hpb=c31a80928a509b70882bf6d81cb81acb639e263b diff --git a/src/bin/lttng-relayd/tracefile-array.c b/src/bin/lttng-relayd/tracefile-array.c index a52ccd550..05ce3ad34 100644 --- a/src/bin/lttng-relayd/tracefile-array.c +++ b/src/bin/lttng-relayd/tracefile-array.c @@ -1,18 +1,8 @@ /* - * Copyright (C) 2015 - Mathieu Desnoyers + * Copyright (C) 2015 Mathieu Desnoyers * - * 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. + * SPDX-License-Identifier: GPL-2.0-only * - * 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., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _LGPL_SOURCE @@ -120,15 +110,16 @@ void tracefile_array_file_rotate(struct tracefile_array *tfa, } } -void tracefile_array_commit_seq(struct tracefile_array *tfa) +void tracefile_array_commit_seq(struct tracefile_array *tfa, + uint64_t new_seq_head) { uint64_t *headp, *tailp; /* Increment overall head. */ - tfa->seq_head++; - /* If we are committing our first index overall, set tail to 0. */ + tfa->seq_head = new_seq_head; + /* If we are committing our first index overall, set tail to head. */ if (tfa->seq_tail == -1ULL) { - tfa->seq_tail = 0; + tfa->seq_tail = new_seq_head; } if (!tfa->count) { /* Not in tracefile rotation mode. */