Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp249224lqb; Thu, 23 May 2024 17:50:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWnxnUuIBnyKcvWyJ4FGIFwT0sR2cVpd6JIPrPal/h4NANmrXRpa7SP366zCT3ChWHn9DpKsHVEVPe946xKSjFegeK4Pm0tkzfOXEqUzw== X-Google-Smtp-Source: AGHT+IH1fi+qC12NqtgExT45tWxY0KSRi+682kMKz581uEHAbReDpVsMe3Jb2Ow46/sUtc6CoIR3 X-Received: by 2002:a17:902:f7d2:b0:1f3:3d2c:a771 with SMTP id d9443c01a7336-1f4497dd05amr7647045ad.51.1716511807295; Thu, 23 May 2024 17:50:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716511807; cv=pass; d=google.com; s=arc-20160816; b=CraUbKSHASPhkTPcLjaz7zM9n6FiQmox8QUcBEA/vXYrRGMBRp1p7bwBkj4LGIXDoX K9Hg2YORqGFxdWfsXZsJAxzETniCaSgV3vF4OCEWZLWbI+rkO0DyoOB9fQAmlc6IgZil Ci3vGWUHZ9GH7v+6sBXcR8Bz/4AzQ4P8IrMSIsjoQuXsD9K8F7iZa7GSTCnR+QmU51Et xmeSaBC0o/fEa4xmD6vv9ZZFmZtnmXiN/0xgQLx7Z9zvEUaOubzAntfn4E/hA2D59VW+ t1xPp3oAuXr4UwodzOSCdQuf128gvcOka43sLOkUaIHCuoeuiNEwYvCbXJTtpVBNRbsu 1+fQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:message-id:date :subject:cc:to:from:dkim-signature; bh=gvahSgcGZzNGSvk1D1diIEMuYvMf/8dHtOWfgoWDBmo=; fh=0dK1JHtDrB+X7nzGZtjdSd6kZpL6hwvV53Do0yN3Ckg=; b=jJg3In+F2vyO33tmiSVf1xKpNKU98MdV+RiZxdplhU2sV4F2QDPNT2JlwbvQtYySvt O9WsN1ZzLWegifBLbA9eUATUv3+BD7pXbNbIcSCPhZuJCRX9+uQphFJ2gAk4MZo5U4Tq Jp3WlIZb6YWDPqWQwE7jnLM/y+jQbO6WysHX2e8LNJK5+9e6tFm5QSSUC6LCJDge4+ZM SdU3EdcvH7CVHwcH7yxn1JKeSalYX9RHhBanKyVvuovIz4zgBOuo9JQMU2awBbifpzyr oIIWfelyXaRT8gHgCX/M8dcenrn/8hOJP7zyeACwRWAR+JtLTI7D9W+nE9rZcuAcc2Hk MpEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E9RpxoVD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-188188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f44c970d72si3006705ad.266.2024.05.23.17.50.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 17:50:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E9RpxoVD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-188188-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188188-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 44A462832AA for ; Fri, 24 May 2024 00:50:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C0C3749C; Fri, 24 May 2024 00:50:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="E9RpxoVD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9FF881F; Fri, 24 May 2024 00:50:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716511800; cv=none; b=cWbxXdm5pwKnYv9Gm8DrrCtd01Dt/Yeg2tR3UBjFCKN1nnTnUqRuK8mKLRF3aRPeW5yh1uZxQMR4yNlw5YZBhdFV/vrcXweHsYMySDpTkman8OrkGNUWMYckyY9N9vTZAPcUBUULn1t0486hWv3Q9UdBWk2FL8gqibRhEufMiVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716511800; c=relaxed/simple; bh=DruTHJyj0udcvCsGY6ote/v3/C47/j6EtDcf/pbii1E=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=tsIvdV1wayT42lL51n//x3QkRcbTFMG+phrlmdXsy8PV7a6Ndj0fAzE/jPiVg0TJGLfKfST16qicuA0QjHbmCbc5pdNNPEuGorZTBt1NpgMdBYiGHSyV5vydZm9BAkOcnA8Be+zLZqEh1/KLMJEMdCUm5jDDAj9x5agy6ISqVvY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=E9RpxoVD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C4BA0C2BD10; Fri, 24 May 2024 00:49:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716511800; bh=DruTHJyj0udcvCsGY6ote/v3/C47/j6EtDcf/pbii1E=; h=From:To:Cc:Subject:Date:From; b=E9RpxoVDTZT8VUAfzxM0vIdFsCXwP7cQpV9Isb3qL9yXRJd52kbzg4yQ5cBH9D56d vNcTzXTsoGta450Wou4eObbYEs7M5hT0TfnJuj7fQmqyFaG/lhRFs2zn3bosniAC9H 2lomszHSAN4cFyiglE/RKpGo4Ti8oWULMVf6bPSCypP4eMJKppVZqj0bbcP3+iNCha uJTSGBFylKIye+VCNYRinJioJbnAi50ZYNQn9Vk3/bU7fW4K9KLAiyxJYID3YzmdSA sFR3Kv0qynewXPCoer94pj+1qw0XKv/Vxga+PHZdBueIKjs8yyaMXDkLBJTcCKK5eQ h6kk9/+2vJ46w== From: "Masami Hiramatsu (Google)" To: Steven Rostedt , Shuah Khan Cc: Andrii Nakryiko , oleg@redhat.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mhiramat@kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH] selftests/uprobes: Add a basic uprobe testcase Date: Fri, 24 May 2024 09:49:55 +0900 Message-Id: <171651179523.161068.3164659198838770307.stgit@devnote2> X-Mailer: git-send-email 2.34.1 User-Agent: StGit/0.19 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit From: Masami Hiramatsu (Google) Add a basic uprobe testcase which checks whether add/remove/trace operations works on /bin/sh. Signed-off-by: Masami Hiramatsu (Google) --- .../ftrace/test.d/dynevent/add_remove_uprobe.tc | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc new file mode 100644 index 000000000000..a275decdc880 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc @@ -0,0 +1,26 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Generic dynamic event - add/remove/test uprobe events +# requires: uprobe_events + +echo 0 > events/enable +echo > dynamic_events + +echo 'cat /proc/$$/maps' | /bin/sh | \ + grep "r-xp .*/bin/.*sh$" | \ + awk '{printf "p:myevent %s:0x%s\n", $6,$3 }' >> uprobe_events + +grep -q myevent uprobe_events +test -d events/uprobes/myevent + +echo 1 > events/uprobes/myevent/enable +echo 'ls' | /bin/sh > /dev/null +echo 0 > events/uprobes/myevent/enable +grep -q myevent trace + +echo "-:myevent" >> uprobe_events +! grep -q myevent uprobe_events + +echo > uprobe_events + +clear_trace