From patchwork Tue Mar 8 04:38:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37645 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0013827BBEA; Tue, 8 Mar 2022 04:39:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A56A927BBE9 for ; Tue, 8 Mar 2022 04:39:24 +0000 (GMT) Received: from localhost ([::1]:37918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRRd5-0005Ns-Ra for patchwork@mira.cbaines.net; Mon, 07 Mar 2022 23:39:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRRck-0005Iw-RJ for guix-patches@gnu.org; Mon, 07 Mar 2022 23:39:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:32876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRRck-0007Cz-Iq for guix-patches@gnu.org; Mon, 07 Mar 2022 23:39:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRRck-00079P-Gs for guix-patches@gnu.org; Mon, 07 Mar 2022 23:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54235] [PATCH v2 3/3] gnu: Add sysbench. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Mar 2022 04:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54235 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54235@debbugs.gnu.org Cc: maximedevos@telenet.be, Maxim Cournoyer Received: via spool by 54235-submit@debbugs.gnu.org id=B54235.164671431827435 (code B ref 54235); Tue, 08 Mar 2022 04:39:02 +0000 Received: (at 54235) by debbugs.gnu.org; 8 Mar 2022 04:38:38 +0000 Received: from localhost ([127.0.0.1]:55004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRRcM-00078Q-0X for submit@debbugs.gnu.org; Mon, 07 Mar 2022 23:38:38 -0500 Received: from mail-qv1-f43.google.com ([209.85.219.43]:37820) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRRcG-00077m-V9 for 54235@debbugs.gnu.org; Mon, 07 Mar 2022 23:38:36 -0500 Received: by mail-qv1-f43.google.com with SMTP id im7so7220717qvb.4 for <54235@debbugs.gnu.org>; Mon, 07 Mar 2022 20:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cKkseaeuyJojZyckDwDT3HjCoPDQ/I9stLfbUmh7IxI=; b=bX0Y2tPgMl/0tSQrA0A9psTeFZPSvGuzkxfQZQ4sNrPvnXFOy7za5DF1TCf0M0yciV 6h3nBCRHCrVusDN2+bu1bpOusxqxrioAfp0qLKsQEmev4kvP3coUhB0OwZx5fzMZzsvG fFf9ql/zvFpRclqeFB8Zx1dfEsakgkrAKhrUFe96ipfkc2HIATTsf/xmpVBWZ5aMemKa TZPnKP8WWo77WN3AVkVmnWdQINgJDvHZ5t+O73nFMMpkZ3MoEACfmo113k9vlADszndo lGdrlPeWjas9MC2B9K/uLGASfzSfefZ0QlxgLYQnmnfskh8iTAikerQruwQKPOEYei54 1GQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cKkseaeuyJojZyckDwDT3HjCoPDQ/I9stLfbUmh7IxI=; b=h5VeUvDXk5bvQTZD5pwykys2slUDC12ixWMirTqMPckIJY1KjcBswzerODMvXq52EB M8b8V4QaR/MGYNvRGQI1fEdcteVlkEZFlEfF4vq5FE6V35XRWiA10TW+jfNuGG6OTptX rSbRINnf54Ow5JZk06ZPnvpRcpg7xq7BogtnrBBZ61FbSUMgUcAraHPVlrwodD33ZvN8 lMwrVeDKOZmk7Gcg+rs6P5q7UNU6s+VLGxzrtMq3rIRyBj79rtLYG23VfCJn702KGGg5 1C1QmQejTeWQ/mtHGkkJlKbWHp9x5LIsBXQjeKbdH6NQVr/otWLXxwzKq2kzVQd6UfJL 3RTA== X-Gm-Message-State: AOAM5322N/iP/rMV7U6yKB7aH8uW92yq85SNuT1xcVBD5wFN8Emhw71Y CkHPA8Z1upVBkJt08jggwdaeKr4Rz4c= X-Google-Smtp-Source: ABdhPJyXGr22Upe5H9W5exJVNerb7ut779zQ2jM5u5P5ptAj2elMFett5V9LAKv9nJCmka2cV+JEhg== X-Received: by 2002:a05:6214:762:b0:435:9eac:e343 with SMTP id f2-20020a056214076200b004359eace343mr3901341qvz.21.1646714307223; Mon, 07 Mar 2022 20:38:27 -0800 (PST) Received: from localhost.localdomain (dsl-205-151-56-54.b2b2c.ca. [205.151.56.54]) by smtp.gmail.com with ESMTPSA id y11-20020ac85f4b000000b002de4b0a015asm10369332qta.5.2022.03.07.20.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 20:38:26 -0800 (PST) From: Maxim Cournoyer Date: Mon, 7 Mar 2022 23:38:09 -0500 Message-Id: <20220308043809.31394-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220308043809.31394-1-maxim.cournoyer@gmail.com> References: <20220308043809.31394-1-maxim.cournoyer@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/benchmark.scm (sysbench): New variable. --- gnu/packages/benchmark.scm | 137 +++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index eb5df3d4c3..87c39aac8c 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -37,19 +37,27 @@ (define-module (gnu packages benchmark) #:use-module (guix build-system gnu) #:use-module (guix build-system python) #:use-module (gnu packages) + #:use-module (gnu packages autotools) + #:use-module (gnu packages base) + #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages kde-frameworks) + #:use-module (gnu packages databases) + #:use-module (gnu packages docbook) #:use-module (gnu packages linux) + #:use-module (gnu packages lua) #:use-module (gnu packages maths) #:use-module (gnu packages mpi) #:use-module (gnu packages opencl) #:use-module (gnu packages perl) + #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-science) #:use-module (gnu packages python-web) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) + #:use-module (gnu packages xml) #:use-module (ice-9 match)) (define-public fio @@ -430,3 +438,132 @@ (define-public kdiskmark @item Report generation. @end itemize") (license license:gpl3+))) + +(define-public sysbench + (package + (name "sysbench") + (version "1.0.20") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/akopytov/sysbench") + (commit version))) + (file-name (git-file-name name version)) + (modules '((guix build utils))) + (snippet '(begin + ;; Ensure no bundled libraries get used. + (delete-file-recursively "third_party") + (substitute* "configure.ac" + (("^third_party/.*") + "")) + (substitute* "Makefile.am" + ((".*(LUAJIT|CK)_DIR =.*") + "")))) + (sha256 + (base32 + "1sanvl2a52ff4shj62nw395zzgdgywplqvwip74ky8q7s6qjf5qy")))) + (build-system gnu-build-system) + (arguments + (list + #:configure-flags #~(list "--with-pgsql" + ;; Explicitly specify the library directory of + ;; MySQL, otherwise `mysql_config` gets + ;; consulted and adds unnecessary link + ;; directives. + (string-append "--with-mysql-libs=" + #$(this-package-input "mysql") + "/lib") + "--with-system-luajit" + "--with-system-ck" + ;; If we let the build tool select the most + ;; optimal compiler architecture flag, the + ;; build is not reproducible. + "--without-gcc-arch") + #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'patch-test-runner + (lambda _ + (substitute* "tests/test_run.sh" + (("/bin/bash") + (which "bash")) + ;; Do not attempt to invoke the cram command via + ;; Python, as on Guix it is a shell script (wrapper). + (("\\$\\(command -v cram\\)") + "-m cram")))) + (add-after 'unpack 'disable-test-installation + (lambda _ + (substitute* "tests/Makefile.am" + (("install-data-local") + "do-not-install-data-local") + (("^test_SCRIPTS.*") + "")))) + (add-after 'unpack 'fix-docbook + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "m4/ax_check_docbook.m4" + (("DOCBOOK_ROOT=.*" all) + (string-append + all "XML_CATALOG=" + (search-input-file inputs + "xml/dtd/docbook/catalog.xml") + "\n"))) + (substitute* "doc/xsl/xhtml.xsl" + (("http://docbook.sourceforge.net/release/xsl\ +/current/xhtml/docbook.xsl") + (search-input-file + inputs (string-append "xml/xsl/docbook-xsl-" + #$(package-version docbook-xsl) + "/xhtml/docbook.xsl")))) + (substitute* "doc/xsl/xhtml-chunk.xsl" + (("http://docbook.sourceforge.net/release/xsl\ +/current/xhtml/chunk.xsl") + (search-input-file + inputs (string-append "xml/xsl/docbook-xsl-" + #$(package-version docbook-xsl) + "/xhtml/chunk.xsl"))))))))) + (native-inputs (list autoconf + automake + libtool + pkg-config + python-cram + python-wrapper + which + ;; For documentation + libxml2 ;for XML_CATALOG_FILES + libxslt + docbook-xml-4.1.2 + docbook-xsl)) + (inputs (list ck libaio luajit mysql postgresql)) + (home-page "https://github.com/akopytov/sysbench/") + (synopsis "Scriptable database and system performance benchmark") + (description "@command{sysbench} is a scriptable multi-threaded benchmark +tool based on LuaJIT. It is most frequently used for database benchmarks, but +can also be used to create arbitrarily complex workloads that do not involve a +database server. @command{sysbench} comes with the following bundled +benchmarks: +@table @file +@item oltp_*.lua +A collection of OLTP-like database benchmarks. +@item fileio +A filesystem-level benchmark. +@item cpu +A simple CPU benchmark. +@item memory +A memory access benchmark. +@item threads +A thread-based scheduler benchmark. +@item mutex +A POSIX mutex benchmark. +@end table +It includes features such as: +@itemize +@item +Extensive statistics about rate and latency is available, including latency +percentiles and histograms. +@item +Low overhead even with thousands of concurrent threads. @command{sysbench} is +capable of generating and tracking hundreds of millions of events per second. +@item +New benchmarks can be easily created by implementing pre-defined hooks in +user-provided Lua scripts. +@item +@end itemize") + (license license:gpl2+)))