Received: by 2002:a05:6500:1b41:b0:1fb:d597:ff75 with SMTP id cz1csp324505lqb; Tue, 4 Jun 2024 12:30:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX90omkYYuaPu78j4mIKqetGGNckz7nt19JmYGsgx1IoRWjoJD0OTEb7aqG0R16cCFF6026C8N2gWfLEB5AU4O4vTuu6h47rdcFM2S8Cg== X-Google-Smtp-Source: AGHT+IF7YSOEc0CGpmdN5G4TU04wFLaVR02IYShxnO4midrPtKMVK/bybMaaKZ/qtkOdahLMpIlX X-Received: by 2002:a05:6e02:1a82:b0:374:9481:d19c with SMTP id e9e14a558f8ab-374b1f06deamr2501745ab.18.1717529404397; Tue, 04 Jun 2024 12:30:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717529404; cv=pass; d=google.com; s=arc-20160816; b=axnLcOW2w7mG/zmGTIED4I+IIAMl9zDQRZwSkiGoRyacjPfDPiabiF3LRqVycOV1Uv DJXs6J8ZfRdy4QCGckKMHYiYRdwFJguPHZSIg0zM54fBOUvpGqj3/mdi7P9CugJQ0L27 h1uA/nRkEHIqicjFq59/bm5ge+v0lTzhqDgUweDW5WICU+O5Q4Cc8qJS32FdBw8qrRzH CgrxiZjKMpQV2tFbDxBX9AtDaLw9r0ykehs2dTPgQz+VbCfb+h48URJRK1o7LISBiVP2 RlIidYb2O9wNturUr0ndvSyFDa/UR0pJVHn8HyXZvQOK4XCJlzFuMQzYz5gftRAnf6pa nJGA== 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:message-id:subject:cc:to:from :date; bh=5/JCvpMxIA3zxt1+sJcq8T+Zq7rbn2jtNkKT+86pNBU=; fh=zUYoqPPyjvQ6rCrD+afgiWfy/Dsjd8P+Tjoa0MxCZSY=; b=vrqL0IEmc+4Fh8cNfQ1CnA1zScO/xZYUo2Y10yyBHFLu9J8ZxZJNWjwOZTrf7sGGXS RP04hoqnao0LrUpMW+FEEo/6zBvT7NQ9A/r4LaSGGdhucIROC5uDhqiGfGmYqhYDTu8d VlPQuGufxmNxfFsQYpM4J+Gn7l5sVlZlCnXw+S/bIh+5/eIAO180hZAD8oEAyX6pqfmU 1i6kK0cXQmZ3pculZpHAPsbZ0OrbM5J15aAR0VK14ViMZ3gjWWx/auBDTL2eML8Z54te qk6fXkXsTuAgjxdL8YNNLPNoujBLjkkcXtLSaoBneCNb3aGGYN7Ax2lUb3n1V+cp3mAy QQng==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201282-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201282-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c359e09e44si1257602a12.407.2024.06.04.12.30.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 12:30:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201282-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-201282-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201282-linux.lists.archive=gmail.com@vger.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 79044B23B55 for ; Tue, 4 Jun 2024 19:25:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE07D14AD32; Tue, 4 Jun 2024 19:25:51 +0000 (UTC) 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 74209801; Tue, 4 Jun 2024 19:25:51 +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=1717529151; cv=none; b=Ws6+vV2euuEClgrjw8G2j1ZyJfrmuRTbrSZQxqs9qUmLplxd82/96LC2TPJkSvz0HIpXnkAmRz4yQxTrWtW9Au8Fi6hOSBXIylRaV3OLZm8CjjI0T50kd+didhu3p7sbij+SdTvAbRcs3xsqlrnRW/NpZ6AQMhAmJsIojw07AzU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717529151; c=relaxed/simple; bh=5k7gRhciOuBbwTDEYqzm+9sLuvG1nIhAitQwJrGdHMs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=aXXVI+pZGvg9yV01hMTgBGFmR54W5SYi2w1eDHPZ0tGu0tfIiFPra0TL8VpBQxPR9R/6H1NWe9pePtbVZIKiGqFYyeCCcxOYvVKjc6oFouTjVKD8xhHQKsEQ2s9R7MbRbMI4dLYLc3bIu0F9hRfF8P90RuHAXRgURo3SmO5+LqQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6871CC2BBFC; Tue, 4 Jun 2024 19:25:50 +0000 (UTC) Date: Tue, 4 Jun 2024 15:25:50 -0400 From: Steven Rostedt To: LKML , Linux Trace Kernel Cc: Masami Hiramatsu , Mathieu Desnoyers , Mark Rutland Subject: [PATCH] ftrace/selftests: Fix pid test with function graph not showing pids Message-ID: <20240604152550.0c01d7cd@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=US-ASCII Content-Transfer-Encoding: 7bit From: "Steven Rostedt (Google)" The pid filtering test will set the pid filters and make sure that both function and function_graph tracing honors the filters. But the function_graph tracer test was failing because the PID was not being filtered properly. That's because the funcgraph-proc option wasn't getting set. Without that option the PID is not shown. Instead we get: + cat trace # tracer: function_graph # # CPU DURATION FUNCTION CALLS # | | | | | | | 3) ! 143.685 us | kernel_clone(); 3) ! 127.055 us | kernel_clone(); 1) ! 127.170 us | kernel_clone(); 3) ! 126.840 us | kernel_clone(); When we should be getting: + cat trace # tracer: function_graph # # CPU TASK/PID DURATION FUNCTION CALLS # | | | | | | | | | 4) bash-939 | # 1070.009 us | kernel_clone(); 4) bash-939 | # 1116.903 us | kernel_clone(); 5) bash-939 | ! 976.133 us | kernel_clone(); 5) bash-939 | ! 954.012 us | kernel_clone(); The test looks for the pids it is filtering and will fail if it can not find them. Without fungraph-proc option set, it will not be displayed and the test will fail. Link: https://lore.kernel.org/all/Zl9JFnzKGuUM10X2@J2N7QTR9R3/ Fixes: 35b944a997e2 ("selftests/ftrace: Add function_graph tracer to func-filter-pid test") Reported-by: Mark Rutland Signed-off-by: Steven Rostedt (Google) --- tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc index c6fc9d31a496..8dcce001881d 100644 --- a/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc +++ b/tools/testing/selftests/ftrace/test.d/ftrace/func-filter-pid.tc @@ -8,6 +8,7 @@ # Also test it on an instance directory do_function_fork=1 +do_funcgraph_proc=1 if [ ! -f options/function-fork ]; then do_function_fork=0 @@ -28,6 +29,7 @@ fi if [ $do_funcgraph_proc -eq 1 ]; then orig_value2=`cat options/funcgraph-proc` + echo 1 > options/funcgraph-proc fi do_reset() { -- 2.43.0