Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp926040rdb; Fri, 20 Oct 2023 03:43:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEv3JtQmjjqjwVfragm/gB6fiEGiMVdlJytgTfqXZcmGzl5eLn+kTdKBGpdfnMjY7XuCcd+ X-Received: by 2002:a05:6871:5309:b0:1e9:f140:1b8b with SMTP id hx9-20020a056871530900b001e9f1401b8bmr1982028oac.59.1697798611621; Fri, 20 Oct 2023 03:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697798611; cv=none; d=google.com; s=arc-20160816; b=l5OgEGur7TRr9L1ooIOUsOlI1TNQSxmP9nms9j1vN6CCPmhkiIB+d+0ky7kaO09way kzQTHho8O+Q3/M+D8OuqSS7TLwranv3yjNX52WQB0X46kSlkmVfnh4fQ0Hyqu0kzioc8 SRK8sdYqQ8b/TxVe61tyGhooKBWYupTuHc94BqMQOlBQ2KFAp0dwqs4xhFPhnTf1q0AP NxYcLIlGotjyeV3w5Gbbei+t1JWJoYocmi6YW5HdecRob2HGS+8vk9uvwon/D9wTfXJQ NvBgYTuILtTWn+U3d+sj7Ragl0IXVxJnaemIcz/kXxF0cu4FC8YGy3QdwQ49P7yHcx60 5PBw== 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=jHEMFSWvEcx1czRBXUE2OS96KE3ALvaIroFuMgx4g8g=; fh=hKV3imhyLdLg/YPlbhw3l8jGKba1w7M7ni3k4xpQwNE=; b=GqBXSOXnhrxLMI1Rs5TAF1gWwoT7p2K4XO29CjRGEWgII5byVgq2l3h7HHkp38Dcx1 68JMiaKCPqjqgWcYyVZjz4i2w+TRsjgTlkznRc7AsmJr6/parUdrCrFVBFsAvFIH1Mqo m089j2I3Bqe3uP6dNun/yjRVtaG5kTlPpddayw6R3GeFkDOKL9ym+rbkBtaF7Gjuhfuj skqP4efnmgh7LC/BToDMm+xFLYW7L76i3IHSeBAqYmSGbulDnxSNUQtjvqZS0ETrDnwF mL5rWxIiwAsurjRKVPwjdLkYdfDJTMhVuAk9IB2pwdf77X9M57Sm3tUWkFEY9+eTdQS0 Z/Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=G4ZwyRGD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id i23-20020a633c57000000b00565eccbc52fsi1669757pgn.303.2023.10.20.03.43.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=G4ZwyRGD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 3C84A82A3F51; Fri, 20 Oct 2023 03:43:29 -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 S1376971AbjJTKnZ (ORCPT + 99 others); Fri, 20 Oct 2023 06:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376699AbjJTKnX (ORCPT ); Fri, 20 Oct 2023 06:43:23 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5F82EA4; Fri, 20 Oct 2023 03:43:22 -0700 (PDT) Received: from pwmachine.numericable.fr (unknown [188.24.154.80]) by linux.microsoft.com (Postfix) with ESMTPSA id CB9AA20B74C0; Fri, 20 Oct 2023 03:43:19 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com CB9AA20B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1697798601; bh=jHEMFSWvEcx1czRBXUE2OS96KE3ALvaIroFuMgx4g8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G4ZwyRGDZ8VV6xRFRRI5YT2sOs4vbJ9C1Ls7T6m8Ll4k+alQa91Ymp65cGpTEHlvM fivLgH/sEdRBx51wFJ5cBYSAa87N3p4rUHYZl3JyELXjwSm+WgCsYP86XHT7wto0Fe 1f9HbJFCI1NfES2mnL2pq6X2moTAjGc68KWZk4qQ= From: Francis Laniel To: linux-trace-kernel@vger.kernel.org Cc: Masami Hiramatsu , Francis Laniel , stable@vger.kernel.org, Steven Rostedt , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH v6 2/2] selftests/ftrace: Add new test case which checks non unique symbol Date: Fri, 20 Oct 2023 13:42:50 +0300 Message-Id: <20231020104250.9537-3-flaniel@linux.microsoft.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231020104250.9537-1-flaniel@linux.microsoft.com> References: <20231020104250.9537-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]); Fri, 20 Oct 2023 03:43:29 -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. Cc: stable@vger.kernel.org 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