From 30538d9ee990c2641a26ed467cdae85473c80c4f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 28 Aug 2024 19:24:53 +0000 Subject: [PATCH] Tests: Remove unused helper `default_pipe_size_getter` MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: If72cb1456edbf26c340fcffdf93c8fb874ab030e Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- .gitignore | 1 - .../regression/tools/notification/Makefile.am | 5 +- .../notification/default_pipe_size_getter.cpp | 82 ------------------- 3 files changed, 1 insertion(+), 87 deletions(-) delete mode 100644 tests/regression/tools/notification/default_pipe_size_getter.cpp diff --git a/.gitignore b/.gitignore index 66e76696f..204ea1125 100644 --- a/.gitignore +++ b/.gitignore @@ -112,7 +112,6 @@ compile_commands.json /tests/regression/tools/notification/notification /tests/regression/tools/rotation/schedule_api /tests/regression/tools/notification/rotation -/tests/regression/tools/notification/default_pipe_size_getter /tests/regression/tools/trigger/utils/notification-client /tests/regression/tools/trigger/name/trigger_name /tests/regression/tools/trigger/utils/register-some-triggers diff --git a/tests/regression/tools/notification/Makefile.am b/tests/regression/tools/notification/Makefile.am index eb5198b4b..edb3f27c2 100644 --- a/tests/regression/tools/notification/Makefile.am +++ b/tests/regression/tools/notification/Makefile.am @@ -5,7 +5,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/tests/utils LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la LIB_LTTNG_CTL = $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la -noinst_PROGRAMS = base_client notification rotation default_pipe_size_getter +noinst_PROGRAMS = base_client notification rotation if NO_SHARED @@ -62,9 +62,6 @@ notification_LDADD = $(LIB_LTTNG_CTL) $(LIBTAP) -lm rotation_SOURCES = rotation.c rotation_LDADD = $(LIB_LTTNG_CTL) $(LIBTAP) -lm -default_pipe_size_getter_SOURCES = default_pipe_size_getter.cpp -default_pipe_size_getter_LDADD = $(top_builddir)/src/common/libcommon-gpl.la - noinst_SCRIPTS = \ test_notification_kernel_buffer_usage \ test_notification_kernel_error \ diff --git a/tests/regression/tools/notification/default_pipe_size_getter.cpp b/tests/regression/tools/notification/default_pipe_size_getter.cpp deleted file mode 100644 index 34eb3cdd3..000000000 --- a/tests/regression/tools/notification/default_pipe_size_getter.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * default_pipe_size_getter.c - * - * Tests suite for LTTng notification API (get default size of pipes) - * - * Copyright (C) 2021 Jérémie Galarneau - * - * SPDX-License-Identifier: MIT - * - */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include -#include - -#include -#include -#include -#include - -int lttng_opt_verbose; -int lttng_opt_mi; -int lttng_opt_quiet; - -namespace { -#ifdef __linux__ -/* - * Return the default pipe buffer size or a negative error. - */ -int get_pipe_size() -{ - int ret; - /* - * The event notifier pipes are not "special"; they are created using - * the lttng_pipe utility. Hence, this should be representative of a - * pipe created by the session daemon for event notifier messages to - * go through. - */ - struct lttng_pipe *pipe = lttng_pipe_open(0); - - if (!pipe) { - /* lttng_pipe_open already logs on error. */ - ret = -1; - goto end; - } - - ret = fcntl(lttng_pipe_get_writefd(pipe), F_GETPIPE_SZ); - if (ret < 0) { - PERROR("Failed to get the size of the pipe"); - } - - lttng_pipe_destroy(pipe); -end: - return ret; -} -#elif defined(__FreeBSD__) -int get_pipe_size(void) -{ - return 65536; -} -#else -#error "Implement get_pipe_size() for your platform." -#endif -} /* namespace */ - -int main() -{ - int ret; - - ret = get_pipe_size(); - if (ret < 0) { - return EXIT_FAILURE; - } - - /* Print the pipe buffer size to stdout. */ - printf("%d\n", ret); - - return EXIT_SUCCESS; -} -- 2.34.1