Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp333240lqt; Thu, 6 Jun 2024 05:16:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcGzEd9VI3zR4cjl6N2ebbra/o+0n3vxFDhcH1OLCxICewHSbKE9tGqALDAVo/ADFLxpiqOvaQ5WnywOzY0khylh6ZDStk1PoQmVBWwQ== X-Google-Smtp-Source: AGHT+IFJ8hqFObYeYSvEbT8BXXuqJHUznZpeleH4SOt8qRcya+SYGRuO4eXXtOzZnxiAldVsFLPP X-Received: by 2002:a05:6a20:daa4:b0:1a7:aabc:24ae with SMTP id adf61e73a8af0-1b2b6ed7966mr6315141637.18.1717676170269; Thu, 06 Jun 2024 05:16:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717676170; cv=pass; d=google.com; s=arc-20160816; b=DGGbcXtBZ2ot+dKssaEJLFtqrlI6dIIIzWsA8VQkYmNLS/A+4D6k95NHPzFikuZr9o hXopkCkB2ngOpChCLT6ATgn5Odgt8jwATlrFUdRMCbtS7X2p2MPBR7Vu4poiQZNDk893 SewT4Ts+jbyeL39RP2W7ngrMVR9XY7GDRxoKQYN/HiZp9FFfUpFUo9rV3Er2KSfGkJ9l idTWHqgAVtEB2JZH8LyvFKlI4ahad4NJjFQbOMfua2It80RymXp+b+KGx/DxVLncpHFJ F4EgOpfNuGMHHNnRBl/b92Yl2E4/RNcmxVvONIRoqszgOJKK9rxwBLS1mI2gvz/ryyVi PS8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:subject:cc:to:from:date:user-agent:message-id; bh=6g8IsdHt20uptTB8lgGouYQJj8MeKZq692LJlfxb9J0=; fh=mTYg3JJ8i2GBNLFt8qb4bgYwOyk0kmrOzICLbi6qJ1c=; b=fG1x4Ie1ibz6BkP87cIwyehG65GhEHCFkk3QubleWMSfzuyUXMCON+S1E5zOwFbWEr j/Uwhlkngb+OUubXuukA/zASNWAGu1GUgiffb4Tk6X4BovT40hA9HhwFT8rc/0GZZXsO GKZcjJPtVPzZB4q/HnRZ50DdfJpOiQOBwKud3Qpndb0Npn5eucY83cK4r76s3DDdI13s 9/cFNxG6us5C793fUYJu6mGq0uhrhPPXWMY20TzW0vYVWUGaIlHzAdTWfxTyzrlXE5WT 4Sjn+QTZF1x4IHDoQpW8niVb8qQ9HDDDWeXZ9vLxIhNkSP89OGxxgP0uU6brdXUqX36W 8hlQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-204242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204242-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-703fd3afcd1si1024996b3a.106.2024.06.06.05.16.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 05:16:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-204242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204242-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 DB746B24B20 for ; Thu, 6 Jun 2024 12:13:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D6FD195F2B; Thu, 6 Jun 2024 12:11:01 +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 C81FB19599A for ; Thu, 6 Jun 2024 12:11: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=1717675860; cv=none; b=AQUVw/12oPKgo2xoaq/lV9Zk//XHL/41n2ieJCwHr/em+8abIzgu2IZDlsSToeSrB3swvMC8N4tIrMmwo82sTmvOJjhzKQXAUkotM6Y8eMG4h9aDoEC4udhbhEmx+l4skLnT3mWBCTgPi1JbaajVQ38lU2rxvpc7baILbQYC0pQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717675860; c=relaxed/simple; bh=Rspk0buCUkwvxU8eo6olbM8rLVcIyG11H0MjJgWcYCo=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=HHVHb7cmZ7lR5a3MovbV12lWzadrUGUg6+3G0ctpHkQcmbbZEDjMk0UT6ySMLIYNRoEapDarBoe9A+1UBt19VEefIDBtf8NEgwYJwVJGXqAkI1A0ABn9kFXfVbQqUwRtRGtzD15+p8eZlpmfRp6ysbYhbRjsY0M6GGACG4ygz60= 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 5B6EBC4AF1A; Thu, 6 Jun 2024 12:11:00 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1sFBxQ-00000000nJN-3c1Y; Thu, 06 Jun 2024 08:11:04 -0400 Message-ID: <20240606121104.719232091@goodmis.org> User-Agent: quilt/0.68 Date: Thu, 06 Jun 2024 08:10:06 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Andrew Morton Subject: [for-next][PATCH 02/15] ftrace/selftests: Fix pid test with function graph not showing pids References: <20240606121004.857581251@goodmis.org> 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 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/ Link: https://lore.kernel.org/linux-trace-kernel/20240604152550.0c01d7cd@gandalf.local.home Cc: Masami Hiramatsu Cc: Mathieu Desnoyers Fixes: 35b944a997e2 ("selftests/ftrace: Add function_graph tracer to func-filter-pid test") Reported-by: Mark Rutland Signed-off-by: Steven Rostedt (Google) Tested-by: Mark Rutland --- 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