Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp182675lqr; Wed, 5 Jun 2024 02:53:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDCkN27OQL3pA0jspHCLwJPot+TXE6J4V0sjsc13xqtAdji7m1zne1BkVrTQr8R5HY4otntCpQRcUr5y7yKYG9B4M4um8wljYLeCzwEQ== X-Google-Smtp-Source: AGHT+IGOg/fu0O3QvT+kfgMy28ZWCGfsSBfIg/c4JjxY4cwtpPPMwwvQDPJNkAl+b57vAjzhZWkG X-Received: by 2002:a50:9559:0:b0:574:f83d:b282 with SMTP id 4fb4d7f45d1cf-57a7a68999amr4089259a12.2.1717581190964; Wed, 05 Jun 2024 02:53:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717581190; cv=pass; d=google.com; s=arc-20160816; b=fXJd2fDCTKvM1djznYo7SmzyBlp2C3Jn2crdzU1v/B82afudTQulBEjZi+PYzcv+aS u3AXerjj0dZKWiMNdqrw8iElLAKc5QjrqgljBNclW0OZIotG/vbG814GPusF1oIMRvOR u+e29wmt9cp1TqJnnyeaq9hh9I1f3G8VyvnebWlkQGbspAS7lnc4Ol8pesaQy1jzdiYC 5VViBfEKWRJAbI9EMWHdT7eY0DxMjmAOeSaatHgOD9tluVVrCbyAdwoQrj0gkfDkn6RF gvgIOLZxkF8vL+FKW9se4a2NZNeT+HRJYku8k7CJmAakPFIPDNhpRKL2Husv7cZu1DMZ gEPQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=GBn4GyGOf56djPrsTeaaRKcjTOlnpF9C9EWHxoYUYf4=; fh=urpwA9qFkHTMgj2GGwgW1EOwrKQ3iojgE0lW0ov8vP0=; b=zzK4f1wapqHlw82DoLPRUWc97ZVsOu1rwWslhoY8pxD26ciaQijaObaWCr6YLhh5aj K7cvcfFC+82vnC1KLI7JOUuW93QE5a23+iUyZM+GUydL8SNP3H9TYkfRJI/JF8omD9qG dGu0S7Lib8XlB7YWHnw5MLP8Kor7kc4P2xOAa1AqBTMF2hiSeLV39Tvctop8W+Sn0gEw 3mSYpTmbxwTAmmznFj633IvKFJhBFCenuWO/m6ceILM1wovFDZTimbmWxU9mHQ8iXPac A2ip5h8UnR8UHxM8gtCNVqG8DgPDPMZkpMGdxAZHqrOz7PQ1sETdD9lZ/HeUH5WQ4EVU 2dtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-202139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a5f5630e9si3317356a12.568.2024.06.05.02.53.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 02:53:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-202139-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id F31451F26928 for ; Wed, 5 Jun 2024 09:46:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F36D718FC7C; Wed, 5 Jun 2024 09:46:00 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D150E1946CA; Wed, 5 Jun 2024 09:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717580760; cv=none; b=nQ9AJ5UDbo8uuPdi/AUZlAsdnckCKv3PrBvQCi5arwBgYOtVr+D1vjYsIukeqvr4UdZus8cVJO0iqAyV3WLaSIkg9GzGwPJJEY4q6YRMQeqrSC/tooXnh+P4HTGi5ScTKv6nx/fawyuLLxQ0jK6HtJsXvN14MFvh3giYzjtDmM8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717580760; c=relaxed/simple; bh=HRhwsCwZJMDT/pJ0buxmvyRoZ6tgXbl42wDlzIPXQGs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Yosi5M8EFnHx+xZt+ATusVR8bEVeKjwxI9p5mcDPtwne9d58o9mAV5RSpbPebXDBZLGVWHnLwhQWX9vsMmRNIPhWXTHRvusmh4rlHTfmY/C6yTTimy6BWj/uyk1I6olnZ/Z7cRnLIbOFRt9v7P+SABZ5/qALwnSIkLStNVMGaS4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F951DA7; Wed, 5 Jun 2024 02:46:22 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 426913F792; Wed, 5 Jun 2024 02:45:57 -0700 (PDT) Date: Wed, 5 Jun 2024 10:45:54 +0100 From: Mark Rutland To: Steven Rostedt Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Mathieu Desnoyers Subject: Re: [PATCH] ftrace/selftests: Fix pid test with function graph not showing pids Message-ID: References: <20240604152550.0c01d7cd@gandalf.local.home> 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-Disposition: inline In-Reply-To: <20240604152550.0c01d7cd@gandalf.local.home> On Tue, Jun 04, 2024 at 03:25:50PM -0400, Steven Rostedt wrote: > 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) Applying this makes the pid filter tests go from FAIL to PASS, so FWIW: Tested-by: Mark Rutland Mark. > --- > 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 >