Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3210747pxb; Fri, 4 Feb 2022 03:57:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDPYVtww7t127t1UqQRng8SBNLMGmuBWcZUv6Q1rXRBZGTah5AbT1L/SJ8phiOVcSloXca X-Received: by 2002:aa7:8e89:: with SMTP id a9mr2830615pfr.64.1643975877573; Fri, 04 Feb 2022 03:57:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643975877; cv=none; d=google.com; s=arc-20160816; b=JeKUqI2CI7XVB2BGXRU1bFrMEPDeArFwpvc+6wzDm3ZrwAIwvcGEyjSy7NXbdjuXyh 9Pmcy1hOQnGUZT9WmTzEEL+K8vrEvAoFc+YBuJubqNJ4nZyfJVkC2FNI+ZA4+bfN5uNF ekuAMS4aTaiZC6F2iojTSr+YjsBBmn0u8IsuUVRDOh1d5I5U+FMst8iH27Lead2ltuh7 sFNN+S4AUbDzvrWXfXCB14FfqZt2NJ4ietjoZPBXUNk3EKvKagejHklOFc8jmhexIHRe qnkhaZ8Znf6/irI3iVV0yf/yniyOD9FbLD5+mpHnsaFX04CCfv50qyt22eGurZvtv2lb JRsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=s6xzHZRwsIfVX6FLeg9txH2PD86m3v1U++GUnwW0q9U=; b=nnhv/qYB/5Q5xfupfRXh2wtB3/kB5hYt9CdFDhFmeZYSxlcG/zO0O3KKFs79xf9itj B1SO5VUGZCXvBim4wBxfUVpwOnKssgG7Gue0zXJi3r1Vmf8UfRN31hFI3lqgo71wG1qq dLxm0OluK9IYIpZUq21/MpvxmTb9ymZfyY+DUg6kOluLuHf9J4wlTn4kmW9PFQ5USyNx fZHNJYMQngIqZ31t1/8TgZTvc+hou6nQZaLpTaAksjvps5ns1b1ewPJqnnKEyeiqHIGw Y1/vZxiAItXYPzrylwYKq+rJMKIEKC9l78eMJ4mVS+LIo8i6So1/2Wg7QseaDAhOdxIJ mWKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oSieZ4+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14si1800487pfc.358.2022.02.04.03.57.45; Fri, 04 Feb 2022 03:57:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oSieZ4+5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235352AbiBDKnb (ORCPT + 99 others); Fri, 4 Feb 2022 05:43:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230164AbiBDKn3 (ORCPT ); Fri, 4 Feb 2022 05:43:29 -0500 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3848C061714 for ; Fri, 4 Feb 2022 02:43:28 -0800 (PST) Received: by mail-wm1-x331.google.com with SMTP id l67-20020a1c2546000000b00353951c3f62so2977935wml.5 for ; Fri, 04 Feb 2022 02:43:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s6xzHZRwsIfVX6FLeg9txH2PD86m3v1U++GUnwW0q9U=; b=oSieZ4+5Uuw4lc035UIbXuwmj29uDTswGI+own2PFENNrBEJzPN0VsyeJKSlj8YdyQ OljjXmfrgBne31Z68dYmY50njfo8FJIAhM/g2uAItUI1ZVxSd+WEyEUZpcxrOYsJIkkl 9Pa3qR/P4opTAjxNQlVdaRDi2PhtS3mqY+HRKVyRg0g+d7t5l3xkI5rDcRk/c/ciHys8 dj8+eAsCP4mvACTkLGPLC0fNZPhDIAHne0/p2q4AxmjhIhtgBu+JODEJun33lzZncjQ1 AoYDdKSbKR4k5KisPaufu/33JMaGfKQR3/Vu/gth9LjiqjeMbNA18CJCEvLx7sWrSRFW MznA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=s6xzHZRwsIfVX6FLeg9txH2PD86m3v1U++GUnwW0q9U=; b=KCBfP906vUDgWYvg01bZG7zMIrSgQU7rY+nSh4EHhd+ao6tjrxcavN49b0hiZ6/cRh fl/vXEwBtMSPYc4HAQxN5GAYlMadSg25g7hn3sdGW1Axiy607F+92nVFJNPU26aXOZ7n 4mGp6hjUwtWS44hrT6+WoN5PYDDmLE8P8LFZJsS+REyP1ukRvU07dPY+vaP79I2cgXmA Did5Qz2FqIrzLq7AONjrsG0XYaW+RR8gc6jRYqN5llsBqCStP/z/Tnr/1lxj/+i4ZX2e jiBHNVjbFT3Fnb+NcftEcfOIuu9i3xMiV4rkygZjeB+gcDzKEkb2rtImhw6tVmHU/qHZ jYQw== X-Gm-Message-State: AOAM533XfWudp3sC5op6N+XTy6MyLvKXr33olMZrrc46DqQ1r0HkjYKh o99NWVKgChGTZovwoH5Luu+Q5Elp+bDSswTzt3Xpjg== X-Received: by 2002:a05:600c:4a09:: with SMTP id c9mr1717076wmp.83.1643971407318; Fri, 04 Feb 2022 02:43:27 -0800 (PST) MIME-Version: 1.0 References: <20211215160403.69264-1-carsten.haitzler@foss.arm.com> <20211215160403.69264-9-carsten.haitzler@foss.arm.com> In-Reply-To: <20211215160403.69264-9-carsten.haitzler@foss.arm.com> From: Mike Leach Date: Fri, 4 Feb 2022 10:43:18 +0000 Message-ID: Subject: Re: [PATCH 09/12] perf test: Add add memcpy test for coresight quality checking To: carsten.haitzler@foss.arm.com Cc: linux-kernel@vger.kernel.org, coresight@lists.linaro.org, suzuki.poulose@arm.com, mathieu.poirier@linaro.org, leo.yan@linaro.org, acme@kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Carsten From a trace ouput perspective, this test doesn't really add coverage on top of what has gone before. We only have instruction trace - so the data operations of the memcpy do not result in any trace output. From a trace perspective, memcpy is a tight loop - probably resulting in a single atom element for each iteration, and nothing in between. For this reason, I think this test, and the threaded memcpy test in the next patch can be dropped. Regards Mike On Wed, 15 Dec 2021 at 16:04, wrote: > > From: Carsten Haitzler > > This adds memory bound tests for quality checking perf's aux data > recording. > > Signed-off-by: Carsten Haitzler > --- > tools/perf/tests/shell/coresight_memcpy_1m.sh | 18 +++++++++ > .../perf/tests/shell/coresight_memcpy_32m.sh | 18 +++++++++ > .../perf/tests/shell/coresight_memcpy_64k.sh | 18 +++++++++ > .../perf/tests/shell/tools/coresight/Makefile | 3 +- > .../shell/tools/coresight/memcpy/Makefile | 29 ++++++++++++++ > .../shell/tools/coresight/memcpy/memcpy.c | 40 +++++++++++++++++++ > 6 files changed, 125 insertions(+), 1 deletion(-) > create mode 100755 tools/perf/tests/shell/coresight_memcpy_1m.sh > create mode 100755 tools/perf/tests/shell/coresight_memcpy_32m.sh > create mode 100755 tools/perf/tests/shell/coresight_memcpy_64k.sh > create mode 100644 tools/perf/tests/shell/tools/coresight/memcpy/Makefile > create mode 100644 tools/perf/tests/shell/tools/coresight/memcpy/memcpy.c > > diff --git a/tools/perf/tests/shell/coresight_memcpy_1m.sh b/tools/perf/tests/shell/coresight_memcpy_1m.sh > new file mode 100755 > index 000000000000..fa1c28d73b66 > --- /dev/null > +++ b/tools/perf/tests/shell/coresight_memcpy_1m.sh > @@ -0,0 +1,18 @@ > +#!/bin/sh -e > +# Coresight / Memcpy 1M > + > +# SPDX-License-Identifier: GPL-2.0 > +# Carsten Haitzler , 2021 > + > +TEST="memcpy" > +. $(dirname $0)/lib/coresight.sh > +ARGS="1024 2" > +DATV="1m" > +DATA="$DATD/perf-$TEST-$DATV.data" > + > +perf record $PERFRECOPT -o "$DATA" "$BIN" $ARGS > + > +perf_dump_aux_verify "$DATA" 39 766 766 > + > +err=$? > +exit $err > diff --git a/tools/perf/tests/shell/coresight_memcpy_32m.sh b/tools/perf/tests/shell/coresight_memcpy_32m.sh > new file mode 100755 > index 000000000000..4ab5459e3824 > --- /dev/null > +++ b/tools/perf/tests/shell/coresight_memcpy_32m.sh > @@ -0,0 +1,18 @@ > +#!/bin/sh -e > +# Coresight / Memcpy 32M > + > +# SPDX-License-Identifier: GPL-2.0 > +# Carsten Haitzler , 2021 > + > +TEST="memcpy" > +. $(dirname $0)/lib/coresight.sh > +ARGS="32768 1" > +DATV="32m" > +DATA="$DATD/perf-$TEST-$DATV.data" > + > +perf record $PERFRECOPT -o "$DATA" "$BIN" $ARGS > + > +perf_dump_aux_verify "$DATA" 39 7804 7804 > + > +err=$? > +exit $err > diff --git a/tools/perf/tests/shell/coresight_memcpy_64k.sh b/tools/perf/tests/shell/coresight_memcpy_64k.sh > new file mode 100755 > index 000000000000..5b6ba2a6d394 > --- /dev/null > +++ b/tools/perf/tests/shell/coresight_memcpy_64k.sh > @@ -0,0 +1,18 @@ > +#!/bin/sh -e > +# Coresight / Memcpy 64K > + > +# SPDX-License-Identifier: GPL-2.0 > +# Carsten Haitzler , 2021 > + > +TEST="memcpy" > +. $(dirname $0)/lib/coresight.sh > +ARGS="64 40" > +DATV="64k" > +DATA="$DATD/perf-$TEST-$DATV.data" > + > +perf record $PERFRECOPT -o "$DATA" "$BIN" $ARGS > + > +perf_dump_aux_verify "$DATA" 40 934 934 > + > +err=$? > +exit $err > diff --git a/tools/perf/tests/shell/tools/coresight/Makefile b/tools/perf/tests/shell/tools/coresight/Makefile > index a1a752f45c46..99030c889b04 100644 > --- a/tools/perf/tests/shell/tools/coresight/Makefile > +++ b/tools/perf/tests/shell/tools/coresight/Makefile > @@ -8,7 +8,8 @@ SUBDIRS = \ > asm_pure_loop \ > thread_loop \ > bubble_sort \ > - bubble_sort_thread > + bubble_sort_thread \ > + memcpy > > all: $(SUBDIRS) > $(SUBDIRS): > diff --git a/tools/perf/tests/shell/tools/coresight/memcpy/Makefile b/tools/perf/tests/shell/tools/coresight/memcpy/Makefile > new file mode 100644 > index 000000000000..7c31fe4ec399 > --- /dev/null > +++ b/tools/perf/tests/shell/tools/coresight/memcpy/Makefile > @@ -0,0 +1,29 @@ > +# SPDX-License-Identifier: GPL-2.0 > +# Carsten Haitzler , 2021 > +include ../Makefile.miniconfig > + > +BIN=memcpy > +LIB= > + > +all: $(BIN) > + > +$(BIN): $(BIN).c > +ifdef CORESIGHT > +ifeq ($(ARCH),arm64) > + $(Q)$(CC) $(BIN).c -o $(BIN) $(LIB) > +endif > +endif > + > +install-tests: all > +ifdef CORESIGHT > +ifeq ($(ARCH),arm64) > + $(call QUIET_INSTALL, tests) \ > + $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/tools/$(BIN)'; \ > + $(INSTALL) $(BIN) '$(DESTDIR_SQ)$(perfexec_instdir_SQ)/tests/shell/tools/$(BIN)/$(BIN)' > +endif > +endif > + > +clean: > + $(Q)$(RM) -f $(BIN) > + > +.PHONY: all clean install-tests > diff --git a/tools/perf/tests/shell/tools/coresight/memcpy/memcpy.c b/tools/perf/tests/shell/tools/coresight/memcpy/memcpy.c > new file mode 100644 > index 000000000000..1aa0617448ad > --- /dev/null > +++ b/tools/perf/tests/shell/tools/coresight/memcpy/memcpy.c > @@ -0,0 +1,40 @@ > +// SPDX-License-Identifier: GPL-2.0 > +// Carsten Haitzler , 2021 > +#include > +#include > +#include > +#include > + > +int main(int argc, char **argv) > +{ > + unsigned long i, len, size; > + unsigned char *src, *dst; > + long long v; > + > + if (argc < 3) { > + printf("ERR: %s [copysize Kb] [numloops (hundreds)]\n", argv[0]); > + exit(1); > + } > + > + v = atoll(argv[1]); > + if ((v < 1) || (v > (1024 * 1024))) { > + printf("ERR: max memory 1GB (1048576 KB)\n"); > + exit(1); > + } > + size = v; > + v = atoll(argv[2]); > + if ((v < 1) || (v > 40000000000ll)) { > + printf("ERR: loops 1-40000000000 (hundreds)\n"); > + exit(1); > + } > + len = v * 100; > + src = malloc(size * 1024); > + dst = malloc(size * 1024); > + if ((!src) || (!dst)) { > + printf("ERR: Can't allocate memory\n"); > + exit(1); > + } > + for (i = 0; i < len; i++) > + memcpy(dst, src, size * 1024); > + return 0; > +} > -- > 2.32.0 > -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK