From nobody Mon Nov 25 15:47:01 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63900212163 for ; Fri, 25 Oct 2024 17:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876992; cv=none; b=E45jdfqXR3u0YMPIs3/uzSPxpJmlkDAg6gpUau6NrbObm/PzLCJBgEWzJDrZFuTT+CIem981JAyucStP8FPzVpOAJ1LpzdmLyDCV9Z3SJ3vArMMZhWB1cfwnxY3wB3/Mz+JuQ+VpP9Ffe/AMGOqudElRnVuP8Eoq1hX8ByzDBEA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876992; c=relaxed/simple; bh=4yySnYzLZn+T4Oh14Unm00EmZJ7xqCsYNG3mY4KLftw=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=uNI4esfjsf+leu3s1TcF1jrJre1Zr0V+wuZc3ybojTph8ulWogL9hs7+ypewbe/GOSun3GzqjuGEDhOgLRo3ePoVeh4xC0pqeLBV7ssiH/t7ZfTWVCkXA4rVoC8gEbquVAHtMROg03WDJnStg+b6LsyP2Cb65+XfTUMVyoklYEI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=fqy2/QMt; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="fqy2/QMt" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e0082c1dd0so47667477b3.3 for ; Fri, 25 Oct 2024 10:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729876989; x=1730481789; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=UfqlArFfChSnPcH7RDY8Nm7G762SilyEqA0ClwBRXCc=; b=fqy2/QMtOs4O48lAtMQBDydd1a7ZKtI5hj3IEG3IyNlxg2vDz27hIeg9Lr3FEpURau hqbaJLou/8lXwQnB6PLnfSkPRLwSWtpy+YaofuyaenezajhkLnjOc+6iZebpeV3nrIyA dY2Jci40gVwua4EvF7SH03sU/m21HZkk9MX+kq2gOuVMAqEU9eWsZcixPrWMiYcMgqCV cNP8uXO0bU7RbdEXmuf6LDIwQ4tJ4xSe3YqEjRT4Dx7DLrTWuuhje1vVfwdRHbriM8+P QQOJaG4tvP0wfyg9rcBYVCu/EP0ciDW+OeiEL9UanV614RxxOmh6d4vBaLu1Nkcvob84 jtBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729876989; x=1730481789; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UfqlArFfChSnPcH7RDY8Nm7G762SilyEqA0ClwBRXCc=; b=Mbyoee4E9drCGcULwrVkReL+BOBf9SkTmvqz+Ei9nm/BiDzo2Xrhrw7yqmhvIW/6aC JE3cZl3pyVSZ+hWrWxhk15s9syFKgLSw2CFMu8kbyNUD4auFQejPtUxsDTP9VWEJyXsW LKtEhHF+X1arr8B5bZgEqxiTbKeVt/R7HP3T1Ahs3jzVdUvi2cTGDN/7fYJjeOneper2 ugtCjaSefxTblPQnfkXVQk22gZKR8K57Xa0zcdrSnRB4uSWDiung+RND3k2Wnmyd4GcI n+U/CrQ/CKFpfU6BUyfM+qOUq0vUtvMCsHDiaBQxNl/117qeNg/TUHRYPK/NLnIyyxO0 hlTQ== X-Forwarded-Encrypted: i=1; AJvYcCXGGVfxqfZVTe0Gmd2OxwkCu+460T3sXxy1wukez554C5AALNiLK1H0pDK9A6bYnkBkvXN1lW/xI2NZwv8=@vger.kernel.org X-Gm-Message-State: AOJu0YwPnO8jTEZk+Tvr3rTUN1lNNgFqXKFUamVwFlxJnTF62n3R9MOA iU/8AaPdMU/R/vRGRdq8beSbKS8v2rsWBMRtRnaYu93lgqn+0mSSM1sQong1neqG+p/3eNS03y+ 9jxt1Sg== X-Google-Smtp-Source: AGHT+IG0c8i0XzuFis0iYKAoQK1TYB3CJRJkBJ8l77PX7pZ8iakR5a/MycTRXZhjDL4y0M6goqFQhuWFXLTX X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:5d42:c43e:5e08:3a85]) (user=irogers job=sendgmr) by 2002:a05:6902:686:b0:e28:ef6f:3624 with SMTP id 3f1490d57ef6-e3087b82cecmr97276.5.1729876989257; Fri, 25 Oct 2024 10:23:09 -0700 (PDT) Date: Fri, 25 Oct 2024 10:22:58 -0700 In-Reply-To: <20241025172303.77538-1-irogers@google.com> Message-Id: <20241025172303.77538-2-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241025172303.77538-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Subject: [PATCH v1 1/6] tools/build: Don't pass test log files to linker From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , John Garry , Athira Jajeev , Veronika Molnarova , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Separate test log files from object files. Depend on test log output but don't pass to the linker. Signed-off-by: Ian Rogers --- tools/build/Makefile.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build index 5fb3fb3d97e0..ffe988867703 100644 --- a/tools/build/Makefile.build +++ b/tools/build/Makefile.build @@ -149,6 +149,10 @@ objprefix :=3D $(subst ./,,$(OUTPUT)$(dir)/) obj-y :=3D $(addprefix $(objprefix),$(obj-y)) subdir-obj-y :=3D $(addprefix $(objprefix),$(subdir-obj-y)) =20 +# Separate out test log files from real build objects. +test-y :=3D $(filter %_log, $(obj-y)) +obj-y :=3D $(filter-out %_log, $(obj-y)) + # Final '$(obj)-in.o' object in-target :=3D $(objprefix)$(obj)-in.o =20 @@ -159,7 +163,7 @@ $(subdir-y): =20 $(sort $(subdir-obj-y)): $(subdir-y) ; =20 -$(in-target): $(obj-y) FORCE +$(in-target): $(obj-y) $(test-y) FORCE $(call rule_mkdir) $(call if_changed,$(host)ld_multi) =20 --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 15:47:01 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87F2C21441F for ; Fri, 25 Oct 2024 17:23:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876994; cv=none; b=VIjc2cJUPNn2TXEsIYg4qEjAeOPGexiOoOIids5QDbQPbungVuWCiqUsnB+/Ho3CT8u/Le6UIydzNY2GcOZOhZAw4+zhPsEzhYmAvDI7/NyvbsFkoLhlS4UA2jXkwyi8IjZCilsVGfZSPbj/527cHxo/Kom5vNSrvWniGAXP6i8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876994; c=relaxed/simple; bh=Fd8jVS+hLHl/V1z7KbwDNJkWMfJHuFyuDP/XkZOLB5U=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=JTi0FFRNmAiNU+C06qPqaVq/ssgFSU+bVbJZ1ES7hi7w5LvSE5RSV4BwKNqcpXrnfZvHa64jIgKu9dT5bfO/MRRxJZA0jypZtAe5JciZrqOld9AvXK2sZjE3m8IyyC38xCcJ0mc6V+5JBBB3zY3SUwZq+zxBWG3GbuoI/yKMuy4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=cuXNRi8C; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cuXNRi8C" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e31e5d1739so45722107b3.1 for ; Fri, 25 Oct 2024 10:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729876991; x=1730481791; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=ZdPRzam7s3Ef71ekAYeKidwnjChTJkDNv4lJBksWIAI=; b=cuXNRi8CeW/H+u42vqhOTJttdgHoLhYZOUf1mJHjWJEn7O6o7SGdfqCH0GENuJS70D kkIZSyxWwUre4rkmmNWrWV6C1LRrhujhBtxCrNq/6SDMmJcivnSwnEPVe3HROJyMG0Tp QJG8akT+1J5ZnogfYAUsNJovbCezN3mXzLLu/0idcfx7QAgy1fTEAJcX+r+4zVM8qWvE DfBnt0YF25B89KxeUa6nyjOSxFAWmWqcMR8E8jDBNQGkmwViD6OAAH0vabr/lQXTjvag nm8YsyPe3z0X4Hc5plADaPoDTp6YY99bdIWMLZTWBmTmNHts2nUM5CiioiEtMbJY5JHz WmnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729876991; x=1730481791; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZdPRzam7s3Ef71ekAYeKidwnjChTJkDNv4lJBksWIAI=; b=e6SVq3ZwNqGktvXloLBOD6FkCDEF4XaGBsrP0vjcylNqHhuPTQkMozF/R+t/Ya2cZn aSYWs4cTeasjo5l0ycotETTUMNyDwzHgUCiEeSU17iAxO1bwZOqNkA2R60KGIhBVFDsK rcOSeYI+dAEOVbnvdJEUbK52EoHomkk7+TFtBmmqEipO3ZNmdZ59QQJmIqBgPcDN7zSX 7nN6k0oFeNlm/I8Iz1cbI6AsGk07dDFcxbnd0O6xlSzeC56SgEfVsViOZGCxMBDxjO4Y POZ3YJJRnmKaR/CcF4CVadA9qaUKQxyc0vfdT2w7KEIq8u4K+dLWB77wPYSaQxhPgRCy Itnw== X-Forwarded-Encrypted: i=1; AJvYcCVc3Yb2eU8XWHFw/Uz/61euSAhf2A+Sakq1rMDaIdgQrTl+NPcwM5HWpXk2eiPS4+qogGwuUiT+enUO8i0=@vger.kernel.org X-Gm-Message-State: AOJu0YzbeSN0REqR2YntcpQXF6ewxYg5b5sHUKXzpKYXhTlDTqmK8QH1 p9SPMa8iXj3hLm9wtiIazmbfcy954yu5vHX97yzve/JPVcEziAHonpy+v2p0QDjesSGJbqu84EO xRsYC8Q== X-Google-Smtp-Source: AGHT+IFOK4STJ52RU7m0gtk0HaVDIgUqJIt7KWYDbxaiFvjDsXA+L+1VhnFiXQ5cu4cgUOLCgF9HAYvfaaHx X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:5d42:c43e:5e08:3a85]) (user=irogers job=sendgmr) by 2002:a05:690c:23c6:b0:6db:c34f:9e4f with SMTP id 00721157ae682-6e9d8b5bda4mr102277b3.8.1729876991559; Fri, 25 Oct 2024 10:23:11 -0700 (PDT) Date: Fri, 25 Oct 2024 10:22:59 -0700 In-Reply-To: <20241025172303.77538-1-irogers@google.com> Message-Id: <20241025172303.77538-3-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241025172303.77538-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Subject: [PATCH v1 2/6] perf build: Rename TEST_LOGS to SHELL_TEST_LOGS From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , John Garry , Athira Jajeev , Veronika Molnarova , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Rename TEST_LOGS to SHELL_TEST_LOGS as later changes will add more kinds of test logs. Minor comment tweak in Makefile.perf as more than just test shell tests are checked. Signed-off-by: Ian Rogers --- tools/perf/Build | 6 +++--- tools/perf/Makefile.perf | 2 +- tools/perf/arch/x86/Build | 6 +++--- tools/perf/arch/x86/tests/Build | 6 +++--- tools/perf/tests/Build | 6 +++--- tools/perf/trace/beauty/Build | 6 +++--- tools/perf/util/Build | 6 +++--- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/perf/Build b/tools/perf/Build index 3e486f7df94b..5e385f370dd7 100644 --- a/tools/perf/Build +++ b/tools/perf/Build @@ -65,14 +65,14 @@ gtk-y +=3D ui/gtk/ =20 ifdef SHELLCHECK SHELL_TESTS :=3D $(wildcard *.sh) - TEST_LOGS :=3D $(SHELL_TESTS:%=3D%.shellcheck_log) + SHELL_TEST_LOGS :=3D $(SHELL_TESTS:%=3D%.shellcheck_log) else SHELL_TESTS :=3D - TEST_LOGS :=3D + SHELL_TEST_LOGS :=3D endif =20 $(OUTPUT)%.shellcheck_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)shellcheck -s bash -a -S warning "$<" > $@ || (c= at $@ && rm $@ && false) =20 -perf-y +=3D $(TEST_LOGS) +perf-y +=3D $(SHELL_TEST_LOGS) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index b4dee7c20ed1..a9f2a9f6ebf0 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -260,7 +260,7 @@ else force_fixdep :=3D $(config) endif =20 -# Runs shellcheck on perf test shell scripts +# Runs shellcheck on perf shell scripts ifeq ($(NO_SHELLCHECK),1) SHELLCHECK :=3D else diff --git a/tools/perf/arch/x86/Build b/tools/perf/arch/x86/Build index 87d057491343..1d91c46ad031 100644 --- a/tools/perf/arch/x86/Build +++ b/tools/perf/arch/x86/Build @@ -3,14 +3,14 @@ perf-test-y +=3D tests/ =20 ifdef SHELLCHECK SHELL_TESTS :=3D entry/syscalls/syscalltbl.sh - TEST_LOGS :=3D $(SHELL_TESTS:%=3D%.shellcheck_log) + SHELL_TEST_LOGS :=3D $(SHELL_TESTS:%=3D%.shellcheck_log) else SHELL_TESTS :=3D - TEST_LOGS :=3D + SHELL_TEST_LOGS :=3D endif =20 $(OUTPUT)%.shellcheck_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ &&= rm $@ && false) =20 -perf-test-y +=3D $(TEST_LOGS) +perf-test-y +=3D $(SHELL_TEST_LOGS) diff --git a/tools/perf/arch/x86/tests/Build b/tools/perf/arch/x86/tests/Bu= ild index 3227053f3355..86262c720857 100644 --- a/tools/perf/arch/x86/tests/Build +++ b/tools/perf/arch/x86/tests/Build @@ -13,14 +13,14 @@ perf-test-y +=3D amd-ibs-via-core-pmu.o =20 ifdef SHELLCHECK SHELL_TESTS :=3D gen-insn-x86-dat.sh - TEST_LOGS :=3D $(SHELL_TESTS:%=3D%.shellcheck_log) + SHELL_TEST_LOGS :=3D $(SHELL_TESTS:%=3D%.shellcheck_log) else SHELL_TESTS :=3D - TEST_LOGS :=3D + SHELL_TEST_LOGS :=3D endif =20 $(OUTPUT)%.shellcheck_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ &&= rm $@ && false) =20 -perf-test-y +=3D $(TEST_LOGS) +perf-test-y +=3D $(SHELL_TEST_LOGS) diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build index 03cbdf7c50a0..a51d28c7431c 100644 --- a/tools/perf/tests/Build +++ b/tools/perf/tests/Build @@ -80,14 +80,14 @@ perf-test-y +=3D workloads/ =20 ifdef SHELLCHECK SHELL_TESTS :=3D $(shell find tests/shell -executable -type f -name '*.s= h') - TEST_LOGS :=3D $(SHELL_TESTS:tests/shell/%=3Dshell/%.shellcheck_log) + SHELL_TEST_LOGS :=3D $(SHELL_TESTS:tests/shell/%=3Dshell/%.shellcheck_lo= g) else SHELL_TESTS :=3D - TEST_LOGS :=3D + SHELL_TEST_LOGS :=3D endif =20 $(OUTPUT)%.shellcheck_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ &&= rm $@ && false) =20 -perf-test-y +=3D $(TEST_LOGS) +perf-test-y +=3D $(SHELL_TEST_LOGS) diff --git a/tools/perf/trace/beauty/Build b/tools/perf/trace/beauty/Build index cb3c1399ff40..f50ebdc445b8 100644 --- a/tools/perf/trace/beauty/Build +++ b/tools/perf/trace/beauty/Build @@ -23,14 +23,14 @@ perf-y +=3D tracepoints/ =20 ifdef SHELLCHECK SHELL_TESTS :=3D $(wildcard trace/beauty/*.sh) - TEST_LOGS :=3D $(SHELL_TESTS:trace/beauty/%=3D%.shellcheck_log) + SHELL_TEST_LOGS :=3D $(SHELL_TESTS:trace/beauty/%=3D%.shellcheck_log) else SHELL_TESTS :=3D - TEST_LOGS :=3D + SHELL_TEST_LOGS :=3D endif =20 $(OUTPUT)%.shellcheck_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)shellcheck -s bash -a -S warning "$<" > $@ || (c= at $@ && rm $@ && false) =20 -perf-y +=3D $(TEST_LOGS) +perf-y +=3D $(SHELL_TEST_LOGS) diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 1eedead5f2f2..18cd02ccd3ff 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -398,14 +398,14 @@ $(OUTPUT)util/list_sort.o: ../lib/list_sort.c FORCE =20 ifdef SHELLCHECK SHELL_TESTS :=3D generate-cmdlist.sh - TEST_LOGS :=3D $(SHELL_TESTS:%=3D%.shellcheck_log) + SHELL_TEST_LOGS :=3D $(SHELL_TESTS:%=3D%.shellcheck_log) else SHELL_TESTS :=3D - TEST_LOGS :=3D + SHELL_TEST_LOGS :=3D endif =20 $(OUTPUT)%.shellcheck_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ &&= rm $@ && false) =20 -perf-util-y +=3D $(TEST_LOGS) +perf-util-y +=3D $(SHELL_TEST_LOGS) --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 15:47:01 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22815215C41 for ; Fri, 25 Oct 2024 17:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876997; cv=none; b=SDra/iLv+0ZtP7wGAvjge8YZTzedU8gHRJ8eErtV5MFBNcu0RpqbZYHIpZr9MhYMpp3eJ3vxYZOw/zYgDrjwmaFrsQSPi9iH1GXmAj2VCzd7YxgCxwmsiHsnc7d1XrFJg9fUjeeuUi14b3Mnm4WsHe21hiejf3UgE2iUrqtDwbU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876997; c=relaxed/simple; bh=whrZnL3qoDzvyvEBiYskrp9oEULuMvfjTz/ou0miBHs=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=DjNF5TqBE8nuQ5OGrWE4G8UwrpxUKLWJbqxtofyq0uQ1Xxm951V+Q2GvMgjBWbwHkm2TCTFIzXB7cVPtq7try8OAo4DFSlBV3FLOe6BKTTTZNDs5Ud3U/Vz3U/sLLIycoYTQdLFO4Do/NeCG8ZsB2WrJ9AJpaDKzjstzbxyEVis= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=P8x6dMXH; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="P8x6dMXH" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e9d6636498so5824397b3.2 for ; Fri, 25 Oct 2024 10:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729876994; x=1730481794; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=Sz/UEKXnCGA0PqXPWkBUA1nKH/NXupw2GfE27Aui+BY=; b=P8x6dMXHFnEqbpjrZKHVo2KF3UtBUJeuJr1oNy5AhBczTWJeZX/YxMVk1VU6ZZm269 nSOXutSzWO2Vk95pDHKSx5XbbKhBpOxEbdlw+NkTN8SVrfP4h/jW45GWQF8NaKvs9roF YHUDQjq5eINKW+z7LfK7KDvANn+4aHWwjABy7qdIgmx0h8+k/xkVPsn0nDNRJ7ddnx4/ xSsXHz1mXlwF/Gycf4haek6jIpFN4MIy0xCRV5ZYy9qpxKQrFnpjw706kFLHmXUNAbAL 6YtYXbggacW/kj6SIgAVf69stI4aD9av2vQ+w3NifT4al6W0dQ1H0oVcR1V//VAqOA6D 83kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729876994; x=1730481794; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Sz/UEKXnCGA0PqXPWkBUA1nKH/NXupw2GfE27Aui+BY=; b=jPxQKZPRPFAy6uWc1DlHoOoKNKde4zLQk+h9/5QDKSeVZC1G19LNeL6UduWsjN4/6o m1sXJYlZf3LWrnHZ8IwtUSTzRJ5tzEMHUsOOKb6q0YGl2qlsIAhrvxhzNGHsP56q9jFS vx/ioWpDQBckWbT6dMXhbZ+/I2bz/fBfymbprylvc3k09F6/y0CUsY+PfD7OK+AvuL0r XaQSE+hB6KjbX6vRGizd48oSZsHwTQ4tC+jx+8Hk8YThT88Qyk14tKiLbVBXTYBXO4+P Xw8QxX43igUdKuV1ha6Z7EDAzwH2V1hxTGG8piuH2An0NE0+Chnds5tntMAZrlpyp5G4 IBfA== X-Forwarded-Encrypted: i=1; AJvYcCUnLpkz2jLJrzSUBdfuaIvCNuH9sWhfbe8SYA+mMuvFBQMu8pQzWfjStWVKmCPjAkncSLv8Tq5ogTBXznI=@vger.kernel.org X-Gm-Message-State: AOJu0YwZtW4RtyJavdfq7aeNhLTuMK21xce9wHRSzFpzzxkZlmf0gVLc m+/j8XAjwvl+3RaCmjrQLbReyCYHbg9Giv6aWyufBnAJ+Pv0gfNkfuj0LBdLTj/VwNDexT8CGtf AFVZdsA== X-Google-Smtp-Source: AGHT+IFPkISZQs4e9NKiWIj/FzrvdjqfTcuCXMDAbIZbIt0S3D8ofTGpQ7uXkHKKBP08p+WojO4kBt+PvyNB X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:5d42:c43e:5e08:3a85]) (user=irogers job=sendgmr) by 2002:a05:690c:6811:b0:66a:764f:e57f with SMTP id 00721157ae682-6e9d8afcc6dmr2087b3.7.1729876993661; Fri, 25 Oct 2024 10:23:13 -0700 (PDT) Date: Fri, 25 Oct 2024 10:23:00 -0700 In-Reply-To: <20241025172303.77538-1-irogers@google.com> Message-Id: <20241025172303.77538-4-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241025172303.77538-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Subject: [PATCH v1 3/6] perf build: Add mypy build tests From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , John Garry , Athira Jajeev , Veronika Molnarova , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If MYPY=3D1 is passed to the build then run mypy over python code in perf. Unlike shellcheck this isn't default on as there are currently too many errors. Signed-off-by: Ian Rogers --- tools/perf/Build | 13 +++++++++++++ tools/perf/Makefile.perf | 7 ++++++- tools/perf/pmu-events/Build | 14 +++++++++++++- tools/perf/scripts/Build | 13 +++++++++++++ tools/perf/tests/Build | 13 +++++++++++++ tools/perf/util/Build | 13 +++++++++++++ 6 files changed, 71 insertions(+), 2 deletions(-) diff --git a/tools/perf/Build b/tools/perf/Build index 5e385f370dd7..312914994c89 100644 --- a/tools/perf/Build +++ b/tools/perf/Build @@ -76,3 +76,16 @@ $(OUTPUT)%.shellcheck_log: % $(Q)$(call echo-cmd,test)shellcheck -s bash -a -S warning "$<" > $@ || (c= at $@ && rm $@ && false) =20 perf-y +=3D $(SHELL_TEST_LOGS) + +ifdef MYPY + PY_TESTS :=3D $(shell find python -type f -name '*.py') + MYPY_TEST_LOGS :=3D $(PY_TESTS:python/%=3Dpython/%.mypy_log) +else + MYPY_TEST_LOGS :=3D +endif + +$(OUTPUT)%.mypy_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) + +perf-y +=3D $(MYPY_TEST_LOGS) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index a9f2a9f6ebf0..333afe29b1e2 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -277,8 +277,13 @@ ifneq ($(SHELLCHECK),) endif endif =20 +# Runs mypy on perf python files +ifeq ($(MYPY),1) + MYPY :=3D $(shell which mypy 2> /dev/null) +endif + export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK -export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK +export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK MYPY =20 include $(srctree)/tools/build/Makefile.include =20 diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build index d941bc9d16e9..fc1dc810ffb6 100644 --- a/tools/perf/pmu-events/Build +++ b/tools/perf/pmu-events/Build @@ -41,7 +41,19 @@ $(EMPTY_PMU_EVENTS_TEST_LOG): $(EMPTY_PMU_EVENTS_C) $(TE= ST_EMPTY_PMU_EVENTS_C) $(call rule_mkdir) $(Q)$(call echo-cmd,test)diff -u $^ 2> $@ || (cat $@ && false) =20 -$(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_= TEST_LOG) $(EMPTY_PMU_EVENTS_TEST_LOG) +ifdef MYPY + PMU_EVENTS_PY_TESTS :=3D $(wildcard *.py) + PMU_EVENTS_MYPY_TEST_LOGS :=3D $(JEVENTS_PY_TESTS:%=3D%.mypy_log) +else + PMU_EVENTS_MYPY_TEST_LOGS :=3D +endif + +$(OUTPUT)%.mypy_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) + +$(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_= TEST_LOG) \ + $(EMPTY_PMU_EVENTS_TEST_LOG) $(PMU_EVENTS_MYPY_TEST_LOGS) $(call rule_mkdir) $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) $(JEVENTS= _MODEL) pmu-events/arch $@ endif diff --git a/tools/perf/scripts/Build b/tools/perf/scripts/Build index 46f0c6f76dbf..a5350dc6ac50 100644 --- a/tools/perf/scripts/Build +++ b/tools/perf/scripts/Build @@ -2,3 +2,16 @@ ifeq ($(CONFIG_LIBTRACEEVENT),y) perf-util-$(CONFIG_LIBPERL) +=3D perl/Perf-Trace-Util/ endif perf-util-$(CONFIG_LIBPYTHON) +=3D python/Perf-Trace-Util/ + +ifdef MYPY + PY_TESTS :=3D $(shell find python -type f -name '*.py') + MYPY_TEST_LOGS :=3D $(PY_TESTS:python/%=3Dpython/%.mypy_log) +else + MYPY_TEST_LOGS :=3D +endif + +$(OUTPUT)%.mypy_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) + +perf-y +=3D $(MYPY_TEST_LOGS) diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build index a51d28c7431c..4d7c38a2bf6c 100644 --- a/tools/perf/tests/Build +++ b/tools/perf/tests/Build @@ -91,3 +91,16 @@ $(OUTPUT)%.shellcheck_log: % $(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ &&= rm $@ && false) =20 perf-test-y +=3D $(SHELL_TEST_LOGS) + +ifdef MYPY + PY_TESTS :=3D $(shell find tests/shell -type f -name '*.py') + MYPY_TEST_LOGS :=3D $(PY_TESTS:tests/shell/%=3Dshell/%.mypy_log) +else + MYPY_TEST_LOGS :=3D +endif + +$(OUTPUT)%.mypy_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) + +perf-test-y +=3D $(MYPY_TEST_LOGS) diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 18cd02ccd3ff..3baa1f41502d 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -409,3 +409,16 @@ $(OUTPUT)%.shellcheck_log: % $(Q)$(call echo-cmd,test)shellcheck -a -S warning "$<" > $@ || (cat $@ &&= rm $@ && false) =20 perf-util-y +=3D $(SHELL_TEST_LOGS) + +PY_TESTS :=3D setup.py +ifdef MYPY + MYPY_TEST_LOGS :=3D $(PY_TESTS:%=3D%.mypy_log) +else + MYPY_TEST_LOGS :=3D +endif + +$(OUTPUT)%.mypy_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) + +perf-util-y +=3D $(MYPY_TEST_LOGS) --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 15:47:01 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 663EB215C5C for ; Fri, 25 Oct 2024 17:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876999; cv=none; b=Fv6QpZnSiok5tfsR355LZKKFeo6H+5GN/ysAyQAVeZ5VzRTv8L1nC6QyGoswxp8228SuDUDPOWTqDoFTi+oJyHanXaRvSdv5U7G6vIjSH23rliAx4/y+oK3jEzdX+Zplpupfn/cPNF0sdAhpfZiVWyIbgjrfUvbyM7mE9DoHEvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729876999; c=relaxed/simple; bh=XIcaTzPvlAddesoN9ZYb8TOpkCEOUgxBULA503FfBtM=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=ROyl7Fbj+EVRbXwvu5EU+K9Sa3dV7SYIDVNHgO4HDizVj+yGqpjS/67F/1rqwu4xStTbyZMuaXkfsRmGrdFDL3sqObammFzfNvLzlmBOcRPs6MeOoqkT9iSHK4B0ycYIVU8nD5jqRHigcJ+1XlFXa5aYtv90ieVBoJ/kE5J9O8o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=LkPSYayB; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="LkPSYayB" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e9d6636498so5825107b3.2 for ; Fri, 25 Oct 2024 10:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729876996; x=1730481796; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=SLI7/+S+crXUNgOywJ67SL6jHRzdYtHJtqzDx7qk0Yg=; b=LkPSYayBeBrOB6KOj7eS6cIOa+uu6CRIa/iKgYM7VzWPVSCgVgw38M0SuejcM6woUc Rkk104QWSX4FLGi6YyGN49zCRxI7ROSEAnL5dqTpHK3Q0ZgYgwssMWj2lQgLpU+sQiUx Q5Ln4RdGvIzRFC9CuDgbpoaF08//ixCoxtWydw6T/mtDwXiVjYnwBJGX69i+LJzcpvxT q1CmP/laND23BjpKnwYMgJU/QztnKNHpi7XZiBIBtFZL0nzM+WOuiNZhTFk6f/1XXK0q 69h/PX/C6uo3j+lcxGgEmnj184abGEgsfsN9cB9QAYsuHzDNE3nkvWGaDiDO2BKqYJB+ 0rxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729876996; x=1730481796; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SLI7/+S+crXUNgOywJ67SL6jHRzdYtHJtqzDx7qk0Yg=; b=Q4GzKxwXqaQ9kRfVtP4zyUPfr2rMx5QJdR3WqaLCMba1q4ygzsqMv+JbZIWU6vbcx3 6XhFZ8WXMie9oY3zYxp2XsySypuF1cq687KoBJNQ7td4u3xSlf2aQ2N6MLQEWEUMNQlO iQWsSYJdb2ufGU9HFU96ZZTWxDYcB23638EMXVzU3iFDiuxNLdPLZ9KISFR2P8DmGn+Z 59Tlsd2+M+32ZG3ue17ZEeAZQFVTvIFaYIVjyMqAEEP9Ly8V9sWBBlfI687WPDakZaZK S5REkwHrOiYzmWWvv8iN/hh2t2Bka/+YRYfEMsCCQgNb03jqynSkpp8+oM/yeK5KC8Sp HQxA== X-Forwarded-Encrypted: i=1; AJvYcCUOa5qCQAGLLLlx1gUuSWnM9g15aqPh5njVl3M04CHNpo5BaysEyGDSunTndoOY2KzJhdYpWu76hxNtb2c=@vger.kernel.org X-Gm-Message-State: AOJu0YyfSOJRXH09qoZ3LIc+MANb9CBMo6EenbKlBYPbEzK5daQMCOkf LTxFD7OV5mRttuTu4hhVBqQoXQk4kXxFZEc2eGDsEdbpWWYus31fwVAWl2RpgFPQnp9s6Pw508l dz8KPkg== X-Google-Smtp-Source: AGHT+IGZoiQWvQ9JAee83WAw23PvOLRlPb5zfwsVSV//zAik7AAW4oFxucqd6otaGBmC2uu89bqfF+/DXLE7 X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:5d42:c43e:5e08:3a85]) (user=irogers job=sendgmr) by 2002:a81:a884:0:b0:6e2:371f:4aef with SMTP id 00721157ae682-6e9d8a77e6amr2677b3.3.1729876996311; Fri, 25 Oct 2024 10:23:16 -0700 (PDT) Date: Fri, 25 Oct 2024 10:23:01 -0700 In-Reply-To: <20241025172303.77538-1-irogers@google.com> Message-Id: <20241025172303.77538-5-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241025172303.77538-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Subject: [PATCH v1 4/6] perf build: Add pylint build tests From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , John Garry , Athira Jajeev , Veronika Molnarova , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If PYLINT=3D1 is passed to the build then run pylint over python code in perf. Unlike shellcheck this isn't default on as there are currently too many errors. Signed-off-by: Ian Rogers --- tools/perf/Build | 13 +++++++++++++ tools/perf/Makefile.perf | 7 ++++++- tools/perf/pmu-events/Build | 13 ++++++++++++- tools/perf/scripts/Build | 13 +++++++++++++ tools/perf/tests/Build | 13 +++++++++++++ tools/perf/util/Build | 12 ++++++++++++ 6 files changed, 69 insertions(+), 2 deletions(-) diff --git a/tools/perf/Build b/tools/perf/Build index 312914994c89..06107f1e1d42 100644 --- a/tools/perf/Build +++ b/tools/perf/Build @@ -89,3 +89,16 @@ $(OUTPUT)%.mypy_log: % $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) =20 perf-y +=3D $(MYPY_TEST_LOGS) + +ifdef PYLINT + PY_TESTS :=3D $(shell find python -type f -name '*.py') + PYLINT_TEST_LOGS :=3D $(PY_TESTS:python/%=3Dpython/%.pylint_log) +else + PYLINT_TEST_LOGS :=3D +endif + +$(OUTPUT)%.pylint_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)pylint "$<" > $@ || (cat $@ && rm $@ && false) + +perf-y +=3D $(PYLINT_TEST_LOGS) diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf index 333afe29b1e2..6b5b420d794a 100644 --- a/tools/perf/Makefile.perf +++ b/tools/perf/Makefile.perf @@ -282,8 +282,13 @@ ifeq ($(MYPY),1) MYPY :=3D $(shell which mypy 2> /dev/null) endif =20 +# Runs pylint on perf python files +ifeq ($(PYLINT),1) + PYLINT :=3D $(shell which pylint 2> /dev/null) +endif + export srctree OUTPUT RM CC CXX LD AR CFLAGS CXXFLAGS V BISON FLEX AWK -export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK MYPY +export HOSTCC HOSTLD HOSTAR HOSTCFLAGS SHELLCHECK MYPY PYLINT =20 include $(srctree)/tools/build/Makefile.include =20 diff --git a/tools/perf/pmu-events/Build b/tools/perf/pmu-events/Build index fc1dc810ffb6..32f387d48908 100644 --- a/tools/perf/pmu-events/Build +++ b/tools/perf/pmu-events/Build @@ -52,8 +52,19 @@ $(OUTPUT)%.mypy_log: % $(call rule_mkdir) $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) =20 +ifdef PYLINT + PMU_EVENTS_PY_TESTS :=3D $(wildcard *.py) + PMU_EVENTS_PYLINT_TEST_LOGS :=3D $(JEVENTS_PY_TESTS:%=3D%.pylint_log) +else + PMU_EVENTS_PYLINT_TEST_LOGS :=3D +endif + +$(OUTPUT)%.pylint_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)pylint "$<" > $@ || (cat $@ && rm $@ && false) + $(PMU_EVENTS_C): $(JSON) $(JSON_TEST) $(JEVENTS_PY) $(METRIC_PY) $(METRIC_= TEST_LOG) \ - $(EMPTY_PMU_EVENTS_TEST_LOG) $(PMU_EVENTS_MYPY_TEST_LOGS) + $(EMPTY_PMU_EVENTS_TEST_LOG) $(PMU_EVENTS_MYPY_TEST_LOGS) $(PMU_EVENTS= _PYLINT_TEST_LOGS) $(call rule_mkdir) $(Q)$(call echo-cmd,gen)$(PYTHON) $(JEVENTS_PY) $(JEVENTS_ARCH) $(JEVENTS= _MODEL) pmu-events/arch $@ endif diff --git a/tools/perf/scripts/Build b/tools/perf/scripts/Build index a5350dc6ac50..91229a1fe3ff 100644 --- a/tools/perf/scripts/Build +++ b/tools/perf/scripts/Build @@ -15,3 +15,16 @@ $(OUTPUT)%.mypy_log: % $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) =20 perf-y +=3D $(MYPY_TEST_LOGS) + +ifdef PYLINT + PY_TESTS :=3D $(shell find python -type f -name '*.py') + PYLINT_TEST_LOGS :=3D $(PY_TESTS:python/%=3Dpython/%.pylint_log) +else + PYLINT_TEST_LOGS :=3D +endif + +$(OUTPUT)%.pylint_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)pylint "$<" > $@ || (cat $@ && rm $@ && false) + +perf-y +=3D $(PYLINT_TEST_LOGS) diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build index 4d7c38a2bf6c..5fe011cf897b 100644 --- a/tools/perf/tests/Build +++ b/tools/perf/tests/Build @@ -104,3 +104,16 @@ $(OUTPUT)%.mypy_log: % $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) =20 perf-test-y +=3D $(MYPY_TEST_LOGS) + +ifdef PYLINT + PY_TESTS :=3D $(shell find tests/shell -type f -name '*.py') + PYLINT_TEST_LOGS :=3D $(PY_TESTS:tests/shell/%=3Dshell/%.pylint_log) +else + PYLINT_TEST_LOGS :=3D +endif + +$(OUTPUT)%.pylint_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)pylint "$<" > $@ || (cat $@ && rm $@ && false) + +perf-test-y +=3D $(PYLINT_TEST_LOGS) diff --git a/tools/perf/util/Build b/tools/perf/util/Build index 3baa1f41502d..c33e2372579e 100644 --- a/tools/perf/util/Build +++ b/tools/perf/util/Build @@ -422,3 +422,15 @@ $(OUTPUT)%.mypy_log: % $(Q)$(call echo-cmd,test)mypy "$<" > $@ || (cat $@ && rm $@ && false) =20 perf-util-y +=3D $(MYPY_TEST_LOGS) + +ifdef PYLINT + PYLINT_TEST_LOGS :=3D $(PY_TESTS:%=3D%.pylint_log) +else + PYLINT_TEST_LOGS :=3D +endif + +$(OUTPUT)%.pylint_log: % + $(call rule_mkdir) + $(Q)$(call echo-cmd,test)pylint "$<" > $@ || (cat $@ && rm $@ && false) + +perf-util-y +=3D $(PYLINT_TEST_LOGS) --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 15:47:01 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCFC7215C7D for ; Fri, 25 Oct 2024 17:23:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729877001; cv=none; b=coIpQXCh+3HuJhoIwbxR8J4JHQdjVcR+3bMbvef8GvBeNQUt5LhyWg2mSfB75VvgPQM9IeJRPsiUzgwOi4viVqdHN9hvMeQJLeObgWlwAe2utCuxRxjSTGusu3L0bcQ8822XVHEjUm7+ne6uxPwC1xqziQa0FGV25/pMicTrPGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729877001; c=relaxed/simple; bh=GBM4ZicRscGoqeRG2umNjcjdQ21UpmRmU+k4VWUF7rE=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=bhDVKJGEaCOWTFjWQsto4KoRcctgdWqXzNzjamlmkplA+CEnOPI1CtN/UIVVTYS9wdvSpIIE/NTwS5U1YeWFkJnQGR5bsf6MvXfnh/1EI47TSkOu4yhS7zROSTHgUWhtCc2TAMgasDgaoo4tNznz4SUpd8Trveaeq8l2kUDkw5Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=hQERRMzy; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="hQERRMzy" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e38fabff35so47026317b3.0 for ; Fri, 25 Oct 2024 10:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729876999; x=1730481799; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=4tDa78t8ycfTpXeP4Xg4vb+EbbxD0z0lIJ18k3gRsWI=; b=hQERRMzy+dcJjFGP7GY2FUYLOhBxAL6ApOUvoabDJpNlj9bjqEYvSzBa+4yaHlaSnc fvHD9/XKdCzZ2jSFI2wQcSzh/lzRAcDaEBDTfPeN5smpZh3QXB5T8q7OklkZ7kOvZPhi tvGSDu7Ah2SiYGqNxuFElCeFWvdN/vBHQtH+lW+a260+hQAhArHaMTDw0Oyel8n00v4J cQuZPJ+sgsAtiuEwqVSaOBmCBJlFgogUBPAbn11hvY9/8+atG7dNCfRNzfLYzUYeK9M3 LG7LiXU9EFVlTupwAfCIVj3aAJSDr3xywWezbud57jLzcKzvIzXKQyNVdecDx14PY7wM 75AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729876999; x=1730481799; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4tDa78t8ycfTpXeP4Xg4vb+EbbxD0z0lIJ18k3gRsWI=; b=MKqh49mXhuHyCkiyQzdmzsuB+AD44rP7HYudYvsUhOlWEKqQetoTdC+fIuASqMfPFa uEAAQFF6ksHaUgtdjLWYTFrDaO8Axk8NWiXOisYaZvslQO+q7wU5Nh5uOSTfKO4UVF4R k+/iQyohaibDlbyYApBiDszoQWE44VhQSqurpEcK8YofkFh6athg+oEcQRW3ldjRawZ+ dCuw0+IvhSCwSi5Ct/T9a4CdP+vb9kgqvDqGSXC3QAm5MsnWCbsm7+rU8iZKrb10WP9I E/3f3xmMzG/FMw0va/RYX+4D5lF103hQvI5NJN27/AvKU2/RG4KqyTL1EZV/c4A0LMWG L3ug== X-Forwarded-Encrypted: i=1; AJvYcCUln9cmeOMxvk71hGBiqcvWtbnZCfyynuGmlCOfdqoxPaIhDWVUY1VB5NvbtybHKGmqhHImN4T1ctqPARg=@vger.kernel.org X-Gm-Message-State: AOJu0YzZtyk9Tgr4Rj1CV5GpfvmPsUV65R18JEfW8gw8bAKAIzQ7Ccpn LM5Nz3m2zxe+DKT/ff9r+J4XRUuv5PdVV+NN1jaR/Iv+013QQ4bQbrY95J6H4/ppifslZIpb8vG z5CQT4Q== X-Google-Smtp-Source: AGHT+IEaZf1v2yI9/Za5ZHqS0DAFR3/KKmYp+kS4oGJPHqjPKFClcc6w5G+qVcN+YOlSFNHhya0UY86aEUKp X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:5d42:c43e:5e08:3a85]) (user=irogers job=sendgmr) by 2002:a05:690c:f:b0:6e3:6414:80c5 with SMTP id 00721157ae682-6e9d87b4522mr10297b3.0.1729876998917; Fri, 25 Oct 2024 10:23:18 -0700 (PDT) Date: Fri, 25 Oct 2024 10:23:02 -0700 In-Reply-To: <20241025172303.77538-1-irogers@google.com> Message-Id: <20241025172303.77538-6-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241025172303.77538-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Subject: [PATCH v1 5/6] perf test: Address attr.py mypy error From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , John Garry , Athira Jajeev , Veronika Molnarova , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ConfigParser existed in python2 but not in python3 causing mypy to fail. Whilst removing a python2 workaround remove reference to __future__. Signed-off-by: Ian Rogers --- tools/perf/tests/shell/lib/attr.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/perf/tests/shell/lib/attr.py b/tools/perf/tests/shell/li= b/attr.py index 3db9a7d78715..bfccc727d9b2 100644 --- a/tools/perf/tests/shell/lib/attr.py +++ b/tools/perf/tests/shell/lib/attr.py @@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 =20 -from __future__ import print_function - +import configparser import os import sys import glob @@ -13,11 +12,6 @@ import re import shutil import subprocess =20 -try: - import configparser -except ImportError: - import ConfigParser as configparser - def data_equal(a, b): # Allow multiple values in assignment separated by '|' a_list =3D a.split('|') --=20 2.47.0.163.g1226f6d8fa-goog From nobody Mon Nov 25 15:47:01 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FF99217454 for ; Fri, 25 Oct 2024 17:23:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729877004; cv=none; b=iBWkNl3mpC6Ld/h662foxYbwpder/9DHTithlo8h+tD6thb58fn9QLLxxnjS7qFlEf2iR/xccyBJQUrfZXcXoeC1k2/sBEJIS88zbwiDqCfd97lhy80ZKr43vwgKYTfQUPoRzEUnXoQ7AVAUbVfBPJRamil6VUdDpgvqLTZJTuc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729877004; c=relaxed/simple; bh=f6QE0Qn9b12eCjBKI2V7KW/KAZe5l2VYiK5SexO5YnY=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=OIJCwaTJUY6/wvQZdQO5X58CXe8RHYA3ko6viSqalEYzOvpEiT+cAQr57RgwWkGXKW31BZdaee1Gef57sd7v0KXIaRwCoMsc2oTL7m6kjSC91OPnM9pXxDRbft7OeYwfHc/kybP9nXPolcF7vRvLOIBdPhdy/KHQbSntCdjE2hA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=oXMIeMnM; arc=none smtp.client-ip=209.85.219.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="oXMIeMnM" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e291ac8dcf3so3999669276.3 for ; Fri, 25 Oct 2024 10:23:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729877001; x=1730481801; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=FbqflGTx7CldhGCbP/KKXIEFYVyDlX4onDQk9rCC00w=; b=oXMIeMnMD10XQtgHxr3wT7uDSV2bIRBQgGkgjWcwpyzQcLvTFRXhOS3d1w24K91Yjz sN2Y6K1Hj9nmKpZglcwOu9zOUt3jZ+8huExmNyMzHaOu27THZ8fRLx7ItZdCSlsTyiV2 0DS0aCkyPgWcCupNxuDm1tpGPzlCOEQwVHz7dnKXx7k0DqyF/ijJQlJboE1o7IXX0y7k xU8NEkNPHjsqGvaHlOyLAdJfxoSrcxWPIvRgMK3n/kA3cVLFvxFVK7yeNJZ49/EXDAiJ TbYkUlhknbgjlCzqTBQ6K+y6jWqMUQ7AZpRaVgiqsmoy03opZwYZzA1mweYApU6AQ5iB N9jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729877001; x=1730481801; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FbqflGTx7CldhGCbP/KKXIEFYVyDlX4onDQk9rCC00w=; b=oGpGNm5lLcb60B2bcwle/eBufFh1Yuo6mhQlk+J0g4fFEAuekYk1n/jGE1kYrID0Gv VISk3TG1P4oCPM2yNnzmmLZ8w8RXKIeXm346tNJQnmhaLNboUqqenjr74Rb6a2y9g86f rQbTTvpgyQ4XrPKsj5p40L8dfr3rRgBNOkkOUcLupFlxUXvBDerj9CxyUPQXHcoseUVZ Sptax4ku9cYFddWxhGewZd4w/TkiNlVOi9GHsoiGLpwcakf9L7PHS6OsrjMHLevvE7Nb K6zHPFUF4hctRg/FWEiVa6y1Q7Fd8EgGUnyDzAv1w8JbK0iICEykNVPsl9GN0Youxt+0 boYw== X-Forwarded-Encrypted: i=1; AJvYcCVSRhRkdG7Fg9hR+TKZyc0a8stZMAF/Fnu6vsdjT1/hNWdp/juDC06HxmfxpaD8LXplJMALT9yFw41iQp4=@vger.kernel.org X-Gm-Message-State: AOJu0YxSMfNZmP7HO/RQM3I16lLGgpmFJfJT8gFCm+mI5t01r44g8D4m MwMu8xQSc5CrWDhmM4+YFg0VyxsL/565OQWgSWDGW1OcHOH5ZYCn4W1uhKt31T+/tuzuOSqnSKY 3NMNA7A== X-Google-Smtp-Source: AGHT+IGANBTbxP9uqUtLEAG/z+bqH1Yapu9/gBtTn5hF7Sva9IgdS4fCS7fa0s1vcAX4O9hvRjxKwcj7Zh58 X-Received: from irogers.svl.corp.google.com ([2620:15c:2c5:11:5d42:c43e:5e08:3a85]) (user=irogers job=sendgmr) by 2002:a25:6b11:0:b0:e2e:2fe8:2d0b with SMTP id 3f1490d57ef6-e3087b69f72mr177276.5.1729877001252; Fri, 25 Oct 2024 10:23:21 -0700 (PDT) Date: Fri, 25 Oct 2024 10:23:03 -0700 In-Reply-To: <20241025172303.77538-1-irogers@google.com> Message-Id: <20241025172303.77538-7-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241025172303.77538-1-irogers@google.com> X-Mailer: git-send-email 2.47.0.163.g1226f6d8fa-goog Subject: [PATCH v1 6/6] perf python: Fix setup.py mypy errors From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , James Clark , John Garry , Athira Jajeev , Veronika Molnarova , Ze Gao , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" getenv may return None, so assert it isn't None for CC and srctree environmental variables required for the script. Disable an optional warning related to Popen. Signed-off-by: Ian Rogers --- tools/perf/util/setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 649550e9b7aa..dd289d15acfd 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -3,6 +3,7 @@ from subprocess import Popen, PIPE from re import sub =20 cc =3D getenv("CC") +assert cc, "Environment variable CC not set" =20 # Check if CC has options, as is the case in yocto, where it uses CC=3D"cc= --sysroot..." cc_tokens =3D cc.split() @@ -12,8 +13,13 @@ if len(cc_tokens) > 1: else: cc_options =3D "" =20 +# ignore optional stderr could be None as it is set to PIPE to avoid that. +# mypy: disable-error-code=3D"union-attr" cc_is_clang =3D b"clang version" in Popen([cc, "-v"], stderr=3DPIPE).stder= r.readline() -src_feature_tests =3D getenv('srctree') + '/tools/build/feature' + +srctree =3D getenv('srctree') +assert srctree, "Environment variable srctree, for the Linux sources, not = set" +src_feature_tests =3D f'{srctree}/tools/build/feature' =20 def clang_has_option(option): cc_output =3D Popen([cc, cc_options + option, path.join(src_feature_te= sts, "test-hello.c") ], stderr=3DPIPE).stderr.readlines() @@ -71,7 +77,7 @@ else: # The python headers have mixed code with declarations (decls after assert= s, for instance) cflags +=3D [ "-Wno-declaration-after-statement" ] =20 -src_perf =3D getenv('srctree') + '/tools/perf' +src_perf =3D f'{srctree}/tools/perf' build_lib =3D getenv('PYTHON_EXTBUILD_LIB') build_tmp =3D getenv('PYTHON_EXTBUILD_TMP') =20 --=20 2.47.0.163.g1226f6d8fa-goog