From patchwork Thu Mar 3 14:05:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 650 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 AFEB427BBE9; Thu, 3 Mar 2022 14:07:32 +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 E521027BBEA for ; Thu, 3 Mar 2022 14:07:31 +0000 (GMT) Received: from localhost ([::1]:48948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPm79-0005wk-1R for patchwork@mira.cbaines.net; Thu, 03 Mar 2022 09:07:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPm6h-0005Ju-Fv for guix-patches@gnu.org; Thu, 03 Mar 2022 09:07:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nPm6h-0003rL-7S for guix-patches@gnu.org; Thu, 03 Mar 2022 09:07:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nPm6h-0004r1-2j for guix-patches@gnu.org; Thu, 03 Mar 2022 09:07:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54235] [PATCH 3/3] gnu: Add sysbench. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Mar 2022 14:07: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: Maxim Cournoyer Received: via spool by 54235-submit@debbugs.gnu.org id=B54235.164631638918600 (code B ref 54235); Thu, 03 Mar 2022 14:07:03 +0000 Received: (at 54235) by debbugs.gnu.org; 3 Mar 2022 14:06:29 +0000 Received: from localhost ([127.0.0.1]:41871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPm65-0004ps-BV for submit@debbugs.gnu.org; Thu, 03 Mar 2022 09:06:29 -0500 Received: from mail-qk1-f179.google.com ([209.85.222.179]:33313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nPm60-0004pc-NM for 54235@debbugs.gnu.org; Thu, 03 Mar 2022 09:06:24 -0500 Received: by mail-qk1-f179.google.com with SMTP id bm39so3971238qkb.0 for <54235@debbugs.gnu.org>; Thu, 03 Mar 2022 06:06:20 -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=IX8vRvcISVark35EbGU5iQ5o6u2tuWGt0sPKYGxZw38=; b=gX9boY1Fevc7op+00n+aqsxWzvJqFGLZKY+8bynSYI29RDsmrK4l9vvZOs9wo9el4j 74i57qm1cJihmsXEOF+htoowjLgqPVJ+ewEna2gXoD08H3wuigaFQpZQLDz7jmdKhxzI fajPAlG97+6HVfLkX5jPq4+y0EOJY5x5lvcg6BGMS68x7KJUU8b4xs2Zq07/U6nlOtsS PE4chziFti3cF70U85sh7kHPH9LdWwN6zKU9BZxNzEwwkI+/RDrNg4unefrzYf8+8XuT KRtIVjP8Yy1flv/uE7mHTfjKGQgpe0j0NO9RnbANO9bcla2QU77ye7RvFtJgCz/W8PNC GYng== 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=IX8vRvcISVark35EbGU5iQ5o6u2tuWGt0sPKYGxZw38=; b=AtcpqC4D6B7feHI8Hr4zAPxAP3MHrTqfFAjc9tCzm1WsYG2WSWdad2gLcezslPivf8 H+3iiweOTAYwVwoRsiuz//+oBhSZWqplVZlCCDp+8pRaEDWa5lHPcEnUV2NThlVFvAfd k+G82zLmVYrbS5qXbBxJt4vTaeL4AP5D71zTGoGjvBYKOqcQVc52yWjkhTgOhscUl2HV HVm4VDSX21JBkpRxySBKazegvodcobjbLajo+3Waa4kDxWAnlbrQXB72uAYp2lQFnK7u JbMu8205bHCH6C2+2V+vU9KF1AK4K/sWDNDg9am4GXHGQqgKTKJYxcT/Ch3wViJ0Nbgu mUQw== X-Gm-Message-State: AOAM530ct0+X39pbmVjjkVRVmijcIzpWqbbuvSb+aHvHGFxOVPwEj5ns WRMwUPmfYrNy6ma8k2ZY/VwQzheQTJc= X-Google-Smtp-Source: ABdhPJzpz2ceojhXQ6AFNpMopH/rw42SvMQZL0w9pVMA2QYJjwD64TKyYBLrT1WIUdl2wETmHBluoQ== X-Received: by 2002:a05:620a:22d0:b0:648:e106:49fc with SMTP id o16-20020a05620a22d000b00648e10649fcmr18680617qki.242.1646316374836; Thu, 03 Mar 2022 06:06:14 -0800 (PST) Received: from localhost.localdomain (dsl-141-39.b2b2c.ca. [66.158.141.39]) by smtp.gmail.com with ESMTPSA id c16-20020a05622a059000b002dc93dc92d1sm1601272qtb.48.2022.03.03.06.06.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Mar 2022 06:06:14 -0800 (PST) From: Maxim Cournoyer Date: Thu, 3 Mar 2022 09:05:58 -0500 Message-Id: <20220303140558.29261-3-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220303140558.29261-1-maxim.cournoyer@gmail.com> References: <20220303140558.29261-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 | 140 ++++++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 1 deletion(-) diff --git a/gnu/packages/benchmark.scm b/gnu/packages/benchmark.scm index 537f6262c4..69de11d998 100644 --- a/gnu/packages/benchmark.scm +++ b/gnu/packages/benchmark.scm @@ -8,7 +8,7 @@ ;;; Copyright © 2019, 2021 Ludovic Courtès ;;; Copyright © 2020 Vincent Legoll ;;; Copyright © 2020 malte Frank Gerdes -;;; Copyright © 2020, 2021 Maxim Cournoyer +;;; Copyright © 2020, 2021, 2022 Maxim Cournoyer ;;; Copyright © 2020 Greg Hogan ;;; Copyright © 2021 Arun Isaac ;;; @@ -31,22 +31,31 @@ (define-module (gnu packages benchmark) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix build-system cmake) #: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 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 xml) #:use-module (ice-9 match)) (define-public fio @@ -383,3 +392,132 @@ (define-public clpeak devices. It only measures the peak metrics that can be achieved using vector operations and does not represent a real-world use case.") (license license:unlicense)))) + +(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+)))