From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2855BC6778F for ; Fri, 27 Jul 2018 12:20:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D1894208B1 for ; Fri, 27 Jul 2018 12:20:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fSAKOl5x" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D1894208B1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388924AbeG0NmY (ORCPT ); Fri, 27 Jul 2018 09:42:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:36316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388752AbeG0NmX (ORCPT ); Fri, 27 Jul 2018 09:42:23 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (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 4BC46208B3; Fri, 27 Jul 2018 12:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532694042; bh=FLR6dGSYw81X/CANGC4neUcxWu1VPjGc4z38WR9zERg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSAKOl5x3YSo22OPg95eUTjH+bTvzwMzcdqarioPOhp3Hpyrt4QP6N3C/GHeIUPF6 7jeAekJjgrq/xQtVTD4+SMG1JaIJDNhagRIDQI+yqlt7PHDIt2U8ZpiL3xrbA1Sd9Y 7nOFRxJeSxlJRJCQJAZ3J6zTltppzNzSmreZrUJk= From: Masami Hiramatsu To: Shuah Khan , Steven Rostedt Cc: Ingo Molnar , Masami Hiramatsu , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 22/25] selftests/ftrace: Add function profiling stat testcase Date: Fri, 27 Jul 2018 21:20:19 +0900 Message-Id: <153269401935.3084.14477880989343988808.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <153269339575.3084.16279591141931053689.stgit@devbox> References: <153269339575.3084.16279591141931053689.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a testcase for function profiling per-cpu statistics interface. There is already func_profile.tc, but that is mainly focusing on the combination of function-profiler and function tracer. This testcase ensures trace_stat per-cpu function statistics is correctly updated. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/ftrace/func_profile_stat.tc | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc new file mode 100644 index 000000000000..1d2440d80ec3 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc @@ -0,0 +1,23 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: ftrace - function profiling + +[ ! -f function_profile_enabled ] && exit_unsupported + +: "Enable function profile" +echo 1 > function_profile_enabled + +: "Profile must be updated" +cp trace_stat/function0 $TMPDIR/ +( echo "forked"; sleep 1 ) +: "diff returns 0 if there is no difference" +! diff trace_stat/function0 $TMPDIR/function0 + +echo 0 > function_profile_enabled + +: "Profile must NOT be updated" +cp trace_stat/function0 $TMPDIR/ +( echo "forked"; sleep 1 ) +: "diff returns 0 if there is no difference" +diff trace_stat/function0 $TMPDIR/function0 + From mboxrd@z Thu Jan 1 00:00:00 1970 From: mhiramat at kernel.org (Masami Hiramatsu) Date: Fri, 27 Jul 2018 21:20:19 +0900 Subject: [PATCH 22/25] selftests/ftrace: Add function profiling stat testcase In-Reply-To: <153269339575.3084.16279591141931053689.stgit@devbox> References: <153269339575.3084.16279591141931053689.stgit@devbox> Message-ID: <153269401935.3084.14477880989343988808.stgit@devbox> Add a testcase for function profiling per-cpu statistics interface. There is already func_profile.tc, but that is mainly focusing on the combination of function-profiler and function tracer. This testcase ensures trace_stat per-cpu function statistics is correctly updated. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/ftrace/func_profile_stat.tc | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc new file mode 100644 index 000000000000..1d2440d80ec3 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc @@ -0,0 +1,23 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: ftrace - function profiling + +[ ! -f function_profile_enabled ] && exit_unsupported + +: "Enable function profile" +echo 1 > function_profile_enabled + +: "Profile must be updated" +cp trace_stat/function0 $TMPDIR/ +( echo "forked"; sleep 1 ) +: "diff returns 0 if there is no difference" +! diff trace_stat/function0 $TMPDIR/function0 + +echo 0 > function_profile_enabled + +: "Profile must NOT be updated" +cp trace_stat/function0 $TMPDIR/ +( echo "forked"; sleep 1 ) +: "diff returns 0 if there is no difference" +diff trace_stat/function0 $TMPDIR/function0 + -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: mhiramat@kernel.org (Masami Hiramatsu) Date: Fri, 27 Jul 2018 21:20:19 +0900 Subject: [PATCH 22/25] selftests/ftrace: Add function profiling stat testcase In-Reply-To: <153269339575.3084.16279591141931053689.stgit@devbox> References: <153269339575.3084.16279591141931053689.stgit@devbox> Message-ID: <153269401935.3084.14477880989343988808.stgit@devbox> Content-Type: text/plain; charset="UTF-8" Message-ID: <20180727122019.btEI1stfSmlx8LNjniOYZRyCT2tv-a9mbEWI8igshzI@z> Add a testcase for function profiling per-cpu statistics interface. There is already func_profile.tc, but that is mainly focusing on the combination of function-profiler and function tracer. This testcase ensures trace_stat per-cpu function statistics is correctly updated. Signed-off-by: Masami Hiramatsu --- .../ftrace/test.d/ftrace/func_profile_stat.tc | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc new file mode 100644 index 000000000000..1d2440d80ec3 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func_profile_stat.tc @@ -0,0 +1,23 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: ftrace - function profiling + +[ ! -f function_profile_enabled ] && exit_unsupported + +: "Enable function profile" +echo 1 > function_profile_enabled + +: "Profile must be updated" +cp trace_stat/function0 $TMPDIR/ +( echo "forked"; sleep 1 ) +: "diff returns 0 if there is no difference" +! diff trace_stat/function0 $TMPDIR/function0 + +echo 0 > function_profile_enabled + +: "Profile must NOT be updated" +cp trace_stat/function0 $TMPDIR/ +( echo "forked"; sleep 1 ) +: "diff returns 0 if there is no difference" +diff trace_stat/function0 $TMPDIR/function0 + -- To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html