Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2401124rwr; Fri, 28 Apr 2023 09:49:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4XbE/2r5c2FDpFHHzhoTHt6yo72HesoE/6WJFdOLiQ+U8p6szTrlqzZypm9+L5AQ887swU X-Received: by 2002:a05:6a00:124f:b0:63b:7954:9881 with SMTP id u15-20020a056a00124f00b0063b79549881mr8378868pfi.28.1682700562973; Fri, 28 Apr 2023 09:49:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682700562; cv=none; d=google.com; s=arc-20160816; b=jwZhYDk6NVA1A6oGSMtmOu4r6XPDNhs8TLAQxb5vtHrpX98P1B76FC8O/fx0m59e2y 8T8dLmJbY+QKEu0ohO+gsG75tO3FeNup7j73q8CCqLLh/yz+MdAKd3rzg6yvy+KDyGEO 5NlrfBrF53HYytjE0zZZUmyWd4lVyz4Tt2MhWb8V/p0rtUrD1mmWQ5AbYVxiT1y2Q3EP WdTbdVOinzpQ0jMIz97D3QwU0LB817vxzTd24Xc4RyE5vSgC9WtoEqCexUiECtSEOKIU IlCPC5Ym+8z4fqYf3sK9B6fW07F1TgFe0HmC5HeF2DRMFbJbRf3hjHZDGL9iD0m6nEol Gq7A== 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; bh=1VFq6zyI75ZkAy0GmVMbORMhJmkyPnnRdcx8uJyRGqc=; b=pkGkPUxeLY88apKibm2SPLvq6Pf0DX9875eiLIObh1VIt1lKRkFHMK0Ie32sCl5ipc Tt7oqSgmh9OEdtqb7QcM8LLb+IZk0Q3DtbSVXh4PenXoLZ8cu0IugfKKGRmf4A9saijE b/En0ffJ8ZIQ7dKlvCI9LkmP8wYh6VRIbtAHCx2CpbLEDZhqtiVo1sDA6xYkvvunYYI1 2xNNlQRliSfVItXpLC20A/k7H8ftev29VSmGsvUS5EkB4bNKDxtDzbhj8QNf/uZI54Ca DFG+roeLG8egFsp0Ojbr9Lid0zKLakLXCrnjVoa5sAfe0NTechHyBn7zvtir0JnYAHJu f6hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=hBg76IQP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 193-20020a6300ca000000b0051909d663dasi22245520pga.726.2023.04.28.09.48.52; Fri, 28 Apr 2023 09:49:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=hBg76IQP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346304AbjD1Qj7 (ORCPT + 99 others); Fri, 28 Apr 2023 12:39:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229997AbjD1Qj6 (ORCPT ); Fri, 28 Apr 2023 12:39:58 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61DC459DC; Fri, 28 Apr 2023 09:39:50 -0700 (PDT) Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33SGbMfm029807; Fri, 28 Apr 2023 16:39:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=1VFq6zyI75ZkAy0GmVMbORMhJmkyPnnRdcx8uJyRGqc=; b=hBg76IQPZU3C0X57/Yzuon3bKGAoht2zXv3xMlz6wEm8GRQoQVNaL7IgUCvl3HrTMWE1 OVr+AXTZoL3c90Lz46QCDi+4/lNGrhoUcwEMNqio6DNnnoT09DiRlWtAPZkIeCpkHOuz 4RDFdm9j0vjKFDkqgGzmxcMruCvj7dRKGS1+ZRbVEpBCP3inPajmSlbwpUxwcODEeq9N EW6sdJMbMVxik0i7P+6YMGILEvWmUXhRAT7yBUGOQFD75HxZ6h/ml6WCH0jBjDFGneI1 IeG9fy2VXMUJz1KkubtWDPaudvgCcUpgmvHd6FXBAf5LDNEwMU4te5JN1WO8sKtPSrkp 7g== Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3q8gjw2ggp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Apr 2023 16:39:46 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 33SGbMhA027503; Fri, 28 Apr 2023 16:38:58 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3q47773nsr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 28 Apr 2023 16:38:58 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 33SGct7c36831502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Apr 2023 16:38:55 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F2DE32004D; Fri, 28 Apr 2023 16:38:54 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71DA020043; Fri, 28 Apr 2023 16:38:52 +0000 (GMT) Received: from li-ed75614c-32e0-11b2-a85c-ba2953069b43.ibm.com.com (unknown [9.43.42.160]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 28 Apr 2023 16:38:52 +0000 (GMT) From: Akanksha J N To: linux-kselftest@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: rostedt@goodmis.org, mhiramat@kernel.org, shuah@kernel.org, naveen.n.rao@linux.ibm.com, akanksha@linux.ibm.com, "Naveen N . Rao" Subject: [PATCH v3 1/2] selftests/ftrace: Add new test case which adds multiple consecutive probes in a function Date: Fri, 28 Apr 2023 22:08:41 +0530 Message-Id: <20230428163842.95118-2-akanksha@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230428163842.95118-1-akanksha@linux.ibm.com> References: <20230428163842.95118-1-akanksha@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dLm0FE2YlPeEtHARPFhB-2Drxon920ql X-Proofpoint-ORIG-GUID: dLm0FE2YlPeEtHARPFhB-2Drxon920ql X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-28_04,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 bulkscore=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304280133 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 97f88a3d723162 ("powerpc/kprobes: Fix null pointer reference in arch_prepare_kprobe()") fixed a recent kernel oops that was caused as ftrace-based kprobe does not generate kprobe::ainsn::insn and it gets set to NULL. Add new test case kprobe_insn_boundary.tc which adds a kprobe at every byte within $FUNCTION_FORK up to an offset of 256 bytes, to be able to test potential issues with kprobes on successive instructions. The '|| continue' is added with the echo statement to ignore errors that are caused by trying to add kprobes to non probeable lines and continue with the test. Signed-off-by: Akanksha J N Acked-by: Naveen N. Rao Acked-by: Masami Hiramatsu (Google) --- .../test.d/kprobe/kprobe_insn_boundary.tc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_insn_boundary.tc diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_insn_boundary.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_insn_boundary.tc new file mode 100644 index 000000000000..4f7cc318f331 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_insn_boundary.tc @@ -0,0 +1,19 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2023 Akanksha J N, IBM corporation +# description: Register multiple kprobe events in a function +# requires: kprobe_events + +for i in `seq 0 255`; do + echo p $FUNCTION_FORK+${i} >> kprobe_events || continue +done + +cat kprobe_events >> $testlog + +echo 1 > events/kprobes/enable +( echo "forked" ) +echo 0 > events/kprobes/enable +echo > kprobe_events +echo "Waiting for unoptimizing & freeing" +sleep 5 +echo "Done" -- 2.31.1