From patchwork Wed Oct 18 14:40:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francis Laniel X-Patchwork-Id: 154908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4839405vqb; Wed, 18 Oct 2023 07:41:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGP1nvyIgdu6giYboif2zEOugd/BXX77lPQo2A1ppaiWePA6icmgplH2aFrXgrewjrryAdM X-Received: by 2002:a05:6359:320a:b0:166:d975:8dab with SMTP id rj10-20020a056359320a00b00166d9758dabmr4864541rwb.1.1697640091672; Wed, 18 Oct 2023 07:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697640091; cv=none; d=google.com; s=arc-20160816; b=rbTOJylm9x9cqurD2KOi1qEJoCA1KZgkZkx8rwlbS30USodqILyH6KMRlpWMDAFBQ0 cWw9XZKVjM9SqLaYPhjxceCQfhjMr3pgXkZURAeFMdPU1PKn8s/LUjNSyPOUYP3QMlf/ iNw1aObqvxJTJuL/EctDBZUp64K1tepES9nKdf8fhT02IHdYN6ruNOdFfXc6xhJQTp4P J1zW3GbVlj+yCCpfK5QfwyUI+wAcBmZqkU+tm2WG3fs8tlLIZ9Z1dhoTfkr423WF7U5h +Xwu5bFWtd9mz5z5+HprNndM8ZGAojjvf6wPdOrqAtVRK2xsMryICcAYLxAOteAxNZ3V FYFA== 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.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id x4-20020a056a00188400b006be30cdc3d8si4222296pfh.163.2023.10.18.07.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 07:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; 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.36 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 pete.vger.email (Postfix) with ESMTP id 155C18022C3C; Wed, 18 Oct 2023 07:41:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235242AbjJROlL (ORCPT + 23 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 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 07:41:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780104656397817885 X-GMAIL-MSGID: 1780104656397817885 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 -- 2.34.1 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