Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3845346rdg; Wed, 18 Oct 2023 07:41:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBwzGFySVdYGA6Pv1i4eYe6gGjd3GDBpbH3Lgh4vrDXcOispkrLhUg5J6SfZ9kZH9guH+W X-Received: by 2002:a05:6359:7209:b0:143:5180:1700 with SMTP id uu9-20020a056359720900b0014351801700mr4985325rwb.27.1697640083832; Wed, 18 Oct 2023 07:41:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697640083; cv=none; d=google.com; s=arc-20160816; b=iQ4y//BtXERuWl6529WQExIWa/xBEtN8yYHuZe6RIVeOjSN7mqoDp2IB4DrdvamGsa Jr2XZnTlpPazMmVcbJQS2mO5CBNp1SRsOuaMllaTgG1A6JhqMQljgpUDL2Ys7+panVAb eJMQgoQVO9Nd350YMfk0UMkAKDISNiSeQ/GuOOC3YRBaMUeSQoFOzQjs9MJ1sOs8+ldW ujmb586J3MvxV4MxhInQkswcKNIFdWyGE/jFvQhb4D+JWD83+n2OtVCNfo67YiUSxSoi 2alpyF11oLKRk6Z/e8fdEYDWyRvtHSDNiuv4LHBzStPtsj+DbB4frLV9T9PKbqCqcnpC i8ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=xfU7t1LgNcdblzWvppUIKK8lYqVIT5V5QuCHhVdi4XA=; fh=C+HpNNXT2Lb0cuD1vcC5eXxufB72DUxrdImbb4uYsfw=; b=YakW9C0QI9x581KMx0u6PrT6WvF/uvO3C8wttlY8RP0zJWRs01En0WJGG+4wZIKdkT JKWLC8UQU+8zpAoIywQQd43IWNxE6c/q0E+8zrdpl7vRgXyeHDI7lqDvErmeR4RQiQr+ unqK057tZr0yFmyczQYgn1oUAeHJyPDfsRLqQxgkk2S+jN9REPUvTyBy2tcwHNDrsp69 0QxWrADcMXExRDOLrZ2yb8XmiWAbPX7/cJBUdo/nM7qAOi/DSkAyoELX2rmvzf32u4zu rye+HwPXYBOuPmLtUvShMIBORkVwLqE4rF5bS3eLTWcQd36NjkMOovtHT3g4gU4DdgtT mx7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jj8G1UuN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id d8-20020a63f248000000b005ad14d37968si2180250pgk.773.2023.10.18.07.41.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 07:41:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jj8G1UuN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 9B5778226F0B; Wed, 18 Oct 2023 07:41:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235219AbjJROlL (ORCPT + 99 others); Wed, 18 Oct 2023 10:41:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231984AbjJROlJ (ORCPT ); Wed, 18 Oct 2023 10:41:09 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C4679112; Wed, 18 Oct 2023 07:41:04 -0700 (PDT) Received: from pwmachine.numericable.fr (unknown [188.24.154.80]) by linux.microsoft.com (Postfix) with ESMTPSA id E6C8E20B74C2; Wed, 18 Oct 2023 07:41:01 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E6C8E20B74C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1697640064; bh=xfU7t1LgNcdblzWvppUIKK8lYqVIT5V5QuCHhVdi4XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jj8G1UuN9Bk/jt7qcdNl+3JbxLcchuZl5ENkdpTuNUHmsmpsB+5UyK3Da+JmSQxRE iByd2j7wE4UOQvR9Pj58rqHZZb03r+jez6TUt9GqPMe+z43DeK3+J5EEri0uGVFWcw IO4XORpsoyWdS8ndO6+MKMW5RVrWhs8Z3mrBTyWo= From: Francis Laniel To: linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , stable@vger.kernel.org, Francis Laniel , Steven Rostedt , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v5 2/2] selftests/ftrace: Add new test case which checks non unique symbol Date: Wed, 18 Oct 2023 17:40:30 +0300 Message-Id: <20231018144030.86885-3-flaniel@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018144030.86885-1-flaniel@linux.microsoft.com> References: <20231018144030.86885-1-flaniel@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 18 Oct 2023 07:41:21 -0700 (PDT) If name_show() is non unique, this test will try to install a kprobe on this function which should fail returning EADDRNOTAVAIL. On kernel where name_show() is not unique, this test is skipped. Signed-off-by: Francis Laniel --- .../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc new file mode 100644 index 000000000000..bc9514428dba --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc @@ -0,0 +1,13 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Test failure of registering kprobe on non unique symbol +# requires: kprobe_events + +SYMBOL='name_show' + +# We skip this test on kernel where SYMBOL is unique or does not exist. +if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}" /proc/kallsyms)" -le '1' ]; then + exit_unsupported +fi + +! echo "p:test_non_unique ${SYMBOL}" > kprobe_events -- 2.34.1