Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2179773imm; Mon, 28 May 2018 03:21:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrL52IUVjxvRTser+899ThFeaFKP0h+NR9ttDRGpgry/M2Od02BihEdozLhIw64ME0bkyeO X-Received: by 2002:a65:4ecc:: with SMTP id w12-v6mr10100032pgq.214.1527502897163; Mon, 28 May 2018 03:21:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527502897; cv=none; d=google.com; s=arc-20160816; b=FniEv5b/SaIJSRkEYANjEHd7jHCa4cStYRbLpKS2KKCoi+ZGmlnGa/C/W1r1nQ1X52 h6UXiiDd/fei4rwANEulw6QD/7BWm3kt0kuKTW++6iE4h0HdXtCEGbNYIJZTc2alpLtn ODmXlwGy6oY4nKqSnvxnuYD88MDiwJlhPoDg4VHDNsmX+dmBrS27p82h9Dhxm9q5ZTd8 7eKbx4BILpSsOSjnHe5CSX+IIovxMle4qMGaneYMZL4+1Sf+WLzz0NEgXC1AYaI+wFmk g+Ot47P3D/WqREhh9pGzAOtb7XdOxPHFhNI6l4EewSnYaE3whMek0dungdfVS9Lhn9R/ iYSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Ol92Ogu2ykg14ZQ6TbRPgXVrG/atAZnmpmC0IRCxpk0=; b=nDCLJ3AnMw/LTDtWDpC+HfwjBfO1cNB6cSvhUkjlw7hU2DkIYw3srT/ommoJr9x+rN NzLcfiJp6O6j4jODTwx92scTJKkCj8Evxqb/hnwsOEhs5XToKg83fQCB0vQ8XOnDEzQq Aebk3gGqg7I5pD4thuUqU3Bcyh9JTIRPt/9AYdYxaIlD7iPznQcw5LcIBiGY1a8CIzSI /hRtf1kDDthizMS8ogxfyrgO2ThJaeIICkLOPCTIHjXktPAuIthF5YqdB5G5bdOn32gB sbL0QR/WAddwVDFoNAioG2YJ3Gl50K83zn6OWto80T8sX8rxvYlX3wO/omM8IZSeaTXQ k6+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ciHqzc3O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g63-v6si878778pfk.74.2018.05.28.03.21.22; Mon, 28 May 2018 03:21:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ciHqzc3O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033297AbeE1KVF (ORCPT + 99 others); Mon, 28 May 2018 06:21:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:40500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033218AbeE1KU5 (ORCPT ); Mon, 28 May 2018 06:20:57 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 40C0D2088E; Mon, 28 May 2018 10:20:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527502856; bh=xJHsx/CY3tFR2nqWO6Udi9zQwxlDXeN7aeoPiGZryLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ciHqzc3OvHTkns8o20nXFeJKKFzmW5Ak12t1/B1Utfy/Wd2kf1BVX89+7bA3Mpo7k UqAySw9drZyJl5MJHGH/Bl5DvPxxQWLiROYly0wqTOE2akDVvoDTGvahOi8EY1hr9p wixIhgCIzuRLMoCBj2a/uAgjr8Jqkx+nBGb59rzY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , "Steven Rostedt (VMware)" , Sasha Levin Subject: [PATCH 4.4 146/268] selftests: ftrace: Add a testcase for string type with kprobe_event Date: Mon, 28 May 2018 12:02:00 +0200 Message-Id: <20180528100218.879984627@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100202.045206534@linuxfoundation.org> References: <20180528100202.045206534@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu [ Upstream commit 5fbdbed797b6d12d043a5121fdbc8d8b49d10e80 ] Add a testcase for string type with kprobe event. This tests good/bad syntax combinations and also the traced data is correct in several way. Link: http://lkml.kernel.org/r/152129038381.31874.9201387794548737554.stgit@devbox Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc | 46 ++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc @@ -0,0 +1,46 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Kprobe event string type argument + +[ -f kprobe_events ] || exit_unsupported # this is configurable + +echo 0 > events/enable +echo > kprobe_events + +case `uname -m` in +x86_64) + ARG2=%si + OFFS=8 +;; +i[3456]86) + ARG2=%cx + OFFS=4 +;; +aarch64) + ARG2=%x1 + OFFS=8 +;; +arm*) + ARG2=%r1 + OFFS=4 +;; +*) + echo "Please implement other architecture here" + exit_untested +esac + +: "Test get argument (1)" +echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string" > kprobe_events +echo 1 > events/kprobes/testprobe/enable +! echo test >> kprobe_events +tail -n 1 trace | grep -qe "testprobe.* arg1=\"test\"" + +echo 0 > events/kprobes/testprobe/enable +: "Test get argument (2)" +echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string arg2=+0(+${OFFS}(${ARG2})):string" > kprobe_events +echo 1 > events/kprobes/testprobe/enable +! echo test1 test2 >> kprobe_events +tail -n 1 trace | grep -qe "testprobe.* arg1=\"test1\" arg2=\"test2\"" + +echo 0 > events/enable +echo > kprobe_events