From patchwork Fri May 29 22:12:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 1301062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Yf2h4g6jz9sRN; Sat, 30 May 2020 08:12:59 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jenFF-0000e1-BL; Fri, 29 May 2020 22:12:53 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jenFD-0000dv-Vh for kernel-team@lists.ubuntu.com; Fri, 29 May 2020 22:12:51 +0000 Received: from 1.general.cascardo.us.vpn ([10.172.70.58] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jenFD-000235-80 for kernel-team@lists.ubuntu.com; Fri, 29 May 2020 22:12:51 +0000 From: Thadeu Lima de Souza Cascardo To: kernel-team@lists.ubuntu.com Subject: [SRU Eoan] UBUNTU: SAUCE: kselftest: ftrace: check for existing probe Date: Fri, 29 May 2020 19:12:38 -0300 Message-Id: <20200529221238.1065202-1-cascardo@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Buglink: https://bugs.launchpad.net/bugs/1866972 When testing multiple_kprobes.tc, it will try to add repeated probes. On 5.4, it will return EEXIST, and the test will keep adding probes until it gets to 256 probes. On 5.3, it will return success, but not add a new probe. The test will then fail expecting 256 probes, but less than that were really added. Fixing the test to check for those existing probes before adding them is less prone to regressions. After that, the test will succeed, as it skips trying to add existing probes. Signed-off-by: Thadeu Lima de Souza Cascardo Acked-by: Kleber Sacilotto de Souza Acked-by: Kelsey Skunberg --- tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc index 6e3dbe5f96b7..4b860bfc64be 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc @@ -16,6 +16,7 @@ N=0 echo "Setup up kprobes on first available 256 text symbols" grep -i " t " /proc/kallsyms | cut -f3 -d" " | grep -v .*\\..* | \ while read i; do + grep -qw ${i} kprobe_events && continue echo p ${i}+${OFFS} >> kprobe_events && N=$((N+1)) ||: test $N -eq 256 && break done