From patchwork Tue Mar 8 14:36:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 37650 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 9FA7F27BBE9; Tue, 8 Mar 2022 14:37:18 +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 4AE8027BBE9 for ; Tue, 8 Mar 2022 14:37:14 +0000 (GMT) Received: from localhost ([::1]:34316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRaxd-00065u-Eq for patchwork@mira.cbaines.net; Tue, 08 Mar 2022 09:37:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRaxT-000606-QB for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:33504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRaxT-0005OA-I3 for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRaxT-0001ry-Fq for guix-patches@gnu.org; Tue, 08 Mar 2022 09:37:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54235] [PATCH v3 4/4] gnu: Add sysbench. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 08 Mar 2022 14:37:03 +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.16467501987127 (code B ref 54235); Tue, 08 Mar 2022 14:37:03 +0000 Received: (at 54235) by debbugs.gnu.org; 8 Mar 2022 14:36:38 +0000 Received: from localhost ([127.0.0.1]:55631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRax4-0001qt-CF for submit@debbugs.gnu.org; Tue, 08 Mar 2022 09:36:38 -0500 Received: from mail-qv1-f44.google.com ([209.85.219.44]:37727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRawz-0001qA-9s for 54235@debbugs.gnu.org; Tue, 08 Mar 2022 09:36:36 -0500 Received: by mail-qv1-f44.google.com with SMTP id im7so8183167qvb.4 for <54235@debbugs.gnu.org>; Tue, 08 Mar 2022 06:36:33 -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=re67dxhETCR6SAFeUom7DNOjzCjASgwObpqXOzq1CZ0=; b=cIO5f/vJfdjXXBayxfvSzk9dTc7HunSUIujrmOeSvy1GzpUErao4HgoJeoT6t6iD9W oasD2pFzGpkdR1OY7MT/fMS4AF6vwrR4z/OYXzmas+74in5LS4LnX9habnuoJfuCtt+z 5QdzyewIqudJyErPTnh6u2zW+ZJoJeW0w2U0VenJZ+RBBmTOeVztQevrooiFGS0ikfYF 3x4UEpLD2NKa7cKTC1u0L0WddEuGc65dhxx/Lj2dCTQ39itvWYQKNritFjCZZMOJ2h2s YigV/zd1iZbJBM8g1s7tcBRjmXSs+SWs1647ee/27zW52uZU/hKAQlFhBAiUxZ3DGYBJ GX8Q== 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=re67dxhETCR6SAFeUom7DNOjzCjASgwObpqXOzq1CZ0=; b=lJ846G4mzOaJXj2GGJGUfWL6eCXe9RAtOqQjdr7MEy/aSyEOyGBCICz2dogomEtfAG H6Z2gdc//8qj8Ys0YaCx+CG0WC+fPLnX+5XKgMe62qCTjaes5xaVYOywmA+ZWqi2mVZS msQXryc5SWmnOdhcLB1/MRikuj+JQ9zFas4GNXReqe+4afpe8TZ5lLujMUOXPWz6mym8 OCxvuMQrw+FIz3+iqaEIUEskMttbQGlJbwfEXnXEjcvQpvnfZajaMYOIVkOUFSbftosf 3T4t4xOJaHEvbE64JzoyVSAUPKSu33b+Yivhvi4BzoOcNW/YDR1UXdNyxw2126A73Ywk /80A== X-Gm-Message-State: AOAM5300UfV3fAyqn7D04bj/4b3Z4rgeqa/SN3iyJak9pIxgZjm+Rw2l KNrSeydIJjHZgrbfkwVNb2MlWTgTZqo= X-Google-Smtp-Source: ABdhPJwbVr5M959mm7L2dpSTCo9uNw7XqshI7Z/j3NQ7vFjlbBE+JzjtGf1MkBMK8zz2TPWjKTLAUw== X-Received: by 2002:ad4:4ee7:0:b0:432:5707:8120 with SMTP id dv7-20020ad44ee7000000b0043257078120mr12276257qvb.101.1646750187524; Tue, 08 Mar 2022 06:36: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 e9-20020ac85989000000b002de2bfc8f94sm10338847qte.88.2022.03.08.06.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 06:36:27 -0800 (PST) From: Maxim Cournoyer Date: Tue, 8 Mar 2022 09:36:07 -0500 Message-Id: <20220308143607.7449-4-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220308143607.7449-1-maxim.cournoyer@gmail.com> References: <20220308143607.7449-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 | 139 +++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index eb5df3d4c3..0277c9e7b9 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,134 @@ (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 native-inputs inputs #:allow-other-keys) + (substitute* "m4/ax_check_docbook.m4" + (("DOCBOOK_ROOT=.*" all) + (string-append + all "XML_CATALOG=" + (search-input-file (or native-inputs 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 + (or native-inputs 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 + (or native-inputs 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+)))